From 38752d3dc37bb29ebb74b59f8fbbf437757c22e8 Mon Sep 17 00:00:00 2001 From: Gensollen Date: Fri, 17 Nov 2023 14:45:28 +0100 Subject: [PATCH] [FIX] Fix `_create_merge_file_from_bids` (#1019) Co-authored-by: NicolasGensollen --- clinica/iotools/utils/data_handling.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clinica/iotools/utils/data_handling.py b/clinica/iotools/utils/data_handling.py index 7b5fc7245..0097ae227 100644 --- a/clinica/iotools/utils/data_handling.py +++ b/clinica/iotools/utils/data_handling.py @@ -203,7 +203,10 @@ def _create_merge_file_from_bids( new_col_name = f"{modality}_{col}" scans_dict.update({new_col_name: value}) json_path = ( - bids_dir / subject / session / f"{filename}.json" + bids_dir + / subject + / session + / f"{filepath.split('.')[0]}.json" ) if json_path.exists(): with open(json_path, "r") as f: