[Insight-users] Inverted output from encapsulated
OtsuThresholsFilter
Martin Kavec
kavec at messi.uku.fi
Fri Jun 16 07:04:57 EDT 2006
Thanks a lot,
that explains the thing. ;)
Cheers,
Martin
On Friday 16 June 2006 09:49, Gaetan Lehmann wrote:
> Hi,
>
> ITK's otsu filter gives an inverted output - it has been coded to set high
> values outside and low values inside (don't ask me why)
>
> just do :
>
> const OutputPixelType insideValue = 0;
> const OutputPixelType outsideValue = 1;
> otsuFilter->SetInsideValue( insideValue );
> otsuFilter->SetOutsideValue( outsideValue );
>
> to fix the problem
>
> Gaetan
>
>
> On Fri, 16 Jun 2006 12:35:14 +0200, Martin Kavec <kavec at messi.uku.fi>
>
> wrote:
> > 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
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
--
*********************************
Department of Electrical Engineering and Computer Science
University of Liege
Sart-Tilman, Bldg. B28
Liege B-4000
BELGIUM
Phone: +32 4 366-2870
*********************************
More information about the Insight-users
mailing list