Skip to content
Discussion options

You must be logged in to vote

If you have the affine transformation matrix (e.g., data["image_meta_dict"]["affine"]), you can get the orientation with this:

affine = np.eye(4)  # or e.g., data["image_meta_dict"]["affine"]
print("".join(nib.aff2axcodes(affine)))

This is the relevant bit of code in our transform: https://github.com/Project-MONAI/MONAI/blob/dev/monai/transforms/spatial/array.py#L531.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YingdiZhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants