Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Conversion modality could not be found for file sub-ADNI006S4485_ses-M78_task-rest_bolda.nii.gz #396

Closed
m-petersen opened this issue Aug 27, 2021 · 4 comments · Fixed by #399
Labels
bug Something isn't working converter

Comments

@m-petersen
Copy link

Description
What is happening?
I want to bidsify ADNI bulk data with clinica

When applying clinica adni2bids via clinica -v convert adni-to-bids DATASET_DIRECTORY CLINICAL_DATA_DIRECTORY BIDS_ADNI the following error occurs and bidsification stops prematurely.

/work/fatx405/local/clinica/clinica/iotools/converters/adni_to_bids/adni_to_bids.py:76: DtypeWarning: Columns (18,19,20,102,103,104) have mixed types.Specify dtype option on import or set low_memory=False.
  "ADNI", clinic_specs_path, clinical_data_dir, bids_ids
/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/pandas/core/indexing.py:925: PerformanceWarning: indexing past lexsort depth may impact performance.
  return self._getitem_tuple(key)
Traceback (most recent call last):
  File "/work/fatx405/miniconda3/envs/clinicaEnv/bin/clinica", line 33, in <module>
    sys.exit(load_entry_point('clinica', 'console_scripts', 'clinica')())
  File "/work/fatx405/local/clinica/clinica/cmdline.py", line 78, in main
    cli()
  File "/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/work/fatx405/miniconda3/envs/clinicaEnv/lib/python3.7/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/work/fatx405/local/clinica/clinica/iotools/converters/adni_to_bids/adni_to_bids_cli.py", line 70, in cli
    adni_to_bids.convert_clinical_data(clinical_data_directory, bids_directory)
  File "/work/fatx405/local/clinica/clinica/iotools/converters/adni_to_bids/adni_to_bids.py", line 105, in convert_clinical_data
    bids_subjs_paths,
  File "/work/fatx405/local/clinica/clinica/iotools/converters/adni_to_bids/adni_utils.py", line 847, in create_adni_scans_files
    converted_mod = find_conversion_mod(file_name)
  File "/work/fatx405/local/clinica/clinica/iotools/converters/adni_to_bids/adni_utils.py", line 887, in find_conversion_mod
    raise ValueError(f"Conversion modality could not be found for file {file_name}")
ValueError: Conversion modality could not be found for file sub-ADNI006S4485_ses-M78_task-rest_bolda.nii.gz

Glad for any input. Happy to provide further information.

Converters
Which Clinica's converter is concerned ?

  • adni-2-bids

Cheers,
Marvin

@ghisvail
Copy link
Collaborator

The naming of the file sub-ADNI006S4485_ses-M78_task-rest_bolda.nii.gz looks odd, as if conversion happened twice for the same modality. Was your target BIDS folder empty before running clinica?

@ghisvail
Copy link
Collaborator

I was able to reproduce the issue by downloading a collection for subject 006_S_4485 and running the converter on it.

I get a similar error message: ValueError: Conversion modality could not be found for file sub-ADNI006S4485_ses-M66_T1wa.nii

Which means multiple DICOM to NIfTI conversions happen for the same BIDS scan, i.e. anat/T1w in my case, fmri/boldin your case. This should not happen since the QC step is supposed to pick a single conversion per BIDS scan.

@ghisvail ghisvail added bug Something isn't working converter labels Aug 30, 2021
@ghisvail
Copy link
Collaborator

There are two separate issues to consider here:

  1. Under certain circumstances, QC may yield several conversions from DICOM to NIfTI for the same BIDS scan.
  2. DICOM to NIfTI conversion triggers an error if the target BIDS scan is already present, whereas it should either discard or overwrite it.

@m-petersen
Copy link
Author

Issue solved. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working converter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants