[Insight-users] windows-linux
Luis Ibanez
luis.ibanez at kitware.com
Wed, 21 Apr 2004 09:54:53 -0400
Hi Maribel,
There is certainly something wrong :-)
The good news is that it is easy to fix.
The error message says:
Description: itk::ERROR:
MutualInformationImageToImageMetric(0x983f028):
"Standard deviation is too small"
So,..
You simply need to increase the
value of the standard deviation.
If you look at the Doxygen documentation of the
MutualInformation metric
http://www.itk.org/Insight/Doxygen/html/classitk_1_1MutualInformationImageToImageMetric.html
You will find the methods:
virtual void SetMovingImageStandardDeviation (double _arg)
virtual double GetMovingImageStandardDeviation () const
virtual void SetFixedImageStandardDeviation (double _arg)
virtual double GetFixedImageStandardDeviation ()
This standard deviation is the one used for smoothing
the sampling of the joint probability distribution.
For a detailed description, please look at the SoftwareGuide:
http://www.itk.org/ItkSoftwareGuide.pdf
Section 8.9.4. "Mutual Information Metric", pdf-page 310.
Lydia Ng, described there the characteristics of the
implementation of this metric in ITK.
Regards,
Luis
---------------------------
Adame, I.M. (LKEB) wrote:
> Hi,
> I run the following test in linux and I get these messages in which it seems
> to be some errors related to MutualInformationImageToImageMetric. I'm using
> this metric for my registration procedure and I get some strange results so,
> I was wondering whether the test is ok or whether there is something wrong.
>
>
> 64. itkMultiResolutionImageRegistrationMethodTest_2
> --- Starting level 0
> No. Iterations: 300 Learning rate: 0.001
> --- Starting level 1
> No. Iterations: 300 Learning rate: 0.0005
> --- Starting level 2
> No. Iterations: 350 Learning rate: 0.0001
> Solution is: [-0.00341335, -0.00313898, 0.0875245, 0.996152, -6.22288,
> -4.15786, -1.97599]
> True solution is: [0, 0, 0.0871557, 0.996195, -6.37271, -4.16996, -2]
> --- Starting level 0
> No. Iterations: 300 Learning rate: 0.001
> Caught expected ExceptionObject
>
> itk::ExceptionObject (0x984bfa0)
> Location: "Unknown"
> File:
> /export/user/madame/InsightToolkit-1.6.0/Code/Algorithms/itkMutualInformatio
> nImageToImageMetric.txx
> Line: 378
> Description: itk::ERROR: MutualInformationImageToImageMetric(0x983f028):
> Standard deviation is too small
>
>
> --- Starting level 0
> No. Iterations: 300 Learning rate: 0.001
> Caught expected ExceptionObject
>
> itk::ExceptionObject (0x9846a80)
> Location: "Unknown"
> File:
> /export/user/madame/InsightToolkit-1.6.0/Code/Algorithms/itkMutualInformatio
> nImageToImageMetric.txx
> Line: 155
> Description: itk::ERROR: MutualInformationImageToImageMetric(0x983f028): All
> the sampled point mapped to outside of the moving image
>
>
> Test passed.
>
>
>
> Thanks,
>
> Maribel
>
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Tuesday, April 20, 2004 8:06 PM
> To: Adame, I.M. (LKEB)
> Cc: 'insight-users at itk.org'
> Subject: Re: [Insight-users] windows-linux
>
>
>
>
> Hi Maribel,
>
> This is a known behavior.
>
> It is not good, but it is normal :-)
>
> The reason is that MutualInformation uses a random iterator
> in order to sample pixel values. The random number generator
> used by this iterators turns out to be different in Unix and
> Windows systems. This makes impossible for the algorithm to
> behave in the same way on both Windows and Unix systems.
>
> That being said, the result shouldn't be completely different.
> You should only observe a different path in the parametric space,
> and probably small differences in the final registration value.
>
> If you are obtaining totally different results, that probably
> indicates that other settings in the registration methods are
> in critical conditions. The usual suspects are the step length
> of the RegularStepGradientDescent optimizer, the learning rate
> of the GradientDescentOptimizer, the translation scaling parameters,
> and the noise of the image itself.
>
> The experimental way to find if you are using parameters close
> to a critical range, is to tweak their values and see how much
> this affects the results of the registration.
>
> You could also preprocess the images with EdgePreserving filters
> as described in the SoftwareGuide.
>
>
> If you feel adventurous and motivated you could also plug in
> your own random number generator in the RandomImageIterator
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageRandomIteratorWithI
> ndex.html
> in order to make sure that it will behave in the same way in
> any system. Note also that there is a seen initialization
> involved...
>
> Since the current random number generator used in this iterator is
> taken from VXL/VNL, there have been some talk among ITK developers
> for getting a portable random number generator into VXL. This will
> be the real long term solution,... but it may not happen for a while.
>
>
>
> Regards,
>
>
> Luis
>
>
> ----------------------------
> Adame, I.M. (LKEB) wrote:
>
>
>>Hi everybody,
>>
>>I am trying to run a registration procedure based on mutual information(it
>>is the one provided as an example, with a few modifications). I need to
>
> have
>
>>it in both environments: windows and linux. My problem is that I obtain
>>completely different results from each of them for the same images.
>>I think that it may have something to do with internal settings, but I
>
> don't
>
>>know which. Does anyone have any idea about what my problem can be?
>>Thank you very much.
>>
>>Maribel Adame
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>