[Insight-users] exclude pixel values (background) from metrics
Darren Weber
darren.weber.lists at gmail.com
Fri Mar 19 17:22:23 EDT 2010
Hi Luis et al.,
There may be a mistake in my code for configuring the metric. It was
missing a call to:
metric->SetFixedImage()
However, after adding this call (with a fixed image input), it makes no
difference (still get 'nan').
Is there an example of how to use an itk::MeanSquaresImageToImageMetric to
set an intensity threshold?
I've searched for an example, but nothing came up, e.g.:
$ itkSearchExamples.bash "SetFixedImageSamplesIntensityThreshold"
---------------------------------------------------------------------
Search term: SetFixedImageSamplesIntensityThreshold
Searching ITK files in: /opt/local/share/InsightToolkit/examples
Searching ITK files in: /opt/local/share/InsightToolkit/testing
TIA,
Darren
On Thu, Mar 18, 2010 at 4:06 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
> Hi Darren,
>
> Yeap, something is wrong with the assumption
> of the image intensities distribution.
>
> You may also want to generate a histogram for
> that image.
>
> The following examples may be useful:
>
> Insight/Examples/Statistics
> ImageHistogram1.cxx
> ImageHistogram2.cxx
> ImageHistogram3.cxx
> ImageHistogram4.cxx
>
>
> Regards,
>
>
> Luis
>
>
> ----------------------------------------------------------------------------
> On Thu, Mar 18, 2010 at 7:02 PM, Darren Weber
> <darren.weber.lists at gmail.com> wrote:
> >
> > Hi Luis et al.,
> >
> > I'm puzzled by the intensityThreshold, because the optimizer observer
> gives:
> >
> > Using fixed image intensity threshold: 1
> >
> > 0 nan [nan, nan, nan]
> > 1 nan [nan, nan, nan]
> > 2 nan [nan, nan, nan]
> > 3 nan [nan, nan, nan]
> > 4 nan [nan, nan, nan]
> > 5 nan [nan, nan, nan]
> > 6 nan [nan, nan, nan]
> > 7 nan [nan, nan, nan]
> > 8 nan [nan, nan, nan]
> > 9 nan [nan, nan, nan]
> > 10 nan [nan, nan, nan]
> > 11 nan [nan, nan, nan]
> > 12 nan [nan, nan, nan]
> > 13 nan [nan, nan, nan]
> > 14 nan [nan, nan, nan]
> > 15 nan [nan, nan, nan]
> > 16 nan [nan, nan, nan]
> > 17 nan [nan, nan, nan]
> > 18 nan [nan, nan, nan]
> > 19 nan [nan, nan, nan]
> > 20 nan [nan, nan, nan]
> >
> >
> > I'll try to explore a little more using the
> >
> > BinaryThresholdImageFilter
> >
> > I'll take a look at
> >
> > examples/Filtering/BinaryThresholdImageFilter.cxx
> >
> > Thanks,
> > Darren
> >
> >
> >
> > On Wed, Mar 17, 2010 at 3:44 PM, Luis Ibanez <luis.ibanez at kitware.com>
> > wrote:
> >>
> >> Hi Darren,
> >>
> >> Excellent,
> >>
> >> In that case you should be able to eliminate the background
> >> by using:
> >>
> >> intensityThreshold = 1;
> >> metric->SetFixedImageSamplesIntensityThreshold( intensityThreshold );
> >>
> >> If you want to be 100% sure, it may be worth running a
> >> BinaryThresholdImageFilter first and saving the output
> >> for further visualization. That will provide a good sanity
> >> check.
> >>
> >>
> >> Regards,
> >>
> >>
> >> Luis
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------------------
> >> On Wed, Mar 17, 2010 at 5:22 PM, Darren Weber
> >> <darren.weber.lists at gmail.com> wrote:
> >> >
> >> > Hi Luis et al.,
> >> >
> >> > I've created the input images by exporting from Photoshop with a
> defined
> >> > background value (RGB: 0 0 0). It's these values that I want to
> exclude
> >> > from the metric in the image registration method.
> >> >
> >> > The min color is confirmed by the identify program of ImageMagick:
> >> >
> >> > Colorspace: RGB
> >> > Depth: 16-bit
> >> > Channel depth:
> >> > gray: 16-bit
> >> > Channel statistics:
> >> > Gray:
> >> > min: 0 (0)
> >> > max: 46335 (0.707027)
> >> > mean: 25664.6 (0.391617)
> >> > standard deviation: 15257.7 (0.232818)
> >> > kurtosis: -0.857968
> >> > skewness: -0.771191
> >> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100319/af49bf47/attachment-0001.htm>
More information about the Insight-users
mailing list