Issues Encountered During ADNI-to-BIDS Conversion

41 views
Skip to first unread message

Shahzad ALi

unread,
Oct 18, 2024, 10:28:37 AM10/18/24
to Clinica

Hi everyone,

I’m currently working on converting ADNI data to BIDS format using Clinica, and I’ve encountered a couple of issues that I’m hoping to get some help with.

1. KeyError in Clinical Data: During the conversion process, I received the following error: 

  • KeyError: 'APGEN1' (atteched screenshot 1). 
  • This error occurred while creating the participants.tsv file.

2. Warning Regarding Unsupported Images: Additionally, I received a warning message during the conversion:

  • WARNING: Image with bad suffix ADC, real, imaginary was generated by dcm2nix. These are not supported by Clinica so the image will NOT be converted.
  • This warning appeared for the several subjects (atteched screenshot 2).

I’m concerned about the implications of this warning on the overall conversion process. Can anyone provide guidance on how to handle unsupported image formats in Clinica?

Any help or insights would be greatly appreciated!

Thank you in advance!

Best Regards,
Shahzad Ali

---------------------

Screenshot 2.png
Screensho 1.png

Alice Joubert

unread,
Oct 18, 2024, 11:07:18 AM10/18/24
to clinic...@googlegroups.com
Hello Ali,


1. This is an error triggered by recent changes in ADNI metadata structure, that we have yet to investigate properly. In the meantime, you can apply the following fix : https://github.com/aramis-lab/clinica/issues/1294#issuecomment-2353379871

2. Sometimes dcm2niix outputs files with _ADC, _real or _imaginary, which we choose to delete. To understand where these ADC files come from, you can read this dcm2niix github thread to decide if you still want to use them or not. Do you know if that represents a big proportion of your dataset ?

Best, 

Alice


--
You received this message because you are subscribed to the Google Groups "Clinica" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clinica-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clinica-user/d5fd03f5-daeb-418c-b7ec-1d3ed00db548n%40googlegroups.com.

Shahzad ALi

unread,
Oct 18, 2024, 2:38:48 PM10/18/24
to clinic...@googlegroups.com
Dear Alice,
Thank you so much for your quick response.
I followed the instruction given at the provided link https://github.com/aramis-lab/clinica/issues/1294#issuecomment-2353379871.
That issue of APGEN1 is resolved, but now I am having the error as below:

2024-10-18 19:55:12,883:DEBUG:PET_TAU conversion done.

2024-10-18 19:55:12,903:INFO:Creating modality agnostic files...

2024-10-18 19:55:12,924:INFO:Creating participants.tsv...

Traceback (most recent call last):

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/bin/clinica", line 8, in <module>

    sys.exit(main())

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/clinica/cmdline.py", line 113, in main

    cli()

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__

    return self.main(*args, **kwargs)

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/click/core.py", line 1078, in main

    rv = self.invoke(ctx)

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke

    return ctx.invoke(self.callback, **ctx.params)

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/click/core.py", line 783, in invoke

    return __callback(*args, **kwargs)

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/clinica/iotools/converters/adni_to_bids/adni_to_bids_cli.py", line 64, in cli

    convert(

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/clinica/iotools/converters/adni_to_bids/adni_to_bids.py", line 47, in convert

    adni_to_bids.convert_clinical_data(

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/clinica/iotools/converters/adni_to_bids/adni_to_bids.py", line 134, in convert_clinical_data

    participants_df = create_participants_df(

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/clinica/iotools/bids_utils.py", line 400, in create_participants_df

    file_to_read = load_clinical_csv(

  File "/Users/shahzadali/miniconda3/envs/clinicaEnv/lib/python3.10/site-packages/clinica/iotools/converters/adni_to_bids/adni_utils.py", line 1115, in load_clinical_csv

    raise IOError(

OSError: Expecting to find exactly one file in folder /Volumes/CrucialX6/ADNI_Clinica/Clinical_Data matching pattern APOERES(_\d{1,2}[A-Za-z]{3}\d{4})?.csv. 2 files were found instead : 

[- P- o- s- i- x- P- a- t- h- (- '- /- V- o- l- u- m- e- s- /- C- r- u- c- i- a- l- X- 6- /- A- D- N- I- _- C- l- i- n- i- c- a- /- C- l- i- n- i- c- a- l- _- D- a- t- a- /- A- P- O- E- R- E- S- _- 1- 6- A- u- g- 2- 0- 2- 4- .- c- s- v- '- )- ,-  - P- o- s- i- x- P- a- t- h- (- '- /- V- o- l- u- m- e- s- /- C- r- u- c- i- a- l- X- 6- /- A- D- N- I- _- C- l- i- n- i- c- a- /- C- l- i- n- i- c- a- l- _- D- a- t- a- /- .- _- A- P- O- E- R- E- S- _- 1- 6- A- u- g- 2- 0- 2- 4- .- c- s- v- '- )- ]

(clinicaEnv) shahzadali@Shahzads-MacBook-Pro ~ %  

I have double checked the directory but there is only one file in the CLinicalData Directory. However, When I searched on my machine with the name "APOERES". There are two files retreived but with the name "participant.csv" as indicated in the screenshot (I guess one for ADNI, and one for ABIDE and OASIS).
Screenshot 2024-10-18 at 20.32.45.png
When I opened the ADNI ones' Participants.csv, theere are two enteries mentioning APOERES:

Genotype (Allele 1)

apoe_gen1

Number: 2; 3; 4


APGEN1

APOERES.csv

Genotype (Allele 2)

apoe_gen2

Number: 2; 3; 4


APGEN2

APOERES.csv


Best,


Shahzad Ali PhD Researcher

Department of Pharmacy and Biotechnology,
Alma Mater Studiorum - Università di Bologna, Bologna, Italy

Life Science Computational Laboratory (LISCOMP),

IRCCS Ospedale Policlinico San Martino, Genova, Italy.

E: shahz...@unibo.it | shahza...@gmail.com 

T: +39 348 2657 723

-----------------------------------------------------------------------



Alice Joubert

unread,
Oct 21, 2024, 5:49:49 AM10/21/24
to clinic...@googlegroups.com
Dear Ali,

Perfect !

Could I ask something of you ? We are currently implementing the fix in our code but lack the file for testing as ADNI download platform has evolved a lot. Would you happen to still have the non modified APOERES file somewhere and if yes, could you send it to us ? Thanks !

For your new issue, I think you might have a hidden file in your clinical data folder. Clinica currently takes them into account if they exist. To check if it is really this, you can run the `ls -la` in your clinical data folder :

image.png

The hidden files start with a '.' and appear at the top of the list. As you can see there I have 2 APOERES files because of this. To fix the issue quickly if you only have one, you can delete it manually by running `rm "name_of_the_hidden_file"`. For me that would be `rm .APOERES.csv`.

Best,

Alice

Shahzad ALi

unread,
Oct 21, 2024, 6:03:27 AM10/21/24
to clinic...@googlegroups.com
Dear Alice,
Thank you so much for your kind response. I will check for the hidden APOERES file in my clinical directory and will update here accordingly.
I have attached the non-modified APOERES file for your reference.

Shahzad Ali PhD Researcher

Department of Pharmacy and Biotechnology,
Alma Mater Studiorum - Università di Bologna, Bologna, Italy

-----------------------------------------------------------------------



APOERES_16Aug2024.csv

Alice Joubert

unread,
Oct 22, 2024, 5:12:09 AM10/22/24
to Clinica
Hello Ali !

Thank you very much for the file, that is very helpful.

Best,

Alice

Reply all
Reply to author
Forward
0 new messages