diff --git a/clinica/iotools/converters/oasis_to_bids/oasis_to_bids.py b/clinica/iotools/converters/oasis_to_bids/oasis_to_bids.py index 9f0a1808d..1500b433e 100644 --- a/clinica/iotools/converters/oasis_to_bids/oasis_to_bids.py +++ b/clinica/iotools/converters/oasis_to_bids/oasis_to_bids.py @@ -117,11 +117,6 @@ def _create_sessions_tsv( bids_ids=bids_ids, ) - # todo : when tested add to create_sessions_dict bc specific to oasis1 - for bids_id in bids_ids: - sessions_dict[bids_id]["M000"]["diagnosis"] = ( - "AD" if sessions_dict[bids_id]["M000"]["diagnosis"] > 0 else "CN" - ) write_sessions_tsv(bids_dir, sessions_dict) return sessions_dict diff --git a/clinica/iotools/converters/oasis_to_bids/oasis_to_bids_utils.py b/clinica/iotools/converters/oasis_to_bids/oasis_to_bids_utils.py index c30a5ef37..a7f78950e 100644 --- a/clinica/iotools/converters/oasis_to_bids/oasis_to_bids_utils.py +++ b/clinica/iotools/converters/oasis_to_bids/oasis_to_bids_utils.py @@ -58,6 +58,9 @@ def create_sessions_dict( # managed before result = result.loc[bids_ids] + result["diagnosis"] = result["diagnosis"].apply( + lambda x: "AD" if x > 0 else "CN" + ) result["session_id"] = "ses-M000" for bids_id, row in result.iterrows(): diff --git a/test/unittests/iotools/converters/oasis_to_bids/test_oasis_to_bids_utils.py b/test/unittests/iotools/converters/oasis_to_bids/test_oasis_to_bids_utils.py index d6fd4d7f0..4e716de95 100644 --- a/test/unittests/iotools/converters/oasis_to_bids/test_oasis_to_bids_utils.py +++ b/test/unittests/iotools/converters/oasis_to_bids/test_oasis_to_bids_utils.py @@ -111,7 +111,7 @@ def expected() -> dict: "session_id": "ses-M000", "cdr_global": 0, "MMS": 29, - "diagnosis": 0, + "diagnosis": "CN", }, }, "sub-OASIS10002": { @@ -119,7 +119,7 @@ def expected() -> dict: "session_id": "ses-M000", "cdr_global": 0, "MMS": 29, - "diagnosis": 0, + "diagnosis": "CN", } }, }