[Insight-users] Inconsistent registration result.

lien lee lienlee at gmail.com
Tue Feb 26 14:49:19 EST 2013


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/6b2eb32c/attachment.htm>


More information about the Insight-users mailing list