Dcm2bids warning: WARNING | {‘task’} have not been found for datatype ‘func’ and suffix ‘bold’

Summary of what happened:

Hi, experts,

  1. I’m curious about why the following warning is generated. Additionally, is the warning critical? I work with batch scripts in a Windows environment.
  • WARNING | {‘task’} have not been found for datatype ‘func’ and suffix ‘bold’.
  1. I’m curious if I should use the following code
  • –bids_validate --force_dcm2bids --clobber

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

@echo off
setlocal enabledelayedexpansion

set "source_folder=D:\ys\sourcedata"

set "dcm2bids_command=dcm2bids -c code\dcm2bids_config.json -s 1 --auto_extract_entities"

for /d %%i in ("%source_folder%\*") do (
    set "folder_name=%%~nxi"
    set "participant_id=!folder_name:~0,3!"
    start cmd /k "%dcm2bids_command% -d "%%i" -p "!participant_id!""
)

Version:

v. 3.1.1

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

→ anaconda
Python version: 3.12.3 | packaged by conda-forge

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

sub-056/ses-1
├── anat
│   ├── sub-056_ses-1_T1w.json
│   ├── sub-056_ses-1_T1w.nii
│   ├── sub-056_ses-1_T2w.json
│   └── sub-056_ses-1_T2w.nii
├── fmap
│   ├── sub-056_ses-1_magnitude1.json
│   ├── sub-056_ses-1_magnitude1.nii
│   ├── sub-056_ses-1_magnitude2.json
│   ├── sub-056_ses-1_magnitude2.nii
│   ├── sub-056_ses-1_phasediff.json
│   └── sub-056_ses-1_phasediff.nii
└── func
    ├── sub-056_ses-1_task-rest_run-01_bold.json
    ├── sub-056_ses-1_task-rest_run-01_bold.nii
    ├── sub-056_ses-1_task-rest_run-02_bold.json
    └── sub-056_ses-1_task-rest_run-02_bold.nii

Relevant log outputs (up to 20 lines):

2024-05-13 03:20:39.857 - INFO     - dcm2niix_gen.execute | Check log file for dcm2niix output

2024-05-13 03:20:39.860 - INFO     - sidecar.build_acquisitions | SIDECAR PAIRING
2024-05-13 03:20:39.860 - WARNING  - sidecar.searchDcmTagEntity | {'task'} have not been found for datatype 'func' and suffix 'bold'.
2024-05-13 03:20:39.860 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_task-rest_bold  <-  056_AAA_ep2d_FOV240_3x3x3_30sl_TR2000_TE30_bw1096Hz_whole_brain_20151104110000_17
2024-05-13 03:20:39.860 - WARNING  - sidecar.searchDcmTagEntity | {'task'} have not been found for datatype 'func' and suffix 'bold'.
2024-05-13 03:20:39.860 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_task-rest_bold  <-  056_AAA_ep2d_FOV240_3x3x3_30sl_TR2000_TE30_bw1096Hz_whole_brain_20151104110000_22
2024-05-13 03:20:39.860 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_magnitude1  <-  056_AAA_field_map_20151104110000_27_e1
2024-05-13 03:20:39.860 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_magnitude2  <-  056_AAA_field_map_20151104110000_27_e2
2024-05-13 03:20:39.860 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_phasediff  <-  056_AAA_field_map_20151104110000_28_e2_ph
2024-05-13 03:20:39.861 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_T1w  <-  056_AAA_t1_mpr_sag_p2_1mm_WholeBrain_20151104110000_29
2024-05-13 03:20:39.861 - INFO     - sidecar.build_acquisitions | sub-056_ses-1_T2w  <-  056_AAA_t2_tirm_tra_dark-fluid_20151104110000_30
2024-05-13 03:20:39.861 - INFO     - sidecar.find_runs | sub-056\ses-1\func\sub-056_ses-1_task-rest_bold has 2 runs
2024-05-13 03:20:39.861 - INFO     - sidecar.find_runs | Adding run information to the acquisition
2024-05-13 03:20:39.861 - INFO     - dcm2bids_gen.run | Moving acquisitions into BIDS folder "d:\ys\sub-056\ses-1".

Screenshots / relevant information:

<config file>

{
  "dcm2niixOptions": "-ba n",
  "descriptions": [
    {
      "datatype": "anat",
      "suffix": "T1w",
      "criteria": {
        "SeriesDescription": "t1*",
        "EchoTime": 0.00236,
        "RepetitionTime": 2.3
      },
      "sidecar_changes": {
        "ProtocolName": "T1"
      }
    },
    {
      "datatype": "anat",
      "suffix": "T2w",
      "criteria": {
        "SeriesDescription": "t2*",
        "EchoTime": 0.093,
        "RepetitionTime": 9
      },
      "sidecar_changes": {
        "ProtocolName": "T2"
      }
    },
    {
      "id": "task_rest",
      "datatype": "func",
      "suffix": "bold",
      "custom_entities": "task-rest",
      "criteria": {
        "EchoTime": 0.03,
        "RepetitionTime": 2
      }
    },
    {
      "datatype": "fmap",
      "suffix": "magnitude1",
      "criteria": {
        "ProtocolName": "field_map",
        "EchoTime": 0.00492
      },
      "sidecar_changes": {
        "IntendedFor": "task_rest"
      }
    },
    {
      "datatype": "fmap",
      "suffix": "magnitude2",
      "criteria": {
        "ProtocolName": "field_map",
        "EchoTime": 0.00738,
        "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"]
      },
      "sidecar_changes": {
        "IntendedFor": "task_rest"
      }
    },
    {
      "datatype": "fmap",
      "suffix": "phasediff",
      "criteria": {
        "ProtocolName": "field_map",
        "EchoTime": 0.00738,
        "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND", "PHASE"]
      },
      "sidecar_changes": {
        "IntendedFor": "task_rest"
      }
    }
  ]
}

Hi @jj0012345 ,

Sorry for the long delay.
For your first question it seems you have the same issues as this one Can't understand what's wrong with my BIDS config file.

For the second question: you can definitively use --bids_validate but it needs bids_validator to be installed to be able to use it: GitHub - bids-standard/bids-validator: Validator for the Brain Imaging Data Structure

Hope it helps
Best,
Arnaud

Thank you for your reply!

I read that issue for the first question but wrote “the custom_entities” in my case.

I have 2 runs in func. Is the problem caused by not specifying an ID for each run in the config file?
If not, what is the problem?

@jj0012345
Hello, I came across the same problem. Have you figured it out?

Hello @yijun ,

I think this has been fixed in our dev branch of our github repo. We have still some work to do with the documentation before releasing everything but if you can give it a try a install the dev version you could check if the error still remains.

Thank you
Arnaud

Hi, @abore Would you give me a link to get the dev version? Also, I would like to ask if this error is fatal in the analysis or negligible in the analysis.

Hi @jj0012345,

You would install the master dev branch (GitHub - UNFmontreal/Dcm2Bids: Reorganising NIfTI files from dcm2niix into the Brain Imaging Data Structure).

git clone https://github.com/UNFmontreal/Dcm2Bids.git -b dev
conda create -n dcm2bids_dev pip
conda activate dcm2bids_dev
cd Dcm2Bids
pip install -e .

Best,
Steven

EDIT: edited for dev branch

Hey @jj0012345 ,

If you want to test the latest dev you would need to checkout the dev branch not the master.

Best,
Arnaud

1 Like