-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Describe the bug
When converting an ADNI subset to BIDS using Clinica's ADNI-to-BIDS converter, an error can occur when processing clinical data if no subject IDs match the bids_ids list in the function _filter_subj_bids from clinica/converters/adni-to-bids/_utils.py.
In this case, an empty dataframe is returned with its columns not properly filtered against the sessions specifications in the function _create_adni_sessions_dict from clinica/converters/adni-to-bids/_utils.py, which can lead to unexpected and invalid columns being added to the final sessions dataframe.
To Reproduce
Steps to reproduce the behavior:
- Use the ADNI-to-BIDS converter
- Convert a single subject for which no rows match in some clinical data, such as
003_S_6432inclinica_data_ci - Open the produced
*_sessions.tsvin the BIDS folder - Observe the invalid columns present in
*_sessions.tsv, such asADAS_QuestionnaireNotAttempted,ADAS_Q1_T1_WL1_W1_butter, ...
Expected behavior
The resulting empty dataframe df_filtered, the final sessions dataframe df_subj_session, and the produced *_sessions.tsv file, should only keep columns defined in the sessions.tsv specifications.
Screenshots
This kind of data should be found in the produced *_sessions.tsv file :

Desktop :
- OS: MacOS Sequoia 15.7.1
- Clinica Version: 0.10.1
Additional context
A temporary and quick fix would be to filter df_filtered columns to keep only those defined in the sessions.tsv specifications before merging them into df_subj_session.