Skip to content

Commit

Permalink
Merge pull request #1050 from frheault/keep_space_in_flip
Browse files Browse the repository at this point in the history
Keep old space
  • Loading branch information
arnaudbore authored Nov 13, 2024
2 parents 307280b + 7199a15 commit 2c36451
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scilpy/tractograms/tractogram_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ def flip_sft(sft, flip_axes):
-------
flipped_sft: StatefulTractogram
"""
old_space = sft.space
old_origin = sft.origin
sft.to_vox()
sft.to_corner()
if len(flip_axes) == 0:
# Could return sft. But creating new SFT (or deep copy).
flipped_streamlines = sft.streamlines
Expand All @@ -174,6 +178,11 @@ def flip_sft(sft, flip_axes):
data_per_point=sft.data_per_point,
data_per_streamline=sft.data_per_streamline)

sft.to_space(old_space)
sft.to_origin(old_origin)
new_sft.to_space(old_space)
new_sft.to_origin(old_origin)

return new_sft


Expand Down

0 comments on commit 2c36451

Please sign in to comment.