[ITK-users] BinaryDilateImageFilter has an issue?

Girish Mallya Udupi indianzeppelin at gmail.com
Fri Oct 31 12:56:26 EDT 2014


Hi Hui,

Here's an explanation (someone more knowledgeable can correct me or explain
it in a better way).

See [1]. The dilate (as well as the erode) filter considers as foreground
those pixels which have a "DilateValue". If this value is not set, it
defaults to the maximum possible value of the *PixelType *which in your
case is the maximum value of the *signed int* type.

So, if you know the foreground value of your binary image, you might want
to try setting this "DilateValue", by using
*dilateFilter->SetDilateValue(). *You can also use the
MinimumMaximumImageCalculator
to find the maximum value (see [2]).

As an aside, wouldn't it be better to use *unsigned char* instead of *int *in
this case, since the image is binary?


[1] http://www.itk.org/Doxygen/html/classitk_1_1BinaryDilateImageFilter.html

[2]
http://www.itk.org/Doxygen/html/classitk_1_1MinimumMaximumImageCalculator.html#a39a9bfc33090e47df71d5b9cd6665ccb

On Fri, Oct 31, 2014 at 10:58 AM, tanghui.seu <tanghui.seu at gmail.com> wrote:

> Hi Grish
>
> Thanks a lot for your reply!
> The dilate Filter outputs the same as the input image.
>
> Image3DIntType is itk::image<int, 3>
> I correctly read in a binary image.
>
> Sorry that i can not provide the code now..... it is in my workstation.
> Thanks a lot again!
>
>
> 来自我的华为手机
>
>
> Girish Mallya Udupi <indianzeppelin at gmail.com> wrote:
>
> Hi Hui,
>
> Could you describe what exactly the problem is? Also, couId you also paste
> the earlier part of your code (where Image3DIntType and readerint are
> defined)?
>
>
> On Fri, Oct 31, 2014 at 8:53 AM, Hui Tang <tanghui.seu at gmail.com> wrote:
>
>> Dear all,
>>
>> I can not get dilation or erosion from BinaryDilateImageFilter  or
>> BinaryErodeImageFilter
>>
>> I mostly copied from the example and thought it should work without any
>> problems.
>>
>> Here is my code.
>> Anyone knows what is wrong here? Thanks a lot in advance !
>>
>>
>> unsigned int radius = 7;
>>
>> typedef itk::BinaryBallStructuringElement<int, 3> StructuringElementType;
>>
>> StructuringElementType structuringElement;
>>
>> structuringElement.SetRadius(radius);
>>
>> structuringElement.CreateStructuringElement();
>>
>>
>>
>> typedef itk::BinaryDilateImageFilter <Image3DIntType, Image3DIntType,
>> StructuringElementType> BinaryDilateImageFilterType;
>>
>> BinaryDilateImageFilterType::Pointer dilateFilter =
>> BinaryDilateImageFilterType::New();
>>
>> dilateFilter->SetInput(readerint->GetOutput());
>>
>> dilateFilter->SetKernel(structuringElement);
>>
>> dilateFilter->Update();
>>
>>
>>
>> Best,
>>
>>
>>
>> Hui
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>>
>>
>
>
> --
> Regards,
> Girish
>



-- 
Regards,
Girish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20141031/3e34b1be/attachment-0001.html>


More information about the Insight-users mailing list