[Insight-users] Re: VersorRigid3DTransform
Luis Ibanez
luis.ibanez at kitware.com
Thu, 08 Jan 2004 13:13:09 -0500
Hi Radhika,
It looks like you didn't set up the parameterScale array.
Please look at the example
Insight/Examples/Registration/ImageRegistration8.cxx
You will find code like the following
typedef OptimizerType::ScalesType OptimizerScalesType;
OptimizerScalesType optimizerScales(
transform->GetNumberOfParameters() );
const double translationScale = 1.0 / 1000.0;
optimizerScales[0] = 1.0;
optimizerScales[1] = 1.0;
optimizerScales[2] = 1.0;
optimizerScales[3] = translationScale;
optimizerScales[4] = translationScale;
optimizerScales[5] = translationScale;
optimizer->SetScales( optimizerScales );
If you don't scale the translations, they will be moving
at very small steps and the optimization will take forever.
The metric value of e+9 looks pathologically large !!
A) What image metric are you using ?
B) What is the modality of the images you are registering ?
C) Did you verified that the origin and spacing of the
images is correctly defined ? (registration is performed
in physical coordinates, not pixel coordinates).
D) How did you initialized the transform ?
Maybe it will be simpler to post your code....
You can also post your images in MyPACS if you
want us to try running a registration on them.
http://www.mypacs.net
Simply open an account (for free) and let us know of
the ID given to your images.
Regards
Luis
-----------------------------
Radhika Sivaramakrishna wrote:
> Hi Luis,
> Thanks for your explanation. I was trying to run use the new optimizer
> for registering my two 3D images where one has been created from the
> other using a 10 degree rotation about the slice direction (so each
> slice is rotated by 10 degrees). I used the following values for the
> parameters of the optimization:
>
> I used the preset values in the ImageRegistration8.cxx example:
> Maximum Step Length = 1.0
> Minimum Step Length = 0.001
> Number of Iterations = 200
>
> Even after 200 iterations, the metric value had not budged and was very
> high (e+9) and basically, the final result was a blank image with all
> voxels set to the default value. However, in the intermediate steps, the
> translation values were steadily moving along almost monotonically. So I
> don't understand how the metric value is practically the same, but some
> movement in the parameter is taking place.
>
> Then I decided to change the Step length etc so I set the following values:
> Maximum Step Length = 3.0
> Minimum Step Length = 0.01
> Number of Iterations = 200
>
> Now, I find even after 24 iterations, the metric value is still more or
> less the same high value as previously and has hardly changed at all, in
> fact it is not following any trend, it decreased marginally, increased
> marginally, so it appears stuck, meanwhile the translation parameters
> are steadily changing monotically (almost change of 2 for each
> translation parameter). So I don't understand what is going on. Can you
> help me?
>
> Thanks
> Radhika
>
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Thursday, January 08, 2004 8:26 AM
> To: Radhika Sivaramakrishna
> Cc: 'insight-users at itk.org'
> Subject: Re: VersorRigid3DTransform
>
>
> Hi Radhika,
>
> The Center of rotation was removed because it
> is not really needed for the optimization and
> it costs 50% more on computing time to attempt
> to optimize the center (9 parameters versus
> 6 parameters).
>
> In practice it is enough to get close to the
> real center of rotation in order stabilize the
> optimization. Note that in principle, we could
> have stick to always use the origin of coordinates
> as center of rotation. Mathematically it is enough
> to rotate around the origin and to apply a translation
> in order to get any rigid transformation.
>
> The only reason for introducing an arbitrary center
> of rotation is that it reshapes the cost function in
> such a way that is is easy to perform a gradient
> descent on it.
>
> The Center of rotation is set to the origin by default.
> I *strongly* suggest you to set the Center of rotation
> with the helper class
>
> CenteredTransformInitializer
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1CenteredTransformInitializer.html
>
>
> as is illustrated in the Example file
>
> Insight/Examples/Registration/ImageRegistration8.cxx
>
>
> Regards,
>
>
> Luis
>
>
> ---------------------------------
>
> Radhika Sivaramakrishna wrote:
>
> > Hi Luiz,
> > Thanks for making this code available so fast. I tried to use the new
> > VersorRigid3DTransformOptimizer for my problem. I noticed that it only
> > has 6 parameters. Why was the center of rotation removed?
> >
> > Also, does it assume origin is the center of rotation?
> >
> > Thanks
> > Radhika
> >
> >
> > -----Original Message-----
> > From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> > Sent: Monday, January 05, 2004 1:59 PM
> > To: Radhika Sivaramakrishna
> > Cc: 'insight-users at itk.org'
> > Subject: Re: VersorRigid3DTransform
> >
> >
> > Hi Radhika,
> >
> >
> > Bug #475 has been fixed & closed.
> >
> > The new class
> >
> > itkVersorRigid3DTransformOptimizer
> >
> > is now available under
> >
> > Insight/Code/Numerics
> >
> > Its test is passing and an example
> > on its use was setup under
> >
> > Insight/Examples/Registration/
> > ImageRegistration8.cxx
> >
> >
> > Please let us know if you encounter
> > any problems using this class.
> >
> >
> > Thanks
> >
> >
> > Luis
> >
> >
> > -------------------------------
> > Radhika Sivaramakrishna wrote:
> >
> > > Hi Luis,
> > >
> > > Thanks for your detailed responses on the optimizer for the
> > > VersorRigid3DTransform.
> > >
> > >
> > >
> > > Could you let me know the timeframe when you anticipate this
> optimizer
> > > to be available. Is there a way to check for it on my own for eg.
> on the
> > > dashboard?
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > -----------------------------------------------------
> > Confidentiality Notice.
> > This email message is for the sole use of the intended recipient(s) and
> > may contain confidential and privileged information. Any unauthorized
> > review, use, disclosure or distribution is prohibited. If you are not
> > the intended recipient, please contact the sender by reply email and
> > destroy all copies of the original message. If you are the intended
> > recipient, please be advised that the content of this message is subject
> > to access, review and disclosure by the sender's Email System
> Administrator.
> >
>
>
>
> -----------------------------------------------------
> Confidentiality Notice.
> This email message is for the sole use of the intended recipient(s) and
> may contain confidential and privileged information. Any unauthorized
> review, use, disclosure or distribution is prohibited. If you are not
> the intended recipient, please contact the sender by reply email and
> destroy all copies of the original message. If you are the intended
> recipient, please be advised that the content of this message is subject
> to access, review and disclosure by the sender's Email System Administrator.
>