Skip to content

[BUG] ADNI-to-BIDS : Empty and undefined columns in sessions specifications added to *_sessions.tsv #1623

@Adam-Ismaili-92

Description

@Adam-Ismaili-92

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:

  1. Use the ADNI-to-BIDS converter
  2. Convert a single subject for which no rows match in some clinical data, such as 003_S_6432 in clinica_data_ci
  3. Open the produced *_sessions.tsv in the BIDS folder
  4. Observe the invalid columns present in *_sessions.tsv, such as ADAS_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 :
Image

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.

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions