Dcm2bids field maps problem

Summary of what happened:

I have two fieldmaps (AP, PA) for resting state fMRI, and two fieldmaps for DTI. When using dcm2bids to convert the data, I see the following errors for resting state fieldmaps:

Command used (and if a helper script was used, a link to the helper script or the command generated):

The config files look like this:


{
      "datatype": "func",
      "suffix": "bold",
      "custom_entities": "task-rest",
      "criteria": {
        "SeriesDescription": "Axial rsfMRI (EYES OPEN)"},
      "sidecar_changes": {
        "TaskName": "rest"
      }
      },
{
      "datatype": "fmap",
      "suffix": "epi",
      "custom_entities": "dir-AP",
      "criteria": {
        "SeriesDescription": "fMRI Fieldmap A"
      },
      "sidecar_changes": {
        "intendedFor": ["id_task-rest"]
      }
    },
{
      "datatype": "fmap",
      "suffix": "epi",
      "custom_entities": "dir-PA",
      "criteria": {
        "SeriesDescription": "fMRI Fieldmap P"
      },
      "sidecar_changes": {
        "intendedFor": ["id_task-rest"]
      }
    }

Version:

I’m using the latest versions of everything within conda.


INFO    | OS version: Linux-5.14.0-1024-oem-x86_64-with-glibc2.31
INFO    | Python version: 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:50:58) [GCC 12.3.0]
INFO    | dcm2bids version: 3.1.1
INFO    | dcm2niix version: v1.0.20240202
INFO    | Checking for software update
INFO    | Currently using the latest version of dcm2bids.
INFO    | Currently using the latest version of dcm2niix.

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):


WARNING | {'dir'} have not been found for datatype 'fmap' and suffix 'epi'.
INFO    | sub-220409_dir-AP_epi  <-  801_220409_fMRI_Fieldmap_A_20220824152504
WARNING | {'dir'} have not been found for datatype 'fmap' and suffix 'epi'.
INFO    | sub-220409_dir-PA_epi  <-  901_220409_fMRI_Fieldmap_P_20220824152504
WARNING | {'task'} have not been found for datatype 'func' and suffix 'bold'.
INFO    | sub-220409_task-rest_bold  <-  1001_220409_Axial_rsfMRI_(EYES_OPEN)_20220824152504

Screenshots / relevant information:


Hi @Catherine_Tang, and welcome to neurostars!

Does the code complete despite the warning? What do the outputs look like? Can you share the output of tree on the subject directory?

Best,
Steven

Hi Steven,

Yes, the code completed despite the warning. The output of the subject directory looks like this:


├── anat
│ ├── sub-220409_FLAIR.json
│ ├── sub-220409_FLAIR.nii.gz
│ ├── sub-220409_run-01_dwi.bval
│ ├── sub-220409_run-01_dwi.bvec
│ ├── sub-220409_run-01_dwi.json
│ ├── sub-220409_run-01_dwi.nii.gz
│ ├── sub-220409_run-02_dwi.bval
│ ├── sub-220409_run-02_dwi.bvec
│ ├── sub-220409_run-02_dwi.json
│ ├── sub-220409_run-02_dwi.nii.gz
│ ├── sub-220409_T1w.json
│ └── sub-220409_T1w.nii.gz
├── fmap
│ ├── sub-220409_dir-AP_epi.json
│ ├── sub-220409_dir-AP_epi.nii.gz
│ ├── sub-220409_dir-PA_epi.json
│ ├── sub-220409_dir-PA_epi.nii.gz
│ ├── sub-220409_run-01_fmap.bval
│ ├── sub-220409_run-01_fmap.bvec
│ ├── sub-220409_run-01_fmap.json
│ ├── sub-220409_run-01_fmap.nii.gz
│ ├── sub-220409_run-02_fmap.bval
│ ├── sub-220409_run-02_fmap.bvec
│ ├── sub-220409_run-02_fmap.json
│ └── sub-220409_run-02_fmap.nii.gz
└── func
├── sub-220409_task-rest_bold.json
└── sub-220409_task-rest_bold.nii.gz

I also have a related question for you: for the dwi fieldmaps, although it did not give me any warnings, I wanted to check if the outputs look sensible. I had the following config:


{
“datatype”: “anat”,
“suffix”: “dwi”,
“criteria”: {
“SeriesDescription”: “DTI 1”},
“sidecar_changes”: {
“ProtocolName”: “DTI1”
}
},
{
“datatype”: “anat”,
“suffix”: “dwi”,
“criteria”: {
“SeriesDescription”: “DTI 2”},
“sidecar_changes”: {
“ProtocolName”: “DTI2”
}
},
{
“datatype”: “fmap”,
“suffix”: “fmap”,
“criteria”: {
“SeriesDescription”: “DTI Fieldmap P”},
“sidecar_changes”: {
“intendedFor”: [“id_dwi”]
}
},
{
“datatype”: “fmap”,
“suffix”: “fmap”,
“criteria”: {
“SeriesDescription”: “DTI Fieldmap A”},
“sidecar_changes”: {
“intendedFor”: [“id_dwi”]
}
},

Hi @Catherine_Tang,

That is not valid. DWI data should be in the DWI folder.

You don’t need to do that, it should already be part of your JSON.

fmaps should not have bvals and bvecs. If these are reverse phase encoded b0 fieldmaps they should have the epi.nii.gz suffix and only have an accompanying json.

Best,
Steven

Hi Steven,

Great, thanks! I fixed the dwi issue. So back to the original question: I don’t need to worry about the warnings then (i.e., WARNING | {‘dir’} have not been found for datatype ‘fmap’ and suffix ‘epi’.)?
I checked the fmaps for DWI, they are indeed reverse phase encoded b0 fieldmaps. The bvals and bvecs were generated via the helper command. In this case, should I just remove the bvals and bvecs, and change the config to the following:

{
“datatype”: “fmap”,
**“suffix”: “epi”,**
“criteria”: {
“SeriesDescription”: “DTI Fieldmap P”},
“sidecar_changes”: {
“intendedFor”: [“id_dwi”]
}
},
{
“datatype”: “fmap”,
**“suffix”: “epi”,**
“criteria”: {
“SeriesDescription”: “DTI Fieldmap A”},
“sidecar_changes”: {
“intendedFor”: [“id_dwi”]
}
}

I also wanted to check if the “intendedFor”: [“id_dwi”] will ensure that these B0 maps will be recognized later for dwi?

Thanks,
Catherine

Hi @Catherine_Tang

as long as the outputs are BIDS valid, which you can check with the BIDS validator, it should be fine.

Yup

You can look at the IntendedFor of the output fmap json files. Keep in mind you might have to remove the BIDS URI (i.e., the leading sub-XXX/) from each intendedfor field until the BIDS URI is officially supported, which should be in future releases.

Best,
Steven

Great, thanks so much!

Hi @Catherine_Tang,

I also noticed that you have “intendedFor”: [“id_dwi”] but you don’t have the ID specified for the DWI file in your config, so that ID may not map to anything.

Best,
Steven

@Steven Ohhh, that’s right! Would adding this (“custom_entities”: “acq-dwi”,
) work:

{
“datatype”: “dwi”,
“suffix”: “dwi”,
"custom_entities": "acq-dwi",
“criteria”: {
“SeriesDescription”: “DTI 1”},
“sidecar_changes”: {
“ProtocolName”: “DTI1”
}
},
{
“datatype”: “dwi”,
“suffix”: “dwi”,
"custom_entities": "acq-dwi",
“criteria”: {
“SeriesDescription”: “DTI 2”},
“sidecar_changes”: {
“ProtocolName”: “DTI2”
}
},

Thanks,
Catherine

Hi @Catherine_Tang,

No. You would need to create an "id" field (which is then invoked in the intendedFor field). Please refer to the documentation: Create a config file - dcm2bids documentation

I would remove those lines. "acq-dwi" is a bit redundant, and it is likely that the JSONS already have ProtocolName from the dicom conversion.

Best,
Steven