Assistance with NIFD to BIDS Conversion

80 views
Skip to first unread message

oumayma soula

unread,
Jul 8, 2024, 4:51:45 PM7/8/24
to Clinica
Dear community

PLZ, I am attempting to apply the Conversion of Neuroimaging in Frontotemporal Dementia (NIFD) to BIDS, as I believe it will greatly facilitate the management and processing of my data. I have followed all the steps outlined on the site and in the documents but usually fail. I suspect the problem may lie in my data selection. My dataset contains only T1 and resting-state images. As you know, after downloading this data, it is organized into numerous subfolders.
Could you please clarify whether Clinica supports fMRI data and if there are any issues related to reading these subfolders until finding DICOM images? Additionally, I would appreciate guidance on the exact process for downloading the data, as I am not interested in all modalities. Should I convert all subjects together or separate them into control and patients?

I would also appreciate any suggestions for managing my data, particularly since I need to organize it by visit (M0, M6, M12, and M18) to study disease progression.

Thanks  !

Alice Joubert

unread,
Jul 9, 2024, 9:59:24 AM7/9/24
to oumayma soula, Clinica
Hello !

To better assist you with the issues you encounter using the NIFD-to-BIDS converter it would be easier if you could provide the command line you used, on which folder organisation (raw) and what the error is. 
To answer your other questions :
- No, Clinica does not support fMRI data for the NIFD dataset so these images will not be converted. You can find all the supported modalities in the documentation of Clinica if you want to check.
- Could you be more specific when you say you do not want all the modalities ? You can normally select MRI or/and PET images on the site used to download data.
- The way you organize your data depends on what you want to do with it afterwards : you could have them in separate folders between control and patients or have an additional file indicating if subjects are known to be control or patient. It depends on how you process your data.
- If you succeed in converting your NIFD data to BIDS format, your images should be organized by visit at some point so it should be quite practical to study evolution over time.


Hope this helps,
Alice

oumayma soula

unread,
Jul 9, 2024, 10:24:38 AM7/9/24
to Clinica
Thank you very much this is so helpful
the commande i used is: clinica convert nifd-to-bids <dataset_directory> <clinical_data_directory> <bids_directory>
then the error : Error: Invalid value for 'DATASET_DIRECTORY' It seems like the data is not being read that's why i asked about dataset
Note that dcm2niix and the clinical environment are already installed.
okay i understand , noted 

thanks 

Alice Joubert

unread,
Jul 9, 2024, 2:37:57 PM7/9/24
to oumayma soula, Clinica
What do you put in the command line instead of dataset_directory ? (You can just copy here the command line you used with your own paths)

--
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/6a7432aa-8b24-4e3e-ba42-f3b1593729a6n%40googlegroups.com.

oumayma soula

unread,
Jul 9, 2024, 8:46:51 PM7/9/24
to Clinica
clinica convert nifd-to-bids /home/ouma/Downloads/DATASET_DIRECTORY /home/ouma/Downloads/clinical_data_directory /home/ouma/Downloads/NIFD_BIDS

and this is a screen shot for the error even during the activation clinica-envScreenshot 2024-07-10 014227.png

Alice Joubert

unread,
Jul 10, 2024, 4:02:07 AM7/10/24
to oumayma soula, Clinica
This error occurs when the converter cannot find the metadata stored in a .csv file in the BIDS_DIRECTORY. When you downloaded your raw data, did you also get the csv ?

image.png

If you did you just need to place the resulting csv in the BIDS_DIRECTORY folder and the converter should work.

Hope this helps,

Alice

oumayma soula

unread,
Jul 10, 2024, 5:21:03 AM7/10/24
to Clinica
thanks Alice,

So, the DATASET_DIRECTORY should contain folders of subjects and their CSV file ; if yes, I got this error ( should i  respect a specific file name;)



Screenshot 2024-07-10 101556.pngScreenshot 2024-07-10 101257.png

Alice Joubert

unread,
Jul 11, 2024, 5:47:36 AM7/11/24
to oumayma soula, Clinica
Hi ! 

I think you did everything right and the error came from the code itself. I made a modification to adjust to that so if you update Clinica to its latest dev version the conversion should work.


Let me know !

Alice

oumayma soula

unread,
Jul 11, 2024, 6:46:14 PM7/11/24
to Clinica
HI again

I still got the same error. Is Clinica version 0.8.1 the correct one? This is what I got after the update

Alice Joubert

unread,
Jul 12, 2024, 3:50:50 AM7/12/24
to oumayma soula, Clinica
Hi ! 

We updated the dev version but not the 0.8.1 yet. We are currently working on it so I will get back to you when it's done !

Alice

oumayma soula

unread,
Jul 12, 2024, 9:30:00 AM7/12/24
to Clinica
Hi Alice 

To update Clinica to its latest development version, I follow these guidelines (which still are not working for me) . If I'm wrong, please provide the correct link to the GitHub repository or documentation.Screenshot 2024-07-12 142244.png

Alice Joubert

unread,
Jul 15, 2024, 4:41:55 AM7/15/24
to oumayma soula, Clinica
Hello !

Clinica 0.8.2 which contains the fix mentioned above was released today, so there is no need for you to install the dev version anymore. In principle 0.8.2 can be installed with the same command line you used for installing 0.8.1 (here as a reminder) but since you already have the previous version you can just use "pip install --upgrade clinica" in your clinica folder on your device.

Tell me if that helps,

Alice

oumayma soula

unread,
Jul 15, 2024, 5:23:02 AM7/15/24
to Clinica
Hi Alice!

It works now! Thanks a lot for your assistance and kindness. 
Now l should look into fMRI to see how to convert and manage them.

Thanks again !

Alice Joubert

unread,
Jul 15, 2024, 5:59:02 AM7/15/24
to oumayma soula, Clinica
No worries. Thanks a lot for reaching out to us, we could fix this issue thanks to you !

Have a good day,

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.
Message has been deleted

oumayma soula

unread,
Jul 30, 2024, 11:00:50 AM7/30/24
to Clinica
hi Alice

Please, I still have issues adding the func folder for fMRI to NIFD folder (T1 managed with Clinica). I have tried many times with my code, but I keep failing, especially since I have many sections (the dates could confuse me). Could you recommend other tools that could help me or provide a few steps to follow?

thanks !

Alice Joubert

unread,
Aug 1, 2024, 3:27:11 AM8/1/24
to oumayma soula, Clinica
Hi !

To be fair I do not know other tools that do this. To help you as best as I can, do you mind sending a sample overview of your fmri data so I can see how it is currently organized ? 

Best,

Alice

oumayma soula

unread,
Aug 1, 2024, 5:17:22 AM8/1/24
to Clinica
thanks a lot Alice !

  Currently, I have resting-state images for each subject at different time points (M0, M6, M12, M18). The structure now looks like this:
/Downloads/NIFDproject/NIFD-patient-g1/1_S_0310/Resting_State2.5x2.5x3_EyesClosed
After converting the images to NIfTI format, we can include the date in the filename of each image. i failed with my code because of the date
 I want to follow this structure: 
   Screenshot 2024-07-30 161018.png
  The anat folder is well-structured because of Clinica. I want to add a func folder  
hope i can get my point know !
thanks 

Alice Joubert

unread,
Aug 1, 2024, 7:24:24 AM8/1/24
to oumayma soula, Clinica
Can you show what the filename looks like with the date ?

--
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.

oumayma soula

unread,
Aug 1, 2024, 8:10:59 AM8/1/24
to Clinica
This demonstrates how dates are organized in the DICOM images directory:
/Downloads/NIFDproject/NIFD-patient-g1/1_S_0310/Resting_State2.5x2.5x3_EyesClosed/2011-08-16_09_40_21.0/I774531

After the transformation to NIfTI format, all files are placed in the same folder without (-).
Screenshot from 2024-08-01 13-04-57.png

No matter about the T1, my issue is related to managing the dates corresponding to each visit. I tried to use a CSV file, but it failed too.
thanks a lot Alice !

Alice Joubert

unread,
Aug 1, 2024, 9:34:55 AM8/1/24
to oumayma soula, Clinica
I have been informed that you could use dcm2nix (https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage) or heudiconv (https://heudiconv.readthedocs.io/en/latest/quickstart.html) since they convert dicoms to nifti as well as they provide help to organize in BIDS format. You might want to check these out first.

Sorry for the delay !

Alice

Soula Oumayma

unread,
Aug 1, 2024, 11:46:37 AM8/1/24
to Alice Joubert, Clinica, oumayma soula
Yup I tried with them too before knowing clinica, i was faced many issues.

But okay I will focus more on them maybe I didn’t used correctly,
Hope, I  will back with good news 

Thanks Alice ! 
Really appreciate that

--
Oumayma SOULA,
PhD candidate in Computational Neuroscience,
Faculty of Medicine of Sfax, Tunisia
Phone number: +216 26 137 126.


Soula Oumayma

unread,
Aug 1, 2024, 11:59:47 AM8/1/24
to Alice Joubert, Clinica, oumayma soula
The issue that they didn’t make session, here  the transformation already done with dcmniix !
I will see 🙏

--
Oumayma SOULA,
PhD candidate in Computational Neuroscience,
Faculty of Medicine of Sfax, Tunisia
Phone number: +216 26 137 126.

Alice Joubert

unread,
Aug 2, 2024, 7:49:07 AM8/2/24
to Soula Oumayma, Clinica, oumayma soula
Tell me how that goes !

oumayma soula

unread,
Aug 12, 2024, 6:26:03 PM8/12/24
to Alice Joubert, Soula Oumayma, Clinica
Hi Alice 

back to you;
so, like clinica to arrange all data with a simple command,I can't find , hope will support fMRI very soon😅
But What I did was download the sessions separately, so I could use any of the dcm2bids, heudiconv, bidscoin and many others.
 For me, I'm using ezBIDS(from brainlife). Even for preprocessing, I think will continue with Brainlife. I find it very user-friendly 

Thanks for all Alice !

 
--
Oumayma SOULA
PhD candidate in Computational Neuroscience
Faculty of Medicine of Sfax, Tunisia
Phone number: +216 26 137 126.

Alice Joubert

unread,
Aug 19, 2024, 4:44:12 AM8/19/24
to oumayma soula, Soula Oumayma, Clinica
Hi !

I am glad you found a solution that suits you. 

No worries, happy to help !

Have a good day, 
Alice
Message has been deleted

wusat ulh

unread,
Sep 15, 2024, 2:34:18 AM9/15/24
to Clinica
I hope you are doing well.  I am Wusat Ullah.I am doing work on a project.  I am currently working with ADNI data for my project on Alzheimer's disease diagnosis using 2D CNNs on 3D MRI brain scans. Specifically, I am referencing the work detailed in the paper titled Attention-based eXplainability for Interpretable Alzheimer's Localized Diagnosis using 2D CNNs on 3D MRI brain scans
I am encountering an issue while attempting to convert the ADNI data to BIDS format using Clinica. The command I am running is: 

clinica convert adni-to-bids -m T1 "E:\ADNI-Screening-1.5T-AD-Complete\RAW_Data" "E:\ADNI-Screening-1.5T-AD-Complete\csv" "E:\ADNI-Screening-1.5T-AD-Complete\BIDS_Directory"  

i need data APGEN1 and APGEN2 

have downloaded the data directly from the ADNI official site, and I suspect that the 'APGEN1' field may be missing or incorrectly named in the clinical data CSV file. Would you be able to provide any suggestions on how to resolve this issue?

I would greatly appreciate any guidance or recommendations you might have to help me move forward with the BIDS conversion process.

Thank you very much for your time and assistance.

Best regards,


2024-09-14 11:09:50,280:INFO:No T1 image path found for subject 033_S_7114 in visit bl with image ID 1633742
2024-09-14 11:09:50,280:INFO:No T1 image path found for subject 053_S_7086 in visit bl with image ID 1590221
2024-09-14 11:09:50,280:INFO:No T1 image path found for subject 035_S_7049 in visit bl with image ID 1584183
2024-09-14 11:09:50,280:INFO:No T1 image path found for subject 082_S_7117 in visit bl with image ID 1644899
2024-09-14 11:09:50,281:INFO:No T1 image path found for subject 035_S_7121 in visit bl with image ID 1669252
2024-09-14 11:09:50,347:INFO:Paths of T1 images found. Exporting images into BIDS ...
2024-09-14 11:09:53,315:INFO:Creating modality agnostic files...
2024-09-14 11:09:53,324:INFO:Creating participants.tsv...
Traceback (most recent call last):
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\pandas\core\indexes\base.py", line 3802, in get_loc
    return self._engine.get_loc(casted_key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'APGEN1'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Scripts\clinica.exe\__main__.py", line 7, in <module>
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\clinica\cmdline.py", line 92, in main
    cli()
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\clinica\iotools\converters\adni_to_bids\adni_to_bids_cli.py", line 79, in cli
    adni_to_bids.convert_clinical_data(
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\clinica\iotools\converters\adni_to_bids\adni_to_bids.py", line 123, in convert_clinical_data
    participants_df = bids.create_participants_df(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\clinica\iotools\bids_utils.py", line 125, in create_participants_df
    value_to_read = file_to_read[participant_fields_db[i]]
                    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\pandas\core\frame.py", line 3807, in __getitem__
    indexer = self.columns.get_loc(key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\wusat\Desktop\AXIAL-main\.venv\Lib\site-packages\pandas\core\indexes\base.py", line 3804, in get_loc
    raise KeyError(key) from err
KeyError: 'APGEN1'

On Sunday, September 15, 2024 at 2:30:27 PM UTC+8 wusat ulh wrote:

I hope you are doing well.  I am Wusat Ullah.I am doing work on a project.  I am currently working with ADNI data for my project on Alzheimer's disease diagnosis using 2D CNNs on 3D MRI brain scans. Specifically, I am referencing the work detailed in the paper titled Attention-based eXplainability for Interpretable Alzheimer's Localized Diagnosis using 2D CNNs on 3D MRI brain scans
I am encountering an issue while attempting to convert the ADNI data to BIDS format using Clinica. The command I am running is: 

clinica convert adni-to-bids -m T1 "E:\ADNI-Screening-1.5T-AD-Complete\RAW_Data" "E:\ADNI-Screening-1.5T-AD-Complete\csv" "E:\ADNI-Screening-1.5T-AD-Complete\BIDS_Directory"  

i need data APGEN1 and APGEN2 

have downloaded the data directly from the ADNI official site, and I suspect that the 'APGEN1' field may be missing or incorrectly named in the clinical data CSV file. Would you be able to provide any suggestions on how to resolve this issue?

I would greatly appreciate any guidance or recommendations you might have to help me move forward with the BIDS conversion process.

Thank you very much for your time and assistance.

Best regards,


image.png


image.png
image.png
image.png

Alice Joubert

unread,
Sep 17, 2024, 10:18:16 AM9/17/24
to clinic...@googlegroups.com
Hello ! 

Thanks for reporting. This issue has been relayed to us several times these past days but we have yet to fix it. If you wish to resolve this quickly, another user proposed a fix under this github issue. Let me know if you succeed in implementing it !

Best,

Alice

Reply all
Reply to author
Forward
0 new messages