Rotation in Slicer - not getting expected result

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Rotation in Slicer - not getting expected result

Devakumar-2

Dear Slicer-users


I have created a cylinder model in Slicer. The default orientation is in AP axis and the center of cylinder is set at 0,0,0. The length of the cylinder is 34.6 cm which is supposed to fit within the diagonal corners after two rotations. The first rotation is along LR axis by 45 degree followed by 45 degree in AP axis. But the resulting transformation does not fit the cylinder in the diagonally opposite corners as expected. I have attached a ppt which shows the pictures. I will be happy if you can help me to solve the problem.


Regards

Devakumar


-------------------------------------------------------------

Devakumar Devadhas Ph.D.

Associate Professor

Department of Nuclear Medicine

Christian Medical College

Vellore-632004

India

Phone: +91-9994206171

--------------------------------------------------------------


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ

rotation-problem-in-slicer.pdf (206K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Rotation in Slicer - not getting expected result

Andras Lasso-2

If you want to align a vector to point towards a cube’s corner then rotation angles should be 45deg and atan(sqrt(2)) = 54.7deg.

 

transformNode=slicer.util.getNode('LinearTransform_3')

import math

t=vtk.vtkTransform()

t.RotateY(45)

t.RotateZ(vtk.vtkMath.DegreesFromRadians(math.atan(math.sqrt(2))))

transformNode.SetAndObserveMatrixTransformToParent(t.GetMatrix())

Andras

 

From: slicer-users [mailto:[hidden email]] On Behalf Of Devakumar
Sent: March 27, 2017 1:53
To: Yarmarkovich, Alexander <[hidden email]>
Cc: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] Rotation in Slicer - not getting expected result

 

Dear Slicer-users

 

I have created a cylinder model in Slicer. The default orientation is in AP axis and the center of cylinder is set at 0,0,0. The length of the cylinder is 34.6 cm which is supposed to fit within the diagonal corners after two rotations. The first rotation is along LR axis by 45 degree followed by 45 degree in AP axis. But the resulting transformation does not fit the cylinder in the diagonally opposite corners as expected. I have attached a ppt which shows the pictures. I will be happy if you can help me to solve the problem.

 

Regards

Devakumar

 

-------------------------------------------------------------

Devakumar Devadhas Ph.D.

Associate Professor

Department of Nuclear Medicine

Christian Medical College

Vellore-632004

India

Phone: +91-9994206171

--------------------------------------------------------------


_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ