[Insight-users] itk::BinaryThresholdImageFilter

Daniela Sacchetto danysunflower at hotmail.it
Thu Aug 26 11:54:22 EDT 2010


Hi everyone,

I'm trying to use itk::BinaryThresholdImageFilter but I have some problems. 
I have a grayscale image and I would like to obtain a new image with all the not zero pixels in white. 

I don't understand how to use ThresholdFilter with one threshold. 

This is my code:

[...]
 typedef itk::BinaryThresholdImageFilter< InternalImageType, InternalImageType > ThresholdFilterType;

  ThresholdFilterType::Pointer threshold = ThresholdFilterType::New();

  threshold->SetInput (relabel->GetOutput());
 threshold->SetInsideValue(itk::NumericTraits<InternalPixelType>::Zero);
 threshold->SetOutsideValue(itk::NumericTraits<InternalPixelType>::One);
  threshold->SetUpperThreshold(0.00);
  threshold->Update();
 
[...]

I obtain an image where pixel are black or gray, not white... Can anyone help me to understand the Threshold Filter? Where is my error?

Thanks a lot
Daniela
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100826/5451b1f8/attachment.htm>


More information about the Insight-users mailing list