[Insight-users] opening and closing

Miller, James V (GE, Research) millerjv at crd.ge.com
Wed Jun 7 16:37:24 EDT 2006


Gaetan,

If these are the filters with "SafeBordersOn/Off", then we are still at the stage 
where you need to convince me that the only way to get the correct answer is to 
pad the images.

Jim

-----Original Message-----
From: Gaetan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr]
Sent: Wednesday, June 07, 2006 2:27 PM
To: Miller, James V (GE, Research); Marius Staring
Cc: insight-users at itk.org
Subject: Re: [Insight-users] opening and closing



Hi,

Some time ago (I think it was in January), I sent a modified version of those 
filters to Jim, to implement an option to avoid border effects, and to fix 
the typedef bug. It seems that's not fixed yet in the toolkit. Jim ?

I'm not a GraftOutput() expert, but I have also done the GraftOutput like you 
in those files. 
http://voxel.jouy.inra.fr/darcsweb/darcsweb.cgi?r=topHat;a=headblob;f=/itkGrayscaleMorphologicalOpeningImageFilter.txx

Gaetan


On Wednesday 07 June 2006 19:42, Marius Staring wrote:
> Hi,
>
> there are bugs in the GrayscaleMorphologicalClosingImageFilter and
> GrayscaleMorphologicalOpeningImageFilter.
>
> In the GenerateData() method of the closing the following typedefs
>
>   /** set up erosion and dilation methods */
>   typename GrayscaleDilateImageFilter<TInputImage, TOutputImage,
> TKernel>::Pointer
>     dilate = GrayscaleDilateImageFilter<TInputImage, TOutputImage,
> TKernel>::New();
>
>   typename GrayscaleErodeImageFilter<TInputImage, TOutputImage,
> TKernel>::Pointer
>     erode = GrayscaleErodeImageFilter<TInputImage, TOutputImage,
> TKernel>::New();
>
> should be
>
>   /** set up erosion and dilation methods */
>   typename GrayscaleDilateImageFilter<TInputImage, TOutputImage,
> TKernel>::Pointer
>     dilate = GrayscaleDilateImageFilter<TInputImage, TOutputImage,
> TKernel>::New();
>
>   typename GrayscaleErodeImageFilter<TInputImage, TOutputImage,
> TKernel>::Pointer
>     erode = GrayscaleErodeImageFilter<TOutputImage, TOutputImage,
> TKernel>::New();
>
> Something similar holds for the opening, but then the other way around.
>
> Another thing: the opening and closing code are not really consistent
> with each other. The ReleaseDataFlagOn() is in the closing set for both
> the erosion and the dilation, but for the opening only for the dilation.
> Also the grafting is strange: for the closing we have:
>
>     this->GraftOutput( erode->GetOutput() );
>
> and for the opening
>
>     this->GraftOutput( this->GetOutput() );
>
> where I would expect
>
>     this->GraftOutput( dilate->GetOutput() );
>
> I don't really get the grafting, but the laws of comparing things tell
> me something could be wrong. Can someone clarify this?
>
> Cheers,


More information about the Insight-users mailing list