1

Could someone explain the output of SimpleITK.GetDirection() and how is related to DICOM standard Image Orientation (Patient) header and NIFTI? Eventually, I would like to get the right Image Orientation (Patient) given a cut e.g. axial, sagittal, coronal.

I am aware of the example, https://simpleitk.readthedocs.io/en/next/Examples/DicomSeriesFromArray/Documentation.html. However, why Image Orientation (Patient) is set the way is set, it's not clear to me.

vpap
  • 1,389
  • 2
  • 21
  • 32

1 Answers1

1

In the Xdrt library that I use they deal with it like this to write a dicom:

direction = sitk_image.GetDirection()
_direction = (direction[0], direction[3], direction[6], direction[1], direction[4], direction[7])
...
image_slice.SetMetaData("0020|0037", "\\".join(map(str, _direction))),  # Image Orientation

You can watch their whole code here https://github.com/NKI-AI/xdrt/blob/ca3e83459dd76521bac597465c815cf6a3da35ad/xdrt/cli/utils.py#L157

May it can help you

leh
  • 53
  • 5