[Insight-users] Inverted output from encapsulated OtsuThresholsFilter

Martin Kavec kavec at messi.uku.fi
Fri Jun 16 06:35:14 EDT 2006


Hi

I am writing a sub-class of ImageToImageFilter to perform several processing 
steps in a mini-pipeline. OtsuThresholdImageFilter is a part of it so I have 
it encapsulated in the GenerateData() method (for the moment). The filter 
works in principle, but the output of Otsu filter is inverted eventhough I 
SetInsideValue(1) and SetOusideValue(0). If I pass the same image through 
Examples/Filtering/OtsuThresholdImageFilter.cxx, the result is OK. The input 
image is a 3D T1-weighted MRI volume with good SNR.

I stripped down everything planned from the filter and left only the 
OtsuThresholdFilter in it, but the output image is still inverted: noise = 1 
and object = 0. I am using ITK-2.6.0 and the result is the same on both the 
gentoo linux and Mac OS 10.4.6 Intel.

I placed the sourcecodes on a web for those interested:

http://www.uku.fi/~kavec/mriRegionOfInterestGenerator.h
http://www.uku.fi/~kavec/mriRegionOfInterestGenerator.txx
http://www.uku.fi/~kavec/mriRegionOfInterestGeneratorTest.cxx

I can not find a source of the problem and would appreciate any help. Thanks,

Martin


More information about the Insight-users mailing list