[Insight-users] An overlap invariant mutual information metric

Luis Ibanez luis . ibanez at kitware . com
Tue, 25 Nov 2003 16:00:27 -0500


Hi Jessica,

Thanks for your additional details,

Note that for cropping your input images you don't need to
go down to use ImageIterators. You can simply use the
RegionOfInterestImageFilter as explained in the SoftwareGuide

   http://www . itk . org/ItkSoftwareGuide . pdf

Section 7.4, pdf-page 225, paper-page 251.


----

If you already have an observer connected to the optimizer
and the error message is appearing before any iteration is
printed, that points to the initialization of the Transform
as the main suspect.

Can you verify that you are calling SetInitialTransformParamters()
in the registration method class. Also, print out the components
of the array that you pass in this methods, just to double check
that the values are what you expected.

About the spacing and origin, those are pointers to double, you
must have to do

     std::cout << spacing[0] << ", " << spacing[1];
     std::cout << ", " << spacing[2] << std::endl;

instead of plain

     std::cout << spacing << std::endl;


right now it seems that you are simply printing the pointer to
the array of doubles.


About the spacing values:

are you passing 14.88  ?
that is, are you using "microns" as implicit units ?
or are you passing the equivalent millimeters ? like 0.01488  ?

We may have some issues with spacing values that are too far
from 1.0 and this is suspected to be a bug...

Please let us know,


Thanks



   Luis


----------------------
Jessica de Ryk wrote:

> Hi Luis,
> I have the itkCommand already connected to the observer. This is where the
> error message appears, before any iterations have been executed.
> In regards to spacing I am confused. I use the ImageRegionIterator to crop
> my fixed and moving images at when I print out the spacing and origin of the
> loaded image it gives
> spacing = 010512B8
> inputOrigin = 010512C8
> I don't know what these mean?
> physically, the image has 14.884micron pixels, however, when using the
> ResampleImageFilter I have been setting the spacing to 1mm as entering the
> 14.884 microns produces a completely black image. Could this be producing my
> problem?
> Jess
> 
> 
> --- Original Message ----- 
> From: "Luis Ibanez" <luis . ibanez at kitware . com>
> To: "Jessica de Ryk" <jessica-deryk at uiowa . edu>
> Cc: <insight-users at itk . org>
> Sent: Tuesday, November 25, 2003 10:21 AM
> Subject: Re: [Insight-users] An overlap invariant mutual information metric
> 
> 
> 
>>Hi Jessica,
>>
>>This error message indicates that your Transform is
>>so far off that the moving image is mapped quite far
>>from the fixed image. As a result there is no overlap
>>at all between the images and therefore the metric
>>cannot compute the similarity of the matching.
>>
>>Here are some suggestions:
>>
>>1) Very important: create an itk::Command class and
>>    connect it as observer to the optimizer. You will
>>    find multiple examples on the SoftwareGuide on how
>>    to do this.  Having an observer will provide you
>>    feedback on the evolution of the transform as the
>>    optimization process is running.
>>
>>        http://www . itk . org/ItkSoftwareGuide . pdf
>>
>>2) Make sure that origin and spacing on both of your
>>    images are assigned correctly. They don't have to
>>    be the same, just check that the values correspond
>>    to the actual physical range.
>>
>>3) Check how you are initializing the transform.
>>    It may be that from the very beginning your transform
>>    is far off. A simple way to start is to set up the
>>    transform to the identy by using the SetIdentity() method.
>>
>>
>>Please let us know if you have further questions,
>>
>>
>>Thanks
>>
>>
>>
>>   Luis
>>
>>
>>
>>------------------------
>>Jessica de Ryk wrote:
>>
>>
>>>I have still been trying to implement the
> 
> NormalizedMutualInformationMetric.
> 
>>>As it is, my code generates a run time error that states 'all the points
>>>mapped to outside of the moving image'
>>>I am using;
>>>TranslationTransform
>>>RegularStepGradientOptimizer
>>>LinearInterpolateImageFunction
>>>
>>>  unsigned int nBins = 50;
>>>  MetricType::HistogramType::SizeType histSize;
>>>  histSize[0] = nBins;
>>>  histSize[1] = nBins;
>>>  metric->SetHistogramSize(histSize);
>>>
>>>  metric->SetPaddingValue(-1);
>>>  metric->UsePaddingValue();
>>>
>>>I have set optimizer->MaximizeOn();
>>>                optimizer->SetMaximumStepLength(2.0)
>>>                optimizer->SetMinimumStepLength(0.005)
>>>                optimizer->SetNumberOfIterations(200)
>>>
>>>I have set the
>>>Any ideas what could be causing this error?
>>>Thanks
>>>Jess
>>>
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk . org
>>>http://www . itk . org/mailman/listinfo/insight-users
>>>
>>
>>
>>
> 
>