[Insight-users] ApproximateSignedDistanceMapImageFilter

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 8 15:13:53 EDT 2010


Hi Juan,

You can create such ramp with the

http://public.kitware.com/Insight/Doxygen/html/classitk_1_1ReinitializeLevelSetImageFilter.html


   Regards,


        Luis


----------------------------------------------
On Thu, Apr 8, 2010 at 2:36 PM, Juan Carlos Prieto
<juanprietob at gmail.com> wrote:
> Hi Luis
>
> Yes I did as you told me and I got in my console
>
> norm = 0
> norm = 0
>
> And my input image is a binary image that has values 0 and 255, if the
> filter expects a ramp of intensity
> how can I get this??.
>
> Thank you very much
>
> Juan
>
> 2010/4/8 Luis Ibanez <luis.ibanez at kitware.com>
>>
>> Hi Juan Carlos,
>>
>> Thanks for pointing this out.
>>
>> The exception is originated from
>>
>> Insight/Code/Algorithms/
>>    itkIsoContourDistanceImageFilter.txx
>>
>> lines 319-341:
>>
>>
>>        norm = vcl_sqrt((float)norm);
>>
>>        if (norm > NumericTraits<PixelType>::min())
>>          {
>>          ....
>>          }
>>        else
>>          {
>>          itkExceptionMacro(<<"Gradient norm is lower than pixel
>> precision");
>>          }
>>
>>
>> And the value of NumericTraits<float>::min() is = 1.17549e-38
>>
>> While NumericTraits<unsigned short>::min() is = 0
>>
>> Please try adding:
>>
>>   std::cout << "norm = " << norm << std::endl;
>>
>> to line 338 just before the exception, so that the code looks
>> like
>>
>>
>>  else
>>    {
>>    std::cout << "norm = " << norm << std::endl;
>>    itkExceptionMacro(<<"Gradient norm is lower than pixel precision");
>>    }
>>
>> run it again, and let us know what
>> value of "norm" you find.
>>
>>
>> The exception seems to be there in order to avoid
>> a division by zero in line 323.
>>
>>
>> It will look like this class expects that input image
>> to have a ramp of intensity around the iso-contour
>> value.   Is that the case for your input image ?
>>
>>
>>     Please let us know,
>>
>>
>>          Thanks
>>
>>
>>                 Luis
>>
>>
>> ----------------------------------------------------------
>> On Thu, Apr 8, 2010 at 10:38 AM, Juan Carlos Prieto
>> <juanprietob at gmail.com> wrote:
>> > Hello Luis and ITK Users
>> >
>> > I'm trying to use the ApproximateSignedDistanceMapImageFilter.
>> > As described in the documentation it says the output has to be of type
>> > float, When this is done, i get an exception :
>> >
>> >
>> > /builddir/build/BUILD/InsightToolkit-3.16.0/Code/Common/itkMultiThreader.cxx:475:
>> >
>> > itk::ERROR: MultiThreader(0x9a3d050):
>> >
>> > Exception occurred during SingleMethodExecute
>> >
>> >
>> > /usr/include/InsightToolkit/Algorithms/itkIsoContourDistanceImageFilter.txx:339:
>> >
>> > itk::ERROR: IsoContourDistanceImageFilter(0x9a97d28): Gradient norm is
>> > lower
>> > than pixel precision
>> >
>> > On the other hand I tried with the same type of my input image (UShort)
>> > and
>> > it worked but the output image is not as expected.
>> >
>> >
>> >
>> > Please need some help
>> >
>> > Juan Carlos Prieto
>> >
>> >
>> >
>> > _____________________________________
>> > 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.html
>> >
>> > 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://www.itk.org/mailman/listinfo/insight-users
>> >
>> >
>
>


More information about the Insight-users mailing list