Hi I would like to convert image to binary image.<br>I have mha/mhd image in 3D in grayscale. <br>So I ask you, how should I convert my image to binary image?<br>I tried to use binary threshold image filter. But when I use it, I dont get black&white image, black&dark gray&white image<br>
I am using this code bellow<br><br><span style="font-family: courier new,monospace;"> typedef itk::BinaryThresholdImageFilter <ImageType, ImageType> BinaryThresholdImageFilterType;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> BinaryThresholdImageFilterType::Pointer thresholdFilter = BinaryThresholdImageFilterType::New();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> thresholdFilter->SetInput(reader->GetOutput());</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> thresholdFilter->SetOutsideValue( 0 );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> thresholdFilter->SetInsideValue( 255 );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> thresholdFilter->SetLowerThreshold( 10 );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> thresholdFilter->SetUpperThreshold( 255 );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> thresholdFilter->Update();</span><br><br>where could be problem? Thanks for ideas :)<br>