[Insight-users] Problem with MultiResImageRegistration2.cxx: Doesn't work with rotation
Luis Ibanez
luis.ibanez at kitware.com
Tue Mar 17 15:32:37 EDT 2009
Hi Albert,
Thanks for your detailed post.
We ran the MultiResImageRegistration2.cxx example on
the two images that your suggested:
* BrainProtonDensitySlice.png
* BrainProtonDensitySliceR10X13Y17.png
This led us to find a bug (Thank you very much!), and a new set
of parameters that are appropriate for these two images.
The changes that we identified are;
cvs diff: Diffing .
Index: MultiResImageRegistration2.cxx
===================================================================
RCS file: /cvsroot/Insight/Insight/Examples/Registration/MultiResImageRegistration2.cxx,v
retrieving revision 1.49
diff -r1.49 MultiResImageRegistration2.cxx
152c152
< optimizer->SetMaximumStepLength( 16.00 );
---
> optimizer->SetMaximumStepLength( 0.10 );
348,349c348,349
< optimizerScales[4] = 1.0 / 1e7; // scale for translation on X
< optimizerScales[5] = 1.0 / 1e7; // scale for translation on Y
---
> optimizerScales[4] = 1.0 / 1e3; // scale for translation on X
> optimizerScales[5] = 1.0 / 1e3; // scale for translation on Y
555a556,557
> finalTransform->SetFixedParameters( transform->GetFixedParameters() );
>
The bug we found is that the finalTransform is a new instance
of an affine transform whose center has not been initialized.
This leads to an incorrect resampling of the output image.
This bug is fixed by the new line:
> finalTransform->SetFixedParameters( transform->GetFixedParameters() );
The executable can be run with the following parameters:
MultiResImageRegistration2
BrainProtonDensitySlice.png BrainProtonDensitySliceR10X13Y17.png
registered.mha 100 checkerBoardBefore.mha
checkerBoardAfter.mha 1 32 3000
Please try the code with these changes
and let us know if you still find any problems.
Thanks
Luis
---------------------------------------------------------------------------------------------
On Mon, Mar 16, 2009 at 6:38 PM, Albert Gubern <bertkrek at gmail.com> wrote:
> Hi,
>
> I'm using MultiResImageRegistration2.cxx in order to correct global pose
> differences of two images. My goal is a registration of prostate MRI of
> differents patients for a atlas building. I am testing this example with
> images from Examples/Data of ITK source: BrainProtonDensitySliceBorder2
> 0.png as a fixed and BrainProtonDensitySliceR10X13Y17.png as a moving.
>
> The registration works if the moving image only has a translation but it
> doesn't work with the images that i'm testing it (translation and rotation).
>
> I have tuned the parameters following the instructions of
> http://www.itk.org/pipermail/insight-users/2007-March/021435.html but it is
> no way to obtain a good result. If I set the translationScales and
> rotationScales with the same value (for example 1), the result image appears
> correctly rotated but in the right corner of the top of the image
> (http://img208.imageshack.us/img208/5148/test1.png). Otherwise, if I set the
> translationScales with smaller values than rotationScales ( 1/1000 and 1
> respectively) the images appears correctly in the center but not enough
> rotated (http://img24.imageshack.us/img24/9317/test2m.png). The maxStep
> length is 0.1, the minstepLength 0.001, 100% of samples and 128 number of
> bins.
>
> I tested with a lot of combinations of parameters with and without sense,
> and I don't understand the behaviour. What is the problem? Is The way how I
> tune the parameters? This framework it isn't right for translation+rotation?
>
> Thanks in advance,
>
> --
> Albert
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list