IJK to RAS from file

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

IJK to RAS from file

Dr. András Jakab
Hello Slicers,

Is there a way to get the IJK to RAS matrix out of a given image volume into an ITK style transformation? (preferably in command line and not using the gui, where it is obviously displayed in Volumes).

Thanks a lot!

Andras



_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: IJK to RAS from file

Steve Pieper-2
Hi Andras -

I'll be the first to admit this is pretty awkward and ugly, but the following works and could be massaged into the kind of tool you are looking for.  A better alternative would be to write a short ITK C++ or SimpleITK python program to do the same thing but faster and more robustly.

./Slicer-4.5.0-2016-10-04-linux-amd64/Slicer --python-code "m=vtk.vtkMatrix4x4(); node=slicer.util.loadVolume('/tmp/MRHead.nrrd', returnNode=True)[1]; node.GetIJKToRASMatrix(m); print(m); exit()"

Best,
Steve

On Tue, Oct 11, 2016 at 3:26 AM, Dr. András Jakab <[hidden email]> wrote:
Hello Slicers,

Is there a way to get the IJK to RAS matrix out of a given image volume into an ITK style transformation? (preferably in command line and not using the gui, where it is obviously displayed in Volumes).

Thanks a lot!

Andras



_______________________________________________
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


_______________________________________________
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