[Insight-developers] Fix CentralDifferenceImageFunction non-integer behavior.

M Stauffer (V) mstauff at verizon.net
Fri Nov 25 13:02:27 EST 2011


Hi,

I've made a fix to CentralDifferenceImageFunction to properly handle
non-integer points and indecies.
I'm posting to the group b/c I'm not sure who at would want to review
it.
See http://review.source.kitware.com/#change,3369

I think there might be some discussion as to the new for the addition of
Image::TransformPhysicalPointToLocalPoint  and
Image::m_InvesereDirection. This could
also be handled in CentralDifferenceImageFunction directly if it seems
to much to add it to Image.

Commit msg:

BUG: Fix CentralDifferenceImageFunction non-integer behavior.

The methods Evaluate and EvaluateAtContinuousIndex in
CentralDifferenceImageFunction were rounding the input point
and continuous-index, respectively, to integer index values.
This commit changes that behavior to evaluate them at continuous
points and indecies, respectively.

Image::TransformPhysicalPointToLocalPoint was added to compliment
Image::TransformLocalPointToPhysicalPoint, for use in
CentralDifferenceImageFunction::Evaluate when the flag
m_UseImageDirection
is false.

Image::m_InverseDirection was added, with automatic calculation in
Image::SetDirection, for use in
Image::TransformPhysicalPointToLocalPoint.

The following tests failed initially after this change.
The baseline images for these tests have been updated to reflect
the new output.

ImageRegistration4Test2
ImageRegistration2Test
DeformableRegistration12Test2
DeformableRegistration12Test1
DeformableRegistration12Test4
DeformableRegistration12Test3
DeformableRegistration13Test2
DeformableRegistration13Test1
DeformableRegistration13Test4
DeformableRegistration13Test3

This table below shows that by a cross-correlation measure with the
fixed image, this patch provides slightly better registration
preformance
than before.

CC image similarity of previous baseline and new output with fixed
image:

Baseline	New output	Test
0.397664	0.400048	ImageRegistration4Test2
0.393323	0.394073	ImageRegistration2Test
0.845327	0.848734	DeformableRegistration12Test1
0.845327	0.848227	DeformableRegistration12Test2
0.845327	0.848649	DeformableRegistration12Test3
0.845327	0.848126	DeformableRegistration12Test4
0.845006	0.848648	DeformableRegistration13Test1
0.845006	0.848648	DeformableRegistration13Test2
0.845006	0.848648	DeformableRegistration13Test3
0.845006	0.848648	DeformableRegistration13Test4

Profiling test:

The new method is just slightly slower than the old method, probably
within measurement error.
Mac OSX 10.6, MacBook Pro Core 2 Duo @ 2.4 GHz
Release build.
Example/Registration/ImageRegistration2
200 iterations of GradientDescentOptimizer with
MutualInformationImageToImageMetric.
Profiled via unix 'time' command on complete registration example.
'user' + 'sys' time in seconds, average of 3 runs:
Old: 22.45
New: 22.54



More information about the Insight-developers mailing list