[ITK-users] itk Python: change orientation of CT scan
D'Isidoro Fabio
fisidoro at ethz.ch
Fri Sep 16 17:51:32 EDT 2016
Hallo,
I have a CT scan of a pelvis and I want to re-orient the axes (I need to rotate the physical coordinate system by 90° around the x-axis, with image center as centre of rotation). How could I do it?
1) Flip Image Filter. However, I will need to generate Digitally Reconstructed Radiographs DRR at different orientations of the CT scan. Hence I would be scared to change the direction cosine matrix, because I don't really understand what will happen when the CT scan will be further rotated.
2) A more understable solution would be to use a ResampleImageFilter with transform a CenteredEuler3DTransform. However I get completely lost when I need to assign the origin, the spacing and the size to the output image:
- Ouptput origin: would be a properly roto-translated version of the input origin, right? Describing with M the roto-translation matrix obtained with the CenteredEuler3DTransform, I would do "resample_filter.SetOutputOrigin(M*input_origin)".
- Output spacing: I would need that the input_spacing = (0.7, 0.7, 1.0) would have to become output_ spacing = (0.7, 1.0, 0.7). This would in practice be the clumsy operation "resample_filter.SetOutputSpacing(abs(M*input_ spacing))".
- Output size: same as for the origin "resample_filter.SetOutputSize(abs(M*input_ size))".
- Output Direction: does it have to be changed at all? My understanding is that it has nothing to do with the transform, because it only defines the way pixel indexes are retrieved from the physical coordinates. So I would not change the OutputDirection for the output image.
I have read the section 2.9 of the ITK guide (Geometric Transformations), however in all the examples the origin, spacing and size of the output image were arbitrarily chosen independently from the transform. In my case I need to obtain an output image that is consistent with the input image (for example, the y coordinate of the input origin should become the -z coordinate of the output origin and so on). If I arbitrarily choose the output parameters, the output image will be partially black and parts of the pelvis will be cut out.
Please help,
Thank you.
Fabio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160916/e09aff76/attachment.html>
More information about the Insight-users
mailing list