[Insight-users] Inconsistent registration result.

Seth Gilchrist seth at mech.ubc.ca
Tue Feb 26 15:21:59 EST 2013


Hi Lien,
Unfortunately I have not used masks when performing registrations, so can't
help you with this specific problem.

I took a look at the git blob for the MattesMutual...Metric and was
examining how the decision to keep or reject a give point is handled. If
you are setting a mask on both the fixed and moving images, this will
change what points are used because a check is done to see if a point is in
the fixed mask and if it is in the moving mask after applying the current
transform. Could your moving image mask be too restrictive for the early
stages of the registration?

You can read the code at:
http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/Registration/Common/include/itkMutualInformationImageToImageMetric.hxx;h=1244e5c0be768696cf042f6f39739f4b2bdcbba6;hb=HEAD

Starting on line 108, specifically on line 162.

Cheers,
Seth

*Seth Gilchrist, MASc, PhD Candidate
+---------------------------------------+
Orthopaedic and Injury Biomechanics Group
UBC Department of Mechanical Engineering
6th Floor-2635 Laurel Street
Vancouver, BC V5Z-1M9
+---------------------------------------+
seth at mech.ubc.ca
Fax 604-675-2576*


On Tue, Feb 26, 2013 at 11:49 AM, lien lee <lienlee at gmail.com> wrote:

>  Hi Seth,
>
>  Thank you for the comment.
>
>  I double-checked my code, and found that before calling
> MattesMutualInformationImageToImageMetric::Initialize(), I called
> MattesMutualInformationImageToImageMetric::ReinitializeSeed(76926294).
> After debugging into the code, I am sure that
> ImageToImageMetric::SampleFixedImageRegion() was called. But, still, it is
> observed that the samples were different for different runs. Do I miss
> anything else?
>
>  With the same code, if I do NOT apply ImageMaskSpatialObject for both
> the fixed and moving images, I do see consistent result.  However, it was
> no good than the better ones I got by chance with ImageMaskSpatialObject
> applied.
>
>
>
> 2013/2/26 Seth Gilchrist <seth at mech.ubc.ca>
>
>>  Hi Lien,
>> You may be seeing the effects of the sampling of the registration region
>> to create the mattes histogram.
>>
>>  If you check the doxygen for the
>> MattesMutualInformationImageToImageMetric and expand the section "public
>> member functions inherited from itk::ImageToImageMetric" you will find a
>> few functions that concern sampling (SetUseAllPixels,
>> SetUseFixedImageIndexes, SetUseSequentialSampling). Importantly, one of
>> these is called ReinitializeSeed(). Take a look at the documentation for
>> that function and it may help answer your question. Briefly:
>>
>>  "By nature, this metric is not deterministic, since at each run it may
>> select a different set of pixels. By initializing the random number
>> generator seed to the same value you can restore determinism."
>>
>>  Hope this helps,
>> Seth
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130226/4b6b6aa1/attachment.htm>


More information about the Insight-users mailing list