Skip to content

Commit

Permalink
BUG: Fix AP axis flipping for case LeftAnteriorSuperior in NRRDImageIO
Browse files Browse the repository at this point in the history
The old code was flipping left/right axis instead of anterior/posterior.
The bug was introduced with the original feature on November 22, 2005:
15372e8
  • Loading branch information
dzenanz authored and hjmjohnson committed Feb 7, 2025
1 parent ce2df7d commit a0bf41e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/IO/NRRD/src/itkNrrdImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ NrrdImageIO::ReadImageInformation()
iFlipFactors[1] = -1;
break;
case nrrdSpaceLeftAnteriorSuperior:
spaceDir[0] *= -1; // R -> L
iFlipFactors[0] = -1;
spaceDir[1] *= -1; // A -> P
iFlipFactors[1] = -1;
break;
case nrrdSpaceLeftPosteriorSuperior:
// no change needed
Expand Down Expand Up @@ -537,7 +537,7 @@ NrrdImageIO::ReadImageInformation()
spaceOrigin[1] *= -1; // A -> P
break;
case nrrdSpaceLeftAnteriorSuperior:
spaceOrigin[0] *= -1; // R -> L
spaceOrigin[1] *= -1; // A -> P
break;
case nrrdSpaceLeftPosteriorSuperior:
// no change needed
Expand Down

0 comments on commit a0bf41e

Please sign in to comment.