diff --git a/clinica/iotools/bids_utils.py b/clinica/iotools/bids_utils.py index de47302ad..738882d1b 100644 --- a/clinica/iotools/bids_utils.py +++ b/clinica/iotools/bids_utils.py @@ -242,7 +242,7 @@ def from_original_study_id(cls, study_id: str) -> str: ) def to_original_study_id(self) -> str: - return "OAS1" + self.split("OASIS1")[1] + "MR1" + return f"OAS1_{self.split('OASIS1')[1]}_MR1" class OASIS3BIDSSubjectID(BIDSSubjectID): diff --git a/test/unittests/iotools/test_bids_utils.py b/test/unittests/iotools/test_bids_utils.py index 6fe0ca75d..65ef601ed 100644 --- a/test/unittests/iotools/test_bids_utils.py +++ b/test/unittests/iotools/test_bids_utils.py @@ -102,8 +102,7 @@ def test_study_to_bids_id_value_error(study, study_id): (StudyName.GENFI, "MAPT009", "sub-MAPT009"), (StudyName.OASIS3, "OAS30001", "sub-OAS30001"), (StudyName.HABS, "P_INIBUB", "sub-HABSINIBUB"), - # (StudyName.OASIS, "OAS1_0001_MR1", "sub-OASIS10001"), - # todo : check OASIS + (StudyName.OASIS, "OAS1_0001_MR1", "sub-OASIS10001"), (StudyName.IXI, "IXI001", "sub-IXI001"), ], )