[Insight-users] imageRegistration8 result, was : ImageRegistration8 takes 2 hours 45 minutes!

Tanya S tanya_lll at yahoo.com
Wed Oct 5 06:11:38 EDT 2005


Thank you very much Xiaodong,
 
Following your suggestion, I have tried to convert the versorRigid3DTransform to vtkTransform. But unfortunately, the registration result is not accurate. Please view the registration result on http://www.geocities.com/tanya_lll/index.html. I hope you can view them. Both images are blended. The MRI image is the fixed image and the PET is the moving one.
 
The registration code is the same with imageRegistration8. I only change the MeanSquareImageToImageMetric to MattesMutualInformationImageToImageMetric.
 
Below is my code in the Command Observer:
   typedef itk::VersorRigid3DTransform< double > TransformType;   
   TransformType::Pointer transform = TransformType::New();
   transform->SetParameters(optimizer->GetCurrentPosition());
   TransformType::MatrixType matrix = transform->GetMatrix();
   TransformType::OutputVectorType translation = transform->GetTranslation();
   
   pMatrix = vtkMatrix4x4::New();
         
   pMatrix->SetElement(0,0, matrix[0][0]);
   pMatrix->SetElement(0,1, matrix[0][1]);
   pMatrix->SetElement(0,2, matrix[0][2]);
   pMatrix->SetElement(1,0, matrix[1][0]);
   pMatrix->SetElement(1,1, matrix[1][1]);
   pMatrix->SetElement(1,2, matrix[1][2]);
   pMatrix->SetElement(2,0, matrix[2][0]);
   pMatrix->SetElement(2,1, matrix[2][1]);
   pMatrix->SetElement(2,2, matrix[2][2]);
  
   pMatrix->SetElement(0,3, translation[0]);
   pMatrix->SetElement(1,3, translation[1]);
   pMatrix->SetElement(2,3, translation[2]);
   pMatrix->SetElement(3,3, 1);//////Matrix[3][3] == 1
   pMatrix->SetElement(3,0, 0);//////Matrix[3][0] == 0
   pMatrix->SetElement(3,1, 0);//////Matrix[3][1] == 0
   pMatrix->SetElement(3,2, 0);//////Matrix[3][2] == 0
   pTransform->SetMatrix(pMatrix);
 
Maybe you have loose my previous emails, below I wrote again the description of the volumes I register:
- MRI image
Dimension:256, 256, 168
Voxel size(mm): 0.86,0.86, 1.5
- PET image
Dimension: 128, 128, 94
Voxel size(mm): 2.0, 2.0, 3.0
 
Thank you very much for your kind attention. I would really appreciate any help.
 
Best regards,
.Tanya.

"Tao, Xiaodong (Research)" <taox at research.ge.com> wrote:
Tanya,
 
You can try the following in your command observer:
 
typedef itk::VersorRigid3DTransform TransformType;
TransformType::Pointer transform = TransformType::New();
transform->SetParameter (optimizer->GetCurrentPosition());
TransformType::MatrixType matrix = transform->GetMatrix();
TransformType::TranslationType translation = transform->GetTranslation();
/* use matrix and translation to form a 4x4 homogeneous transformation matrix 
   vtkmatrix */
pTransform -> SetMatrix ( vtkmatrix );
 
Xiaodong 
-----Original Message-----
From: Tanya S [mailto:tanya_lll at yahoo.com]
Sent: Tuesday, October 04, 2005 7:36 AM
To: Tao, Xiaodong (Research); insight-users at itk.org
Subject: RE: [Insight-users] ImageRegistration8 takes 2 hours 45 menit!


Thank you Xiaodong, Junyi and Luis,
 
I change the metric of imageRegistration8 from MeanSquareImageToImageMetric to MattesMutualInformationImageToImageMetric and it runs no more than 2 minutes! Thank you very much!
 
However, I have other problem :(.
I would like to know how to convert VersorRigid3DTransform to vtkTransform.
I have displayed the Fixed and the Moving Image using VTK. Now, what I want to do is I would send all the versors and translations from VersorRigid3DTransform to vtkTransform from each iteration of the registration process, so that the Moving Image is moved showing the registration process from each iteration.
 
I have one class that inherits itk::Command and has Execute method. Inside this method, I call:
 
pTransform->RotateX(optimizer->GetCurrentPosition()[0])
pTransform->RotateY(optimizer->GetCurrentPosition()[1])
pTransform->RotateZ(optimizer->GetCurrentPosition()[2])
pTransform->Translate(optimizer->GetCurrentPosition()[3],
optimizer->GetCurrentPosition()[4],
optimizer->GetCurrentPosition()[5])
 
pTransform is of type vtkTransform*.
But this code give wrong transformation.
 
I have also tried to set the optimizer->GetCurrentPosition() values to vtkMatrix4x4 and then call :
pTransform->SetMatrix(theMatrix) 
but this gives me also wrong transformation. "theMatrix" is of type vtkMatrix4x4.
 
Any hint would be really appreciated.
 
Best regards,
.Tanya.


Tao, Xiaodong (Research)" <taox at research.ge.com> wrote:
Tanya,
 
ImageRegistration8 uses MeanSquaresImageToImageMetric and VersorRigid3DTransform for registration. This combination may work well for images acquired for the same subject using the same modality, in which case, two images can be aligned using a rigid transform (same subject), and corresponding points in the moving image and  the fixed image have same intensity (same modality). For your application, you are registering a PET image with an MRI image. You may want to try one of the mutual information based image to image metric to get more accurate result, such as 
itkNormalizedMutualInformationHistogramImageToImageMetric or itkMattesMutualInformationImageToImageMetric

There are a few examples showing how to used these metrics.

The MeanSquaresImageToImageMetric is also one of the reasons that the program takes long time to run, since at each iterattion, it transforms and interpolates ALL points in the Fixed image region in order to compute the metric. When you use itkNormalizedMutualInformationHistogramImageToImageMetric or MattesMutualInformationImageToImageMetric, you can always control the running time by setting the number of samples in the fixed image region for metric computation.

If you still want to use ImageRegistration8, you can use the PET image (which has fewer voxels than the MRI image) as the fixed image to cut down the running time.

Xiaodong
-----Original Message-----
From: insight-users-bounces+taox=research.ge.com at itk.org [mailto:insight-users-bounces+taox=research.ge.com at itk.org]On Behalf Of Tanya S
Sent: Thursday, September 29, 2005 11:34 PM
To: Luis Ibanez; insight-users at itk.org
Subject: Re: [Insight-users] ImageRegistration8 takes 2 hours 45 menit!


Hi Luis,
 
I have tried to run imageRegistration8 for Release version and it took 21 minutes :((. My machine spesification and the image size are the same as what I wrote on my last email (email attached). 
 
Thanks beforehand for your answer.
 
Best regards,
.Tanya.



		
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051005/c1cbe411/attachment.html


More information about the Insight-users mailing list