Skip to content

Commit

Permalink
Merge pull request #693 from EmmaRenauld/fix_warning
Browse files Browse the repository at this point in the history
Fixing warning always showing up.
  • Loading branch information
arnaudbore authored Mar 16, 2023
2 parents cdbccac + d020289 commit bb5c4cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scilpy/tracking/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ def _warn_and_save(new_streamlines, sft):
"""Last step of the two resample functions:
Warn that we loose data_per_point, then create resampled SFT."""

if sft.data_per_point is not None:
logging.debug("Initial stateful tractogram contained data_per_point. "
"This information will not be carried in the final"
if sft.data_per_point is not None and sft.data_per_point.keys():
logging.debug("Initial StatefulTractogram contained data_per_point. "
"This information will not be carried in the final "
"tractogram.")
new_sft = StatefulTractogram.from_sft(
new_streamlines, sft, data_per_streamline=sft.data_per_streamline)
Expand Down
4 changes: 2 additions & 2 deletions scilpy/utils/streamlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def compress_sft(sft, tol_error=0.01):
# Compress streamlines
compressed_streamlines = compress_streamlines(sft.streamlines,
tol_error=tol_error)
if sft.data_per_point is not None:
if sft.data_per_point is not None and sft.data_per_point.keys():
logging.warning("Initial StatefulTractogram contained data_per_point. "
"This information will not be carried in the final"
"This information will not be carried in the final "
"tractogram.")

compressed_sft = StatefulTractogram.from_sft(
Expand Down

0 comments on commit bb5c4cb

Please sign in to comment.