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

Luis Ibanez luis.ibanez at kitware.com
Mon, 26 Apr 2004 12:55:47 -0400


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)
> ...........