[Insight-users] bug in MattesMutualInformationImageToImageMetric
Marius Staring
marius at isi.uu.nl
Fri Oct 27 12:22:51 EDT 2006
Hi all,
I want to report a bug in the MattesMutualInformationImageToImageMetric.
The bug is when using all the pixels in the fixed image and when a mask
is used.
In Initialize() memory is allocated for the fixed sample container, of
the size of the fixed image region. Later, in the
SampleFullFixedImageDomain() function the container is filled, but of
coarse, since the number of samples within the mask is usually less than
that of the full fixed image, the fixed sample container is not
completely filled. This results in an access violation when calling
GetValue[AndDerivative]().
- In the SampleFullFixedImageDomain() a counter should be used, to count
the actual number of pixels.
- The container should be resized accordingly
- the m_NumberOfSpatialSamples should be updated
- the while loop should also stop at the end of the regioniter, so
while( iter != end )
should be something like
while( iter != end && !regioniter.IsAtEnd() )
- Also the comments should be updated, since no random iterator is used
Hope this helps, cheers
Marius
--
Marius Staring
Image Sciences Institute
University Medical Centre Utrecht
Heidelberglaan 100, 3584 CX Utrecht, The Netherlands
phone: +31 (0)30 250 3186, fax: +31 (0)30 251 3399
marius at isi.uu.nl, http://www.isi.uu.nl/People/Marius
More information about the Insight-users
mailing list