Skip to content

Commit

Permalink
[FIX] Fix bad session labels in T1Linear pipeline (#1000)
Browse files Browse the repository at this point in the history
* fix session labels in T1Linear

* Update clinica/pipelines/t1_linear/anat_linear_utils.py

Co-authored-by: Ghislain Vaillant <ghisvail@users.noreply.github.com>

---------

Co-authored-by: Ghislain Vaillant <ghisvail@users.noreply.github.com>
  • Loading branch information
NicolasGensollen and ghisvail committed Oct 19, 2023
1 parent 529f4e4 commit 10ed566
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clinica/pipelines/t1_linear/anat_linear_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ def _get_substitutions_datasink(bids_image_id: str, suffix: str) -> list:
substitutions : List of tuples of str
List of length 3 containing the substitutions to perform.
"""
bids_image_id_without_suffix = bids_image_id.rstrip(f"_{suffix}")
# TODO: Use str.removesuffix once Python 3.8 compatibility is dropped.
if bids_image_id.endswith(f"_{suffix}"):
bids_image_id_without_suffix = bids_image_id[: -(len(suffix) + 1)]
else:
raise ValueError(
f"bids image ID {bids_image_id} should end with provided {suffix}."
)
return [
(
f"{bids_image_id}Warped_cropped.nii.gz",
Expand Down

0 comments on commit 10ed566

Please sign in to comment.