ADNI converter not able to convert T1 images

126 views
Skip to first unread message

Kang Liu

unread,
Dec 2, 2023, 8:48:24 AM12/2/23
to Clinica
Dear Clinica team,
I have been facing conversion problems with ADNI images when using the converter (Clinica Version 0.7.7 and  dcm2niiX (v1.0.20190902)  ).  My command was:
clinica -v convert adni-to-bids DATASET_DIRECTORY CLINICAL_DATA_DIRECTORY ADNI_converted -m T1.

However, I'm still encountering the following error, and I've been struggling with it for days now.
2023-12-01 15:50:42,517:INFO:Creating sessions files...
2023-12-01 15:50:42,866:INFO:Clinical dataframe extracted from ADNIMERGE.csv is empty after filtering.
2023-12-01 15:50:42,979:INFO:Clinical dataframe extracted from CDR.csv is empty after filtering.
2023-12-01 15:50:43,219:INFO:Clinical dataframe extracted from NEUROBAT.csv is empty after filtering.
2023-12-01 15:50:43,273:INFO:Clinical dataframe extracted from ADASSCORES.csv is empty after filtering.
2023-12-01 15:50:43,306:INFO:Clinical dataframe extracted from CCI.csv is empty after filtering.
2023-12-01 15:50:43,399:INFO:Clinical dataframe extracted from ECOGPT.csv is empty after filtering.
2023-12-01 15:50:43,485:INFO:Clinical dataframe extracted from ECOGSP.csv is empty after filtering.
2023-12-01 15:50:43,536:INFO:Clinical dataframe extracted from FCI.csv is empty after filtering.
2023-12-01 15:50:43,621:INFO:Clinical dataframe extracted from GDSCALE.csv is empty after filtering.
2023-12-01 15:50:43,693:INFO:Clinical dataframe extracted from MODHACH.csv is empty after filtering.
2023-12-01 15:50:43,804:INFO:Clinical dataframe extracted from MOCA.csv is empty after filtering.
2023-12-01 15:50:43,969:INFO:Clinical dataframe extracted from NPI.csv is empty after filtering.
2023-12-01 15:50:44,038:INFO:Clinical dataframe extracted from NPIQ.csv is empty after filtering.
2023-12-01 15:50:44,056:INFO:Clinical dataframe extracted from BHR_EVERYDAY_COGNITION.csv is empty after filtering.
2023-12-01 15:50:44,119:INFO:Clinical dataframe extracted from BHR_BASELINE_QUESTIONNAIRE.csv is empty after filtering.
2023-12-01 15:50:44,152:INFO:Clinical dataframe extracted from BHR_LONGITUDINAL_QUESTIONNAIRE.csv is empty after filtering.
2023-12-01 15:50:44,241:INFO:Clinical dataframe extracted from MEDHIST.csv is empty after filtering.
Traceback (most recent call last):
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/bin/clinica", line 8, in
sys.exit(main())
^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/clinica/cmdline.py", line 92, in main
cli()
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/clinica/iotools/converters/adni_to_bids/adni_to_bids_cli.py", line 79, in cli
adni_to_bids.convert_clinical_data(
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/clinica/iotools/converters/adni_to_bids/adni_to_bids.py", line 145, in convert_clinical_data
adni_utils.create_adni_sessions_dict(
File "/lyceum/kl2y21/miniconda3/envs/clinicaEnv/lib/python3.11/site-packages/clinica/iotools/converters/adni_to_bids/adni_utils.py", line 971, in create_adni_sessions_dict
raise ValueError("Empty dataset detected. Clinical data cannot be extracted.")
ValueError: Empty dataset detected. Clinical data cannot be extracted.

And this is my datasets:图片_20231202133926.png
The clinical data is:图片_20231202134222.png
I believe I followed the instructions in the documentation to download the data and use the commands. I really don't understand why this error occurred, and I would be extremely grateful for any help you can provide.

Kang

Kang Liu

unread,
Dec 2, 2023, 2:39:31 PM12/2/23
to Clinica
I noticed that the documentation for ADNI to BIDS does not mention ADNI4, so I downloaded ADNI1, 2, GO, and 3, and used the same command with data from two patients to run it again. However, the type of error I encountered was exactly the same, leaving me really unsure of what to do next. I've been stuck on this for a week now, and I'm unclear about where the problem lies. Could this be a bug in Clinica?
warm regards,
kang

Matthieu Joulot

unread,
Dec 4, 2023, 4:38:01 AM12/4/23
to Clinica
Hi Kang,
Can you tell me which sequences you have downloaded ? I think the problem may be linked to this. Clinica only converts specific sequences, which are detailed here in the folded items.

Have a good day,
Matthieu

Kang Liu

unread,
Dec 4, 2023, 7:22:11 AM12/4/23
to Clinica
Dear Matthieu,
Thank you for your reply.
Firstly, i have used pip install --upgrade dcm2niix, conda install -c conda-forge dcm2niix, and图片_20231204121204.png
I can't upgrade dcm2niix any further; the final version remains v1.0.20190902.
Secondly, i just download the datasets images, just like that 图片_20231204121550.png, and all the clinical data, which is like that
图片_20231204121707.png
And what is the meaning of sequences? is it withing  the clinical data?
图片_20231204121942.png

warm regards,
kang

Matthieu Joulot

unread,
Dec 4, 2023, 7:56:06 AM12/4/23
to Clinica
Hi Kang,

You can find the latest versions here. Do tell me if you're able to install it.

And for the sequences, no it is not a csv file. The sequence is a the image. So if you open the directory of your subject, you should have something like this:
Capture d’écran 2023-12-04 à 13.50.09.png
The title of the directory is the sequence (for instance Axial_DTI). Can you give tell me which one you want to convert ? And show me the sequences you have ?

And we only convert some of them as detailled in these criteria items (see image below) which you can find here
Capture d’écran 2023-12-04 à 13.52.03.png
Message has been deleted

Kang Liu

unread,
Dec 4, 2023, 10:52:54 AM12/4/23
to Clinica
Thank you very much for your patient reply.

i have downloaded the latest version of dcm2niix, which is 1.0.20230411
 图片_20231204155045.png
and need i configure the environment? Could you tell me where I can find instructions for configuring environment variables?

My sequence is below image(I only use two subject):
图片_20231204155142.png图片_20231204155145.png


I am looking to get the T1-weighted MRI, and the conversion command I used is clinica -v convert adni-to-bids DATASET_DIRECTORY CLINICAL_DATA_DIRECTORY ADNI_converted -m T1

Matthieu Joulot

unread,
Dec 4, 2023, 11:21:54 AM12/4/23
to Clinica
Hi Kang,

Sorry I was misleading. You'll need to follow the instructions here, or the ones right above to install using pip or conda. It would be better if you could install it using pip or conda of course, as it is simpler. your version of conda and python might not be compatible with the latest dcm2niix version so I suggest you update your conda environment and use python3.10.

I'll try to replicate your issue on my side.

Have a a good day,
Matthieu

Kang Liu

unread,
Dec 4, 2023, 11:32:51 AM12/4/23
to Clinica
okay, i have installed another conda and python just now, so my python is 3.11.5 and conda is 23.10.0

Kang Liu

unread,
Dec 4, 2023, 12:09:47 PM12/4/23
to Clinica
Dear Matthieu,

Is it possible that I have too few subjects, and none of them have T1-MRI (Does every subject in the ADNI dataset have T1-MRI?)? However, the error reported is 'Clinical dataframe extracted from xxx.csv is empty after filtering', which seems unrelated to the number of subjects.

Warm regards,
Kang

Matthieu Joulot

unread,
Dec 5, 2023, 5:53:47 AM12/5/23
to Clinica
After looking into the subjects you are trying to use, it turns out they are not in the file ADNIMERGE.csv, which we need to to the conversion. This data is unfortunately missing and the converter will not be able to convert it.
If it is not paramount that you use these two subjects, I would try others.

Were you able to install the right dcm2niix version ?

Have a good day,
Matthieu

黄锦泰

unread,
Dec 20, 2023, 1:18:17 PM12/20/23
to Clinica
Hi,

I'm facing the same problem, while my data search criteria are like this:
微信图片_20231221014613.png
微信图片_20231221014725.png

Then, the clinical data is the same as instructed in the tutorial documentation: "Select ALL tabular data (csv format)".

And I followed the instruction to use the corresponding command: clinica convert adni-to-bids ADNI_DIRECTORY CLINICAL_DATA_DIRECTORY BIDS_DIRECTORY -m T1.

After running it, I got the same error. I really don't know how to fix this. I've been stuck here for a week now. I'll be grateful if someone can help.

The version I used are the latest version: Clinica Version 0.7.7 and  dcm2niiX (v1.0.20230411) 

Best regards,
Harry

Matthieu Joulot

unread,
Dec 21, 2023, 4:51:10 AM12/21/23
to Clinica
Hi Harry,

Can you give a copy of the error you get ? That would be very helpful, thanks. Also, are trying to convert a specific subject ?

Have a good day,
Matthieu

黄锦泰

unread,
Dec 22, 2023, 1:58:14 PM12/22/23
to Clinica
Hi Matthieu,
Thank you for your reply.

The error I got was like this:

微信图片_20231223020036.png
微信图片_20231223020208.png

Also, I tried to convert a specific subject whose ID is 002_S_0413. Here is the search process:

微信图片_20231223024016.png
微信图片_20231223024044.png

However, I still got the same error and don't know what's wrong.

Best regards,
Harry
Reply all
Reply to author
Forward
0 new messages