aramis-lab / clinica

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

Issues when running AIBL converter #1374

Open fyb99 opened 8 hours ago

fyb99 commented 8 hours ago

Description Continuous errors with 'FileNotFoundError: No such file or no access: '/XXX/data/AIBL/AIBL_BIDS/sub-AIBL18/ses-M036/anat/sub-AIBL18_ses-M036_T1w.nii.gz''

Converters

Hi, recently I am trying to use clinica for converting the raw data from ADNI to the BIDS format. When I use the clinica framework to convert the T1-mri with the command 'clinica convert aibl-to-bids ./AIBL ./clinical ./AIBL_BIDS', although it can succesfully convert some samples, it will continously meet error with '/XXX/data/AIBL/AIBL_BIDS/sub-AIBL18/ses-M036/anat/sub-AIBL18_ses-M036_T1w.nii.gz'. After checking this folder, it commonly only has a json file without the nii.gz file. How to fix it? My system is linux and the version of clinica is 0.9.2.

NicolasGensollen commented 8 hours ago

Hi @fyb99

Thanks for reporting. Could you provide the logs you get when running the convert command ?

fyb99 commented 8 hours ago

Hi, I just try to manually delete these folders in the raw data. It lead to another result (see the figure), which seems like an error. But I can find the tsv and json file in the final output dir. Does it mean I successully convert the data? image By the way, for the former question, the logs have been covered in my terminal window. But I am sure the error all reports 'FileNotFoundError: No such file or no access: '/XXX/data/AIBL/AIBL_BIDS/sub-AIBL18/ses-M036/anat/sub-AIBL18_ses-M036_T1w.nii.gz'' And the dirs that I mannually delete are 313,516 and another one (I forget this index, sorry)

NicolasGensollen commented 7 hours ago

The error in the screenshot seems like a bug to me indeed.

The variable file_path comes from

https://github.com/aramis-lab/clinica/blob/4d700d75d56f9ada51ee88b66d39966c315d89e3/clinica/iotools/bids_utils.py#L569-L573

Such that it is a PosixPath and not a string. This line should probably be:

if "flutemeta" in file_path.name and study_name == StudyName.AIBL

instead.

NicolasGensollen commented 6 hours ago

For the initial error you were having, it is difficult to make a diagnostic without the logs because the FileNotFoundError seems more like a consequence of the real problem. I suspect something went wrong when trying to convert those images, and no nifti images were produced, which leads to this error at some point. The logs should, in theory, contain information on these conversion errors.

NicolasGensollen commented 6 hours ago

I'm going to open a dedicated issue for the PosixPath vs. String bug and make a fix for it, leaving this one open for the initial issue you were facing.

fyb99 commented 6 hours ago

Thanks fory your reply. By the way, although the code reports the error about the file_path, I can find the participants.tsv and dataset_description.json file in the target dir, do you think the converting process has succeeded? Since I only need the T1 mri and clinical data of the corresponding patient, may I continue to the next step?

NicolasGensollen commented 5 hours ago

The conversion process failed at the very last step in which the scans TSV files are computed and written:

https://github.com/aramis-lab/clinica/blob/4d700d75d56f9ada51ee88b66d39966c315d89e3/clinica/iotools/converters/aibl_to_bids/aibl_to_bids.py#L198-L200

In other words, the output you have should contain everything except these files which contain some metadata relative to the images. If the conversion wasn't too long, I would advise to redo it once the bug is patched but I believe you should be fine continuing as I don't think these metadata are strictly mandatory to run the pipelines.

fyb99 commented 5 hours ago

ok, thanks a lot