File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -671,6 +671,15 @@ def reconstruct_fieldmap(
671
671
target .__class__ (target .dataobj , projected_affine , target .header ),
672
672
)
673
673
else :
674
+ # Hack. Sometimes the reference array is rotated relative to the fieldmap
675
+ # and coefficient grids. As far as I know, coefficients are always RAS,
676
+ # but good to check before doing this.
677
+ if (
678
+ nb .aff2axcodes (coefficients [- 1 ].affine )
679
+ == ('R' , 'A' , 'S' )
680
+ != nb .aff2axcodes (fmap_reference .affine )
681
+ ):
682
+ fmap_reference = nb .as_closest_canonical (fmap_reference )
674
683
if not aligned (fmap_reference .affine , coefficients [- 1 ].affine ):
675
684
raise ValueError ('Reference passed is not aligned with spline grids' )
676
685
reference , _ = ensure_positive_cosines (fmap_reference )
You can’t perform that action at this time.
0 commit comments