Dcm2bids splitting one scan into 3 runs

I’m converting a resting state scan to BIDS format using dcm2bids. It is a single ~9min acquisition but dcm2bids is converting it into 3 seperate runs. I think that these 3 seperate .nii files reflect the 3 echo times in this aquisition, but they are being mislabeled as runs. Has anyone else had this issue?

Thank you!

Hi @anne.a,

If that is the case you can set up your config to add the echo-<> custom entity. Each echo file will need its own config item.

Best,
Steven

Hi @anne.a ,

Check in the dcm2bids documentation, there is a way to extract them automatically with the echo number without duplicating the info in the config file for each echo.

You would use this in your config file.

“custom_entities”: [“echo”]

Auto extract entities: Use advanced commands - dcm2bids documentation

Hope it helps
Arnaud

1 Like

@abore Thank you, this worked! My three different echos in the resting state scan are now labelled as echos instead of runs.

One final question (I hope). Now that I am using --auto extract entities my resting state scans are labelled as: sub-CPP00031A_ses-1_task-rest2_echo-1_bold. Any idea why the “2” is being added to task-rest? There is no other BOLD scan, and I did not change anything else in the config file so I`m unclear on why this changed.
If these scans are called task-rest2 should I change the fmap “sidecar_changes”: {“IntendedFor”: “task-rest”} to say task-rest2?

In case that it is helpful for anyone in the future the command I ran:

dcm2bids -d /home/administrator/dcm2bids-cpp/sourcedata/CPPID/ -p CPP00033A -s 1 -c /home/administrator/dcm2bids-cpp/code/dcm2bids_config.json -o /home/administrator/dcm2bids-cpp/BIDSified/ --auto_extract_entities

The configuration file I used:

{
“post_op”: [
{
“cmd”: “pydeface --outfile dst_file src_file”,
“datatype”: “anat”,
“suffix”: [
“T1w”,
“FLAIR”
]
}
],
“descriptions”: [
{
“datatype”: “anat”,
“suffix”: “T1w”,
“criteria”: {
“SeriesDescription”: “T1w_cor-mprage*”
}
},
{
“datatype”: “anat”,
“suffix”: “FLAIR”,
“criteria”: {
“SeriesDescription”: “FLAIR
}
},
{
“id”: “dwi”,
“datatype”: “dwi”,
“suffix”: “dwi”,
“custom_entities”: “dir-AP”,
“criteria”: {
“SeriesDescription”: “dwi_dir-AP-sms3*”
}
},
{
“datatype”: “dwi”,
“suffix”: “dwi”,
“custom_entities”: “dir-B0PA”,
“criteria”: {
“SeriesDescription”: “dwi_dir-B0PA*”
},
“sidecar_changes”: {
“IntendedFor”: “dwi”
}
},
{
“id”: “task-rest”,
“datatype”: “func”,
“suffix”: “bold”,
“custom_entities”: “echo”,
“criteria”: {
“SeriesDescription”: “func-bold_task*”
},
“sidecar_changes”: {
“TaskName”: “rest”
}
},
{
“datatype”: “fmap”,
“suffix”: “epi”,
“criteria”: {
“SeriesDescription”: “fmap-epi_acq-se_dir-AP_CMRRC2P*”
},
“sidecar_changes”: {
“IntendedFor”: “task-rest”
}
},
{
“datatype”: “fmap”,
“suffix”: “epi”,
“criteria”: {
“SeriesDescription”: “fmap-epi_acq-se_dir-PA_CMRRC2P*”
},
“sidecar_changes”: {
“IntendedFor”: “task-rest”
}
},
{
“id”: “asl”,
“datatype”: “perf”,
“suffix”: “asl”,
“criteria”: {
“SeriesDescription”: “ASL-pcasl-low”
},
“sidecar_changes”: {
“BackgroundSuppression”:false,
“M0Type”:“Separate”
}
},
{
“datatype”: “perf”,
“suffix”: “m0scan”,
“criteria”: {
“SeriesDescription”: “ASL-pcasl-low_M0*”
},
“sidecar_changes”: {
“IntendedFor”: “asl”
}
}
]
}

Hello @anne.a,

The option auto_extract_entities is extracting the task name from your SerieDescription if you want to overwrite this you need to add “task-rest” in the custom entities.

Hope it helps

Best,
Arnaud