[Insight-users] binary erosion

mauro maiorca mauromaiorca at gmail.com
Mon Dec 3 11:14:54 EST 2007


Hi Gaetan,
I have been incredibly busy last week, at the end I installed the new
ITK as you suggested, and I want to make test on it to see if the
problem persists.
I think you are right, probably it depends on the way I implemented
the code: I use erosion without actually doing the thresholding before
(just after a region growing, and not the one based on thresholding)
so the SetBackgroundValue is actually not invoked and probably is
needed by the erosion. So maybe the problem hasn't show up because
erosion is mainly used after a threshold (and the SetBackgroundValue
can be already somehow setted), but in my code no thresholding at all
before the morphology. So I wanted to see in the last release whether
the problem is solved or not. Anyway, I'll keep you (and the list)
informed as soon as I can. I'm sorry if I cannot do it so quickly (to
snip short code out of my program it requires a bit), but it is in my
wish list ;-)

cheers,
Mauro


On 12/3/07, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>
> Hi Mauro,
>
> I finally tried to erode you 3D image, and still can't reproduce your
> problem. If you can provide a minimal example that can be compiled,
> so I can try to reproduce your problem in the exact same conditions,
> I would be pleased to try to find the problem in the erode filter or
> in your code, and maybe fix a bug in ITK, or add some guards to
> prevent the user doing a mistake with that filter.
>
> Regards,
>
> Gaëtan
>
>
> Le 27 nov. 07 à 01:52, mauro maiorca a écrit :
>
> > Hi Gaëtan,
> > thanks for your interest! The original 3D image (after smoothing,
> > region growing, etc.) is here:
> > http://traversata.altervista.org/segmented.zip
> > I'm trying to do erosion on the white part (with value 255), but
> > unfortunately with any luck.
> > A rude alternative (before implementing my own erosion library, as
> > last desperate attempt) is to export to vtk and then back again to
> > itk.
> > But I would be really happy to do the morphology just using itk.
> >
> > cheers,
> > Mauro
> >
> > On Nov 24, 2007 2:18 AM, Gaëtan Lehmann
> > <gaetan.lehmann at jouy.inra.fr> wrote:
> >>
> >> Hi,
> >>
> >> I can't reproduce the problem on your 2D image. Can you send me the
> >> full 3D image, so I can try to reproduce the problem?
> >> Note that there was a bug in erode/dilate filters in ITK 3.2, which
> >> shouldn't change the result, only the execution time, but it may be
> >> safer to update to ITK 3.4.
> >>
> >> Regards,
> >>
> >> Gaëtan
> >>
> >>
> >> Le 23 nov. 07 à 14:15, mauro maiorca a écrit :
> >>
> >>
> >>> Hi people,
> >>> I'm trying to perform erosion with itk, but unfortunately without
> >>> any
> >>> luck. The strange thing is that there isn't any problem with
> >>> dilation.
> >>> starting from a volume (here a slice from the volume, the inside has
> >>> value 0, and the structure I'm interested in has value 255)
> >>> http://traversata.altervista.org/facial_segmented_28_starting.jpg
> >>> (or, if you like more png:
> >>> http://traversata.altervista.org/facial_segmented_28_starting.png )
> >>> unfortunately the result that I obtain is:
> >>> http://traversata.altervista.org/facial_segmented028.jpg
> >>> with mainly the colour reversed, and some changes far from the
> >>> center
> >>> of the image. I'm using itk 3.2.0
> >>>
> >>> Any help/suggestion would be appreciated!
> >>> cheers,
> >>> Mauro
> >>>
> >>> The portion of code interested is:
> >>>
> >>> typedef itk::Image<PixelType, 3>  outputImageType;
> >>> typedef itk::BinaryBallStructuringElement< PixelType, 3 >
> >>> StructuringElementType;
> >>> typedef itk::BinaryErodeImageFilter< outputImageType,
> >>> outputImageType,
> >>> StructuringElementType >  ErodeFilterType;
> >>> ErodeFilterType::Pointer  binaryErode  = ErodeFilterType::New();
> >>>
> >>>       StructuringElementType ball;
> >>>       StructuringElementType::SizeType ballSize;
> >>>       ballSize[0] = 6;
> >>>       ballSize[1] = 6;
> >>>       ballSize[2] = 1; //I also tried with other combinations of
> >>> ballSize,
> >>> but with the same results
> >>>       ball.SetRadius(ballSize);
> >>>       ball.CreateStructuringElement();
> >>>
> >>> binaryErode->SetInput( confidence->GetOutput() );
> >>> /*confidence->GetOutput() is the image
> >>> http://traversata.altervista.org/facial_segmented_28_starting.jpg*/
> >>>
> >>> binaryErode->SetKernel(  ball );
> >>> binaryErode->SetErodeValue( 255 );
> >>> binaryErode->Update();
> >>>
> >>> facial_SegmentedPtr = binaryErode->GetOutput();
> >>> /*binaryErode->GetOutput() is the image
> >>> http://traversata.altervista.org/facial_segmented028.jpg*/
> >>> _______________________________________________
> >>> Insight-users mailing list
> >>> Insight-users at itk.org
> >>> http://www.itk.org/mailman/listinfo/insight-users
> >>
> >> --
> >> Gaëtan Lehmann
> >> Biologie du Développement et de la Reproduction
> >> INRA de Jouy-en-Josas (France)
> >> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> >> http://voxel.jouy.inra.fr
> >>
> >>
> >>
> >>
> >>
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
>
>
>
>
>
>


More information about the Insight-users mailing list