[Insight-users] how to define a filter's output smaller than input

Renaud Isabelle renauisa at yahoo.fr
Tue Nov 8 09:51:19 EST 2005


Hi,
 
I didn't think to derive my own filter from ExtractImageFilter: this should be more easier. 
 
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.
 
template <class TInputImage, class TOutputImage>
void
MyExtractSliceImageFilter< TInputImage,TOutputImage >
::SetSlice(unsigned int slice)
{
   this->slice_number = slice;
    
    TInputImage::SizeType size = this->GetInput()->GetRequestedRegion().GetSize();
    size[2] = 0;
    TInputImage::IndexType start = this->GetInput()->GetRequestedRegion().GetIndex();
    start[2] = this->slice_number;
                 
    TInputImage::RegionType region;
    region.SetSize(size);
    region.SetIndex(start);    
    this->Superclass::SetExtractionRegion(region);  
}   
 
Thank you for any help,
 
Isabelle

"Miller, James V (Research)" <millerjv at crd.ge.com> a écrit :
Isabelle, 
 
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
pipeline.
 
Jim
-----Original Message-----
From: insight-users-bounces+millerjv=crd.ge.com at itk.org [mailto:insight-users-bounces+millerjv=crd.ge.com at itk.org]On Behalf Of Renaud Isabelle
Sent: Monday, November 07, 2005 12:14 PM
To: insight-users at itk.org
Subject: [Insight-users] how to define a filter's output smaller than input


Hi, 
 
I would like to define my own ExtractImageFilter, calling the itk::ExtractImageFilter inside.
 
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 that my output data is 2D whereas my input is of size 3D. 
 
Could you tell me which functions I have to override.  
 
   -  virtual void GenerateInputRequestedRegion();
   -  virtual void EnlargeOutputRequestedRegion(DataObject *output);
  -   virtual void GenerateOutputInformation()
 
??
 
As theses functions are already implemented in itkExtractImageFilter, I thought I don't have to override them, but apparently I am wrong. 
 
please help me,
 
Isabelle


---------------------------------
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici ! 
		
---------------------------------
 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
 Téléchargez le ici !  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051108/34c176cc/attachment.html


More information about the Insight-users mailing list