<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>I didn't think to derive my own filter from ExtractImageFilter: this should be more easier. </DIV>
<DIV> </DIV>
<DIV>In fact, what i would like to do is quite simple. However, I can't manage to do it. I am really newbie in writing my own filter, I don't catch it. Sorry for that. Here is what I would have to implement but I got an error as access violation.</DIV>
<DIV> </DIV>
<DIV><STRONG><EM>template <class TInputImage, class TOutputImage><BR>void<BR>MyExtractSliceImageFilter< TInputImage,TOutputImage ><BR>::SetSlice(unsigned int slice)<BR>{<BR> this->slice_number = slice;</EM></STRONG></DIV>
<DIV><STRONG><EM> </EM></STRONG></DIV>
<DIV><STRONG><EM> TInputImage::SizeType size = this->GetInput()->GetRequestedRegion().GetSize();<BR> size[2] = 0;</EM></STRONG></DIV>
<DIV><STRONG><EM> TInputImage::IndexType start = this->GetInput()->GetRequestedRegion().GetIndex();<BR> start[2] = this->slice_number;<BR> <BR> TInputImage::RegionType region;<BR> region.SetSize(size);<BR> region.SetIndex(start); </EM></STRONG></DIV>
<DIV><STRONG><EM> this->Superclass::SetExtractionRegion(region); <BR>}</EM></STRONG> </DIV>
<DIV> </DIV>
<DIV>Thank you for any help,</DIV>
<DIV> </DIV>
<DIV>Isabelle<BR><BR><B><I>"Miller, James V (Research)" <millerjv@crd.ge.com></I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR>
<DIV><SPAN class=467074217-07112005><FONT face=Arial color=#0000ff size=2>Isabelle, </FONT></SPAN></DIV>
<DIV><SPAN class=467074217-07112005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467074217-07112005><FONT face=Arial color=#0000ff size=2>Are you inheriting from ExtractImageFilter or are you merely calling ExtractImageFilter internally to your filter? If you are inheriting from ExtractImageFilter, then you may be able to use the implementations provided by ExtractImageFilter. If you are just calling ExtractImageFilter internally, then your filter must provide these pipeline methods so that it behaves properly within the context of the</FONT></SPAN></DIV>
<DIV><SPAN class=467074217-07112005><FONT face=Arial color=#0000ff size=2>pipeline.</FONT></SPAN></DIV>
<DIV><SPAN class=467074217-07112005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=467074217-07112005><FONT face=Arial color=#0000ff size=2>Jim</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> insight-users-bounces+millerjv=crd.ge.com@itk.org [mailto:insight-users-bounces+millerjv=crd.ge.com@itk.org]<B>On Behalf Of </B>Renaud Isabelle<BR><B>Sent:</B> Monday, November 07, 2005 12:14 PM<BR><B>To:</B> insight-users@itk.org<BR><B>Subject:</B> [Insight-users] how to define a filter's output smaller than input<BR><BR></FONT></DIV>
<DIV>Hi, </DIV>
<DIV> </DIV>
<DIV>I would like to define my own ExtractImageFilter, calling the itk::ExtractImageFilter inside.</DIV>
<DIV> </DIV>
<DIV>I thought that I just have to call itkExtractImageFilter inside my GenerateData() method and graft the output, but I got errors at execution: it seems that I have to override some functions to specify <STRONG>that my output data is 2D whereas my input is of size 3D. </STRONG></DIV>
<DIV> </DIV>
<DIV>Could you tell me which functions I have to override. </DIV>
<DIV> </DIV>
<DIV> - virtual void GenerateInputRequestedRegion();<BR> - virtual void EnlargeOutputRequestedRegion(DataObject *output);</DIV>
<DIV> - virtual void GenerateOutputInformation()</DIV>
<DIV> </DIV>
<DIV>??</DIV>
<DIV> </DIV>
<DIV>As theses functions are already implemented in itkExtractImageFilter, I thought I don't have to override them, but apparently I am wrong. </DIV>
<DIV> </DIV>
<DIV>please help me,</DIV>
<DIV> </DIV>
<DIV>Isabelle</DIV>
<P>
<HR SIZE=1>
<B><FONT color=#ff0000>Appel audio GRATUIT</FONT> partout dans le monde</B> avec le nouveau Yahoo! Messenger<BR><A href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</A> </BLOCKQUOTE></BLOCKQUOTE><p>
                <hr size=1>
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br>
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>