Skip to content

Commit

Permalink
[FIX] Fix DXSUM_PDXCONV_ADNIALL unknown clinical file for adni-to-b…
Browse files Browse the repository at this point in the history
…ids converter (#1144)
  • Loading branch information
NicolasGensollen authored Apr 23, 2024
1 parent eaf6531 commit e710a95
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions clinica/iotools/converters/adni_to_bids/adni_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,16 @@ def correct_diagnosis_sc_adni3(clinical_data_dir, participants_df):
from clinica.utils.stream import cprint

diagnosis_dict = {1: "CN", 2: "MCI", 3: "AD"}
dxsum_df = load_clinical_csv(clinical_data_dir, "DXSUM_PDXCONV_ADNIALL").set_index(
["PTID", "VISCODE2"]
)
# DXSUM_PDXCONV_ADNIALL has been renamed to DXSUM_PDXCONV
# this ensures old ADNI downloads still work with recent versions of Clinica
try:
dxsum_df = load_clinical_csv(
clinical_data_dir, "DXSUM_PDXCONV_ADNIALL"
).set_index(["PTID", "VISCODE2"])
except OSError:
dxsum_df = load_clinical_csv(clinical_data_dir, "DXSUM_PDXCONV").set_index(
["PTID", "VISCODE2"]
)
missing_sc = participants_df[participants_df.original_study == "ADNI3"]
participants_df.set_index("alternative_id_1", drop=True, inplace=True)
for alternative_id in missing_sc.alternative_id_1.values:
Expand Down Expand Up @@ -860,6 +867,7 @@ def _is_a_visit_code_2_type(csv_filename: str) -> bool:
"""If the csv file is among these files, then the visit code column is 'VISCODE2'."""
return csv_filename in {
"ADAS_ADNIGO2.csv",
"DXSUM_PDXCONV.csv",
"DXSUM_PDXCONV_ADNIALL.csv",
"CDR.csv",
"NEUROBAT.csv",
Expand Down

0 comments on commit e710a95

Please sign in to comment.