Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAR-4140][External] Fixed NifTI import orientation #953

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Conversation

JBWilkie
Copy link
Collaborator

@JBWilkie JBWilkie commented Nov 3, 2024

Problem

Currently, the NifTI importer attempts to apply the LPI orientation to annotations to be imported, since all uploaded NifTI / DICOM files are transformed to LPI. However, the used function (apply_orientation()) flips all 3 axes. Why? The LPI orientation can be represented by [-1, -1, -1], which we feed into the function as the target orientation. However, that function just flips an axis if the corresponding value in the above 3-element array is -1, and doesn't flip if not. This means that for any input orientation not in RAS, at least one axis will be flipped incorrectly

Solution

Simplify the process_nifti function so that:

  • 1: All incoming files are first transformed to RAS, regardless of the state of legacy
  • 2: The target orientation is applied to the file

Changelog

Resolved orientation issue when importing annotations in the NifTI format

@JBWilkie JBWilkie merged commit 1d6eb59 into master Nov 8, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants