Skip to content

Conversation

@JBWilkie
Copy link
Contributor

@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

@linear
Copy link

linear bot commented Nov 3, 2024

Co-authored-by: dorfmanrobert <108150810+dorfmanrobert@users.noreply.github.com>
@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.

3 participants