Specify dcm2bids config files


It seems like config.json file is necessary when use dcm2bids to convert DICOM files. But sometimes the structure of DICOM files is not the same across all the subjects. For example, some subjects only complete part of all the tasks or perform some tasks twice due to bad performance during the 1st scanning. So one config.json file cannot fit to all the subjects and it’s impossible to create config.json manually for thousands of subjects. May I ask how to handle this situation? Especially the json files created by dcm2bids are required by fmriprep.

Here is what I can think of: use dcm2bids to convert on a subject who complete all the tasks, then rename and copy/paste these json files to folders containing NIFTI files of other subjects, does this make sense? The problem of this situation is, I do not know if json files contains individual information specified to each subject that may affect the outcomes of fmriprep.

Thanks to any suggestions!



Could you share a specific example? E.g. how would *task-A_run-??_bold.nii.gz look across a few subjects?
If it helps, if multiply scans correspond to an entry in your dcm2bids configuration file, then these files will be automatically labeled with the “run” attributed, given their order in the dicom series. E.g.
could be made from one dcm2bids config entry.

Is this feature enough for your purposes?

Thanks for your kind reply. I guess I know how config.json works. Missing data would not been converted even it is listed in the config.json. May I ask if there is a manual on how we should create config.json file, e.g., which variables are necessary and which variables should not be changed?

I just noticed that dcm2nii automatically creates json file for each nifti file. Hence I can create BIDS format by copy and paste. Thanks.

No worries.
If you still wanted to use dcm2bids, you can use parameters in the .json files dcm2bids creates in your config.json file. Every criterion dcm2bids uses to classify scans is taken from the json file for each scan/series.

If you need to include or change certain fields, you can include the "sidecarChanges": field in your dcm2bids config.json. Include it in a specific scan/series entry.
If you want, go ahead and post your dcm2bids config.json, as well as any relevant parameters. I can help you format it, if you like!

I see. I know how to build a config.json now. Thank you very much!

1 Like