Skip to content

Commit

Permalink
Merge pull request #518 from jhlegarreta/AvoidMovingTheOriginalSftWhe…
Browse files Browse the repository at this point in the history
…nCuttingInvalids

ENH: Avoid moving the original sft when cutting invalid streamlines
  • Loading branch information
arnaudbore authored Nov 5, 2021
2 parents 095a82f + 6131be8 commit e03d039
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scilpy/utils/streamlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,11 @@ def cut_invalid_streamlines(sft):
"""
if not len(sft):
return sft, 0

# Keep track of the streamlines' original space/origin
space = sft.space
origin = sft.origin

sft.to_vox()
sft.to_corner()

Expand Down Expand Up @@ -677,6 +682,13 @@ def cut_invalid_streamlines(sft):
data_per_streamline=new_data_per_streamline,
data_per_point=new_data_per_point)

# Move the streamlines back to the original space/origin
sft.to_space(space)
sft.to_origin(origin)

new_sft.to_space(space)
new_sft.to_origin(origin)

return new_sft, cutting_counter


Expand Down

0 comments on commit e03d039

Please sign in to comment.