Issue dcm2bids in T2star config file

Hi there,

I have an issue doing the pairing of my config. file with the data. I need to filter by real and imaginary and full resolution, half res, qr t2star files as well as echoes, but i don’t know how to filter like that and I’m doing this, but it says not pairing with the data:

{
	    "datatype": "t2star",
	    "suffix": "T2starw",
	    "custom_entities": "H",
	    "criteria": {
		"SeriesDescription": "T2S AIR SG H"
	    }

Do you know a way to filter it with different parameters or that at least recognize the code that I already did?

Thank you so much!!

Hi @dbg0899 and welcome to neurostars!

I see some issues here. In general, you should read the dcm2bids documentation (First steps - dcm2bids documentation) and BIDS specification (Magnetic Resonance Imaging - Brain Imaging Data Structure v1.9.0), which will help you understand your problems.

This should be "datatype": "anat"

The entries for custom_entities have to be BIDS valid label-value pairs (e.g., dir-PA). You did not specify what version you are using, but please confirm you are using version 3.1.X since you are using custom_entities.

You can use any field in the JSON for your criteria (and multiple, if needed). SeriesDescription is usually a good one to go with though.

Each one should have a different JSON. So each one can get it’s own item in the config. You would put in the extra BIDS labels as custom_entities.

Can you share a JSON of the file you are trying to associate with, as output by dcm2niix?

Best,
Steven

Thank you so much for your prompt answer and explanation!

{
	"SeriesDescription": "T2S AIR SG H",
	"ProtocolName": "T2S AIR SG H",
	"ImageType": ["ORIGINAL", "PRIMARY", "M", "FFE", "M", "FFE"], 
	"EchoNumber": 6,
	"EchoTime": 0.031001,
}
{
	"SeriesDescription": "T2S AIR SG H",
	"ProtocolName": "T2S AIR SG H",
	"ImageType": ["ORIGINAL", "PRIMARY", "I", "FFE", "I", "FFE", "IMAGINARY"],
	"EchoNumber": 6,
	"EchoTime": 0.031001,
}
{
	"SeriesDescription": "T2S AIR SG H",
	"ProtocolName": "T2S AIR SG H",
	"ImageType": ["ORIGINAL", "PRIMARY", "R", "FFE", "R", "FFE", "REAL"],
	"EchoNumber": 6,
	"EchoTime": 0.031001,
}

Basically I have for each paragraph (magnitud, real and imaginary) a JSON File (I just merged those for a complete understanding) and I have 12 echoes for each paragraph (I only chose echo N° 6 for practice example). In this example, H means half resolution, but I also have Full resol and Qresol, so, it be same structure of the JSON but for full and Qresol.

I hope you can understand! Sounds a little bit confused, but I could explain better if you prefer.

Hi @dbg0899

Based on this, it looks like using a combination of SeriesDescription and ImageType will allow you to differentiate between images.

Best,
Steven

Yes, but do I have to do it for every JSON file? Or can I get a list for echoes and for F H and Q? That’s why I’m confused…

Because I would need to name them with echo-, not with the default from dcm2bids which is run-.

Thank you very much!

Yes, one should be for each json, each with a different echo-<> in the custom-entities field

Dear Daniela,

You don’t need to write a description per echo, you only need to add this line in each description (half resolution, Full resol, Qresol):

“custom_entities”: [“echo”, “acq-halfres”]

It will automatically extract echo number in the filename (and put acq-halfres if this is the kind of label you want to put to distinguish between your acquisitions).

Best,
Arnaud

1 Like

Ah I stand corrected, thanks @abore!

Hi! I’m trying to do that but it seems it doesn’t recognize “echo”, just the acq-fullres… do i have to specify the EchoNumber ?

Thank you so much!!

Oups I forgot to tell you when you run the command line dcm2bids to add this parameter:

–auto_extract_entities

If it still doesn’t work check in your json file if you see the tag EchoNumber.
Depending on your responses I’ll be able to help you if needed.

Best,
Arnaud

Thank you so much!

I have an urgent question regarding config file. How can I rename the file names correctly, such that dcm2bids doesn’t rename for itself… Because I need to have a specific file name but it renames once I run the dcm2bids.

Thank you so much!

Hi @dbg0899.

In that case you would remove the auto extract argument and specify all of the custom_entities explicitly. But keep in mind the you’re not going to be able to specify a name that is not BIDS valid.

Best,
Steven

I already remove auto_extract, and set the file name like this: sub_#echo-01_task-AIR_acq-EPI, but i got: sub#_task-AIR_acq-EPI_echo-01

Is there a way to place in the order that i want the filenames? Thanks a lot!

No, the order is set by the BIDS specification. If you change it, BIDS apps will may not work as intended, and you may struggle to share data on sites such as OpenNeuro.org.