[ITK] [ITK-users] SimpleITK - Resampling Coronal Image in the Axial View
Timothee Evain
tevain at telecom-paristech.fr
Mon Jun 27 05:40:01 EDT 2016
Hello,
First of all, it depends on the patient position in the data, but usually the X axis describe the left/right direction, the Y axis the anterior/posterior direction and the Z axis the top/bottom one.
So I would expect the resampled imageC size to be 256x68x256 rather than 68x256x256.
Then, I think you should try to transform your imageC to be in the imageA orientation. Let say the imageA have a LPS coordinate system.
If the imageC :
-first direction represents the axis going from the patient's right to the patient's left
-second direction represents the axis going from the patient's top to the patient's bottom
-third direction represents the axis going from the patient's front to the patient's rear
Then you should rotate the imageC by a -pi/2 angle around the X axis.
You could use the Euler3DTransform to get this rotation.
Then you feed the resample filter with this transform, plus the needed parameters (origin, spacing, size,...), and you should be able to have your resampled data.
Just be sure to fully understand the transformation you're making (I recommend the ResampleImageFilter part of the ITK guide which is quite useful).
HTH,
Tim
----- Mail original -----
De: "Sara Gh" <sg.ele.eng at gmail.com>
À: insight-users at itk.org
Envoyé: Dimanche 26 Juin 2016 07:57:16
Objet: [ITK] [ITK-users] SimpleITK - Resampling Coronal Image in the Axial View
Hello experts,
I have two MRI scans: Axial and Coronal
# imageA : Axial MRI scan, size : 256x256x56 (256mmx256mmx168mm) , spacing: 1,1,3 ( slice gap : 1 => slice thickness : 2 )
# imageC : Coronal MRI scan, size : 256x256x68 (256mmx256mmx204mm) , spacing: 1,1,3 ( slice gap : 1 => slice thickness : 2 )
I am trying to view Coronal image from the axial view i.e. resampling Coronal image using the direction of Axial image. Here is my code:
resample = sitk.ResampleImageFilter()
resample.SetReferenceImage(imageC)
resample.SetOutputDirection(imageA.GetDirection())
resample.SetOutputOrigin(imageA.GetOrigin())
imageCA = resample.Execute(imageC)
sitk.Show(imageCA)
# Result: imageCA: size : 256x256x68 (256mmx256mmx204mm), spacing: 1,1,3
I believe I have missed something because, in my idea, the size of resampled coronal image (imageCA) should be 68x256x256 ( 204mmx256mmx256mm) with the spacing [3,1,1] .
I also tried to set the OutputSpacing to [3,1,1], but the size of the imageCA changes to 256x256x68 (768mmx256mmx68mm).
I would be thankful if someone could help me in this regard.
Best regards,
Sara Gh
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list