[Insight-users] IsoContourDistanceImageFilter

Luis Ibanez luis.ibanez at kitware.com
Wed Jul 11 12:51:43 EDT 2007


Hi Kishore,

This filter only throws exceptions when the pixel type of
the image does not have enough precision for representing
the gradients.


See lines:

330: itkExceptionMacro(<<"Gradient norm is lower than pixel precision");
530: itkExceptionMacro(<<"Gradient norm is lower than pixel precision");

of the file:

/Insight/Code/Algorithms/itkIsoContourDistanceImageFilter.txx


-----

You may want to instantiate the filter over an
image of pixel type = float,

and use an CastImageFilter in order to convert
your mask in to an image of pixel type float.


     Regards,


        Luis


=----------------------------
Kishore Mosaliganti wrote:
> Hi,
> I am getting the following bug while trying to use the
> IsoContourDistanceImageFilter.
> 
> itk::ExceptionObject (0xad98c0)
> Location: "void itk::MultiThreader::SingleMethodExecute()"
> File: /tmp/InsightToolkit-3.2.0/Code/Common/itkMultiThreader.cxx
> Line: 368
> Description: itk::ERROR: MultiThreader(0xad1100): Exception occurred
> during SingleMethodExecute
> 
> 
> Basically, I am using a binary image having 0 to 255 values to
> initialize the filter. Since the image is slightly large
> (1000x1000x50), I am trying to use a IsoContourDistanceImageFilter
> followed by the FastChamferDistanceImageFilter in place of the
> DanielsonDistanceMapFilter. I am placing my code below for you
> perusal. Any help will be appreciated.
> 
> ------------------------------------------------------------------------------------------------------------------------ 
> 
> 
> typedef 
> itk::IsoContourDistanceImageFilter<InternalImageType,InternalImageType>
> IsoContourFilterType;
> typedef 
> itk::FastChamferDistanceImageFilter<InternalImageType,InternalImageType>
> ChamferFilterType;
> 
>     tIsoContourFilterType::Pointer isoContour = 
> IsoContourFilterType::New();
>     isoContour->SetInput(mask);
>     isoContour->SetLevelSetValue(128);
>     isoContour->SetFarValue(5);
>     isoContour->SetNumberOfThreads(1);
>     isoContour->NarrowBandingOff();
>     try {
>         isoContour->Update();
>    }
>       catch( itk::ExceptionObject & err ){
>      std::cout << "ExceptionObject caught !" << std::endl;
>      std::cout << err << std::endl;
>       return mask;
>    }
> 
>     ChamferFilterType::Pointer chamferDist = ChamferFilterType::New();
>     chamferDist->SetInput(isoContour->GetOutput());
>     chamferDist->SetMaximumDistance(255);
>     chamferDist->Update();
> 
>     InternalImageType::Pointer dist = isoContour->GetOutput();
> 
> 
> -------------------------------------------------------------------------------------------------------------------------- 
> 
> 
> Kishore
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list