aramis-lab / clinica

Software platform for clinical neuroimaging studies
http://www.clinica.run/
Other
227 stars 81 forks source link

GENFI2BIDS fails for downloads that omit DWI modality images #1306

Open MauricePasternak opened 2 months ago

MauricePasternak commented 2 months ago

Describe the bug Some researchers may choose to omit a particular modality of interest, such as DWI. This prevents the pipeline from being able to process the remainder of the dataset into BIDS format.

To Reproduce Steps to reproduce the behavior:

  1. Fresh poetry installation of clinica
  2. Fresh download of GENFI as per clinica docs instructions. Omit DWI modality scans in the download.
  3. Set breakpoints in genfi_to_bids_utils.py for the function _find_duplicate_run
  4. Run clinica convert genfi-to-bids [OPTIONS] DATASET_DIRECTORY BIDS_DIRECTORY

Expected behavior Should not erase all rows from the pandas DataFrame.

The culprit appears to be this line:

df = df[df["suffix"].str.contains("dwi", case=False)]

A re-factoring of core logic (i.e. what if users do not want modality _____ to be present?) may be necessary.

Screenshots image

Desktop (please complete the following information):

NicolasGensollen commented 2 months ago

Hi @MauricePasternak

Thanks for reporting. Indeed, the genfi-to-bids converter performs the conversion of all supported modalities without a way for the user to select a subset of them. Contrarily to other converters, there is no -m option in the command line and the converter hasn't been implemented with this feature in mind initially.

Are you still able to convert all the modalities ? If yes, I think we should flag this issue as "feature request" rather than "bug" since the documentation is clear about downloading all modalities.