Dcm2bids questions

Hi everyone,

I’m trying to convert MRI scans to BIDS with dcm2bids for the first time and I’m confused about a few points.

  1. In the documentation it says "dcm2bids_helper: This command will convert the DICOM files it finds to NIfTI files and save them inside a temporary directory for you to inspect and make some filters for the config file.” Is it necessary/recommended to use this command? If I have a scan protocol with all details, can I use that instead?
  2. It also says “dcm2bids uses information from the config file to determine which data in the protocol will be converted”. However I thought dcm2bids_helper already converts files without a config file and provides information we need to create the config file? I don’t understand how one function needs the config file for conversion but another function just converts without this file and is needed to create the file in the first place.
  3. “In short you need a configuration file because, for each acquisition, dcm2niix creates an associated .json file, containing information from the dicom header. These are known as sidecar files. These are the sidecars that dcm2bids uses to filter the groups of acquisitions based on the configuration file”. What is the role of dcm2niix - is this a step that runs before dcm2bids? Does it get called automatically or do I need to call it? And again it says that dcm2niix creates sidecar files but it also says above that dcm2bids_helper creates sidecar files too.
  4. How many details about the acquisition does the config file need to have? Every detail we’d like to be in the sidecar file/the header? Or just enough to uniquely identify acquisition, because the config file does not determine what goes into sidecar file/header?

Essentially the way I understand how all these functions work together is the following, but I’m not sure so maybe someone could confirm it:

  1. dcm2bids_helper is run on one subject to create its sidecar files and create config file based on this information, but this command does not sort scans into directories like anat/dwi/func and it does not rename the scans properly
  2. dcm2bids is called, it first runs dcm2niix internally which creates sidecar files for all subjects
  3. dcm2bids then uses these sidecar files plus the config file and arranges scans into the correct folders and gives them the correct names depending on type of acquisition

Thank you in advance!

Hi @LM99 and welcome to neurostars!

Not necessary to use it. As long as you have some dcm2niix output jsons that give you enough information to make a config file, you are all set.

Nope. The helper simply runs dcm2niix to produce a sample set of nifti/json files (not BIDS organized) that you can use to inform a config file. The config file is used for the BIDS organization.

dcm2niix is run under the hood of dcm2bids. After the dcm2niix outputs are made, which are a set of nifti/json files that are NOT BIDS organized, the config file is used to recognize which sets of files are your anatomicals, bold, dwi, etc…

Just enough to uniquely identify each file. Usually the SeriesDescription is a good place to start, but you can use any set of criteria needed. Also note that if you have multiple runs of the same acquisition, you do not need to uniquely identify each one, as dcm2bids will automatically add the run-<> BIDS label.

That’s basically it! Except for you have to create the config file, it doesn’t happen automatically in the helper function.

Best,
Steven

Thanks so much, everything is much clearer to me now!