Skip to content

Commit

Permalink
fix: warnings in mri filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
clementpoiret committed Mar 29, 2024
1 parent d527f25 commit d6c1e20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hsf/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def filter_mris(mris: List[PosixPath], overwrite: bool) -> List[PosixPath]:
def _get_segmentations(mri: PosixPath) -> List[PosixPath]:
extensions = "".join(mri.suffixes)
stem = mri.name.replace(extensions, "")
segmentations = mri.parent.glob(f"{stem}*_hippocampus_seg.nii.gz")
segmentations = list(mri.parent.glob(f"{stem}*_hippocampus_seg.nii.gz"))

if len(segmentations) > 2:
log.warning(
Expand All @@ -173,7 +173,7 @@ def _get_segmentations(mri: PosixPath) -> List[PosixPath]:
"Skipping segmentation. If you want to overwrite, set overwrite=True."
)

return list(segmentations)
return segmentations

mris = [mri for mri in mris if not mri.name.endswith("_seg.nii.gz")]
if overwrite:
Expand Down

0 comments on commit d6c1e20

Please sign in to comment.