[Insight-developers] BinaryThinningImageFilter

Miller, James V (Research) millerjv at crd.ge.com
Mon Oct 11 11:49:21 EDT 2004


I was just looking at the BinaryThinningImageFilter code.
 
It looks like this filter is missing a some pipeline methods.  The filter
prepares it output image (setting regions and allocating memory) using
information from the input image as opposed to using the pipeline methods to
properly set up the output image.
 
In the method BinaryThinningImageFilter::PrepareData(), lines 
 
  thinImage->SetLargestPossibleRegion( 
    inputImage->GetLargestPossibleRegion() );

  thinImage->SetBufferedRegion( 
    inputImage->GetBufferedRegion() );

  thinImage->SetRequestedRegion( 
    inputImage->GetRequestedRegion() );

  thinImage->Allocate();

should be replaced with
 
    thinImage->SetBufferedRegion( thinImage->GetRequestedRegion() );
    thinImage->Allocate();
 
alternatively, this method could simply call
 
    this->AllocateOutputs();
 
Does this filter have to produce all of the output?, i.e. does the output
image have to match the size of the input image? If so, the filter needs an
EnlargeOutputRequestedRegion() method.
 
Does the filter need all of its input to produce an output?  Or can the
filter operate on a subset of the input and produce the correct output? If
the former, the filter needs a GenerateInputRequestedRegion() method.
 
Finally, looking at the code, the filter appears to only be for 2D data
(although the header says it is N-dimensional).  Can this algorithm be
generalized for 3D data?  If not, we should put in a concept check to ensure
the image is two-dimensional.  We should then probably rename the filter to
have a "2D" designation in the name.
 
 

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv at research.ge.com <mailto:millerjv at research.ge.com> 

james.miller at research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20041011/bfc3326b/attachment.htm


More information about the Insight-developers mailing list