[Insight-users] out of the boundary of the solution in MRIRegistration

Luis Ibanez luis.ibanez at kitware.com
Tue, 27 Apr 2004 10:40:24 -0400


Hi Xujf,

Thanks for the additional details.


You are using a 3D translation Transform.

This transforms has only three parameters.
They are the X,Y and Z components of the translation.

You are trying to squeeze a poor and innocent parameter
vector of size=3, in order to get 6 parameter out of it.

No wonder it is complaining !  :-)


Maybe you intended to use the QuaternionRigidTransform,
or the VersorRigid3DTransform....


Please read the section on Transforms in the SoftwareGuide.

    http://www.itk.org/ItkSoftwareGuide.pdf


Section 8.7, pdf-page 294.

In particular pay attention to the number an type
of parameters used by each transform in ITK.


   Regards


      Luis


------------
xujf wrote:

> Hi,Luis:
>    thanks for your help.
>    these are  part of my code:
>         registration = itk.itkImageRegistrationMethodF3F3_New()
>         imageMetric  =itk.itkMutualInformationImageToImageMetricF3F3_New()
> --->    transform    = itk.itkTranslationTransform3_New()
>         optimizer    = itk.itkRegularStepGradientDescentOptimizer_New()
>         interpolator = itk.itkLinearInterpolateImageFunctionF3D_New()
> 
> if these are what you want to know?
> xujf
> 
> 
> 
> Hi Xujf,
> 
> Your email is lacking some vital information...
> 
>    What type of Transform are you using ?
> 
> 
> Please let us know.
> 
> 
> 
> Thanks
> 
> 
> 
>    Luis
> 
> 
> ------------------
> xujf wrote:
> 
> 
>>Hi,all:
>>    I imitate the example in InsightApplications\\MRIRegistration,and convert it to python.
>>however,one thing makes me puzzled.
>>    my code below is almost the same as the example.In order to get the size of the solution,
>>I write the sentence in line 2. the result of solution.GetSize() is 3. if so ,the sentence in 
>>line 10 ("solution.GetElement(4)") maybe out of the boundary of the solution.(same problem in
>>line15,19).
>>    
>>
>>...........
>>solution = registration.GetLastTransformParameters()
>>print solution.GetSize()                                                         # #####################  line 2
>>            
>>quat=vnl_quaternion(solution.GetElement(0),solution.GetElement(1),solution.GetElement(2),solution.GetElement(3))
>>mat = quat.rotation_matrix_transpose()
>>result=[]
>>result.append(mat[0])
>>result.append(mat[3])
>>result.append(mat[6])
>>result.append(solution.GetElement(4))  ###########line 10
>>
>>result.append(mat[1])
>>result.append(mat[4])
>>result.append(mat[7])
>>result.append(solution.GetElement(5))  ########## line  15
>>result.append(mat[2])
>>result.append(mat[5])
>>result.append(mat[8])
>>result.append(solution.GetElement(6)) ########## line 19
>>result.append(0)
>>result.append(0)
>>result.append(0)
>>result.append(1)
>>........... 
> 
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
>