<br>Hi Luis et al.,<br><br>The binary threshold image and the histograms are reasonable and consistent with my knowledge of the input images. Nevertheless, the optimization metric returns 'nan' and the registration returns a "zero transform" when using a reasonable intensity threshold on the metric.<br>
<br><span style="font-family: courier new,monospace;">$ more testdata/bw_align/section0005to0004_w1_rigid2D.xfm </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#Insight Transform File V1.0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"># Transform 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Transform: Rigid2DTransform_double_2_2</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Parameters: 0 0 0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">FixedParameters: 0 0</span><br style="font-family: courier new,monospace;">
<br><br>I'm at a loss to understand it. The registration works well without using the intensity threshold on the metric. I guess something is awry in the statistics. Perhaps it gets missing values?<br><br>I'm grateful for your assistance. Here is an archive of my program, testdata, and a README.txt file to explain the situation:<br>
<a href="http://ftp.buckinstitute.org/dweber/itkTest.tgz">http://ftp.buckinstitute.org/dweber/itkTest.tgz</a><br><br>Perhaps the alternative is to specify image masks in the registration method?<br><br>TIA,<br>Darren<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>