[Insight-users] Re: thresholding

Luis Ibanez luis.ibanez@kitware.com
Thu, 03 Oct 2002 10:15:22 -0400


Hi Digvijay,

Assuming that you have an image with a bimodal distribution
of gray levels, you may use the OtsuThresholdImageCalculator.

http://www.itk.org/Insight/Doxygen/html/classitk_1_1OtsuThresholdImageCalculator.html

This class will compute a threshold based on the values of image histogram.

The threshold can then be used to feed the BinaryThresholdImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1BinaryThresholdImageFilter.html

Note that this last filter has a Lower and Upper thresholds. You may 
want to put
the lower threshold to zero and the upper to the value resulting from 
the Otsu calculator.

Also, keep in mind that Calculators are not pipeline objects. That is, 
They are not updated
by the pipeline. You have to explicitly call "Compute()" on the 
calculator in order to get
a valid result.

You will have examples on the use of these classes under:

      
Insight/Testing/Code/BasicFilters/itkBinaryThresholdImageFilterTest.cxx
      
Insight/Testing/Code/Algorithms/itkOtsuThresholdImageCalculatorTest.cxx

Please let us know if you have any questions regarding the use of these 
classes.


Thanks

    Luis


============================
digvijay singh wrote:

>hi luis !!
>are there any methods in itk implementing histogram
>based image thresholding ...
>Thanks for the morphological operators info
>digvijay
>
>__________________________________________________
>Do you Yahoo!?
>New DSL Internet Access from SBC & Yahoo!
>http://sbc.yahoo.com
>