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