[Insight-users] binary erosion
Gaëtan Lehmann
gaetan.lehmann at jouy.inra.fr
Mon Dec 3 08:48:54 EST 2007
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=
Url : http://public.kitware.com/pipermail/insight-users/attachments/20071203/511466a3/PGP.pgp
More information about the Insight-users
mailing list