[Insight-users] RE: VersorRigid3DTransform

Luis Ibanez luis.ibanez at kitware.com
Thu, 08 Jan 2004 17:33:04 -0500


Hi Radhika,

Checking if the input images
are valid is always useful !  :-)

The only reason for the metric
to go up is when the parametric
space has a small valley and the
current step length is larger
thant the valley width. The typical
solution is to use a smaller step
size.

Note that it can also be due to
inapropriate parameterScales values.
In that case you should compare how
much the optimizer is advancing in
translation with respect to how much
it is advancing in rotation specially
on the iterations where the metric
goes up.

Keep in mind that you are walking
over a function in 6 dimensions
and the variety of configurations
is much larger than what we are used
in 2D where we only know the trivial
hill, valley and saddle points.

The number of parameters in the
optimizer and the transform now
match. Both of them are using 6
parameters. 3 for the Versor that
represents the rotation and 3 for
the Vector that represents the
translation.

The center of rotation does not
make part of the transform paramters.
You simply set its value at the
begining of the registration process
and it remains constant during the
whole process.

---

Did you verified origin and spacing ?

If endianess was wrong you may as well
suspect of origin and spacing.

---


Regards,


     Luis


------------------------------
Radhika Sivaramakrishna wrote:

> Hi Luis,
> 
> Just a quick update: I figured out part of the problem:
> It had something to do with Endianness, I am assuming since although the 
> old image had values which appeared much larger than the new although on 
> my display program (ImageJ), they appeared the same. So I basically 
> created a new version of my fixed image using an identity transform and 
> now I am getting much more reasonable values for the metric [
> 
> However, I am still playing around with SetMaximumStepLength because 
> even with a value of 0.1, the metric starts getting lowered upto a point 
> and then starts increasing. Would you say that this is a problem with 
> SetMaximumStepLength or could it be something else?
> 
> I also had another doubt regarding the optimizer and the example. Since 
> the optimizer uses only 6 parameters, however the transform uses 9 
> parameters, in the example ImageRegistration8.cxx, after the 
> registration is completed, where are we setting the 3 parameters 
> corresponding to the center of rotation?
> 
> We basically do:
> 
> OptimizerType::ParametersType finalParameters =
>                     registration->GetLastTransformParameters();
> 
> transform->SetParameters( finalParameters );
> 
> How does SetParameters for this transform accept a 6 parameter result?
> 
> 
> Thanks
> Radhika
> 
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Thursday, January 08, 2004 11:35 AM
> To: Radhika Sivaramakrishna
> Cc: 'insight-users at itk.org'
> Subject: Re: VersorRigid3DTransform
> 
> 
> 
> Hi Radhika,
> 
> 
> A) This message means that you transform is so far
>     off that the images are not overlapping anymore.
> 
>     This usually happens when you use an optimization
>     step that is too large and make the transform diverge.
> 
> 
> B) If the images are of the same modality and about the
>     same histogram you should be ok using the MeanSquares
>     ImageMetric. However... the metric value shouldn't
>     be that high. It is
> 
> 
> 
> C) You can verify the origin and spacing by printing out
> 
>     std::cout << fixedImage->GetSpacing() << std::endl;
>     std::cout << fixedImage->GetOrigin()  << std::endl;
> 
>     or by printing all the image information with
> 
>     fixedImage->Print( std::cout );
> 
> 
> D) ok, The initialization should be fine.
> 
> 
> E) In MyPACS you have the option of posting "shared" (public)
>     cases as well as "private" cases. The private level is
>     supposed to be as secure as any other PACS system.
> 
> 
> F) You can try the equivalent registration algorithm
>     with the free version of VolView
>     http://www.kitware.com/products/volview.html
>     Just load one image, then go to the View->Filters
>     menu and select
> 
>      "Registration" ---> "Image Registration (ITK)"
> 
>     then in the button "Second input" browse for the
>     second image (the moving image).
> 
> 
> G) Please post the tracing messages that are printed out
>     when the example runs (the sequence that displays the
>     values of the metric and the values of the parameters
>     for each iteration).
> 
> 
> 
> 
> Regards,
> 
> 
>    Luis
> 
> 
> ----------------------------------
> Radhika Sivaramakrishna wrote:
> 
>  > Hi Luis,
>  >
>  > Basically I used your example in ImageRegistration8.cxx as is, so I 
> did use
>  > Optimizerscale.
>  >
>  > To answer your questions in order:
>  >
>  > A) I used the metric MeanSquaresImageToImageMetric (as the example does)
>  > and after about 89 iterations this is the error I got!
>  >
>  >
>  > ExceptionObject caught !
>  >
>  > itk::ExceptionObject (0x82c4738)
>  > Location: "Unknown"
>  > File:
>  > 
> /home/rsivaram/Insight/Code/Algorithms/itkMeanSquaresImageToImageMetric.txx
>  > Line: 103
>  > Description: itk::ERROR: MeanSquaresImageToImageMetric(0x82bc698): All
>  > the points mapped to outside of the moving image
>  >
>  > B) These images are brain MRI T1-weighted images.
>  >
>  > C) How do I verify the origin and spacing? Basically I am trying to test
>  > this currently on a simulated case where I have created one of the
>  > images from the other by a known transformation, so is this still an 
> issue?
>  >
>  > D) Again initialization of the transform is exactly as in
>  > ImageRegistration8.cxx.
>  >
>  > My concern about posting the images is privacy issues since these are
>  > from a hospital and there may be HIPAA issues. How accessible are
>  >
>  > these images to the outside world?
>  >
>  > Thanks
>  > Radhika
>  >
>  >
>  >
> 
> 
>                                                     
> ----------------------------------------------------- 
> 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.
>