Donders-Institute / bidscoin

BIDScoin converts your source-level neuroimaging data to BIDS
https://bidscoin.readthedocs.io
GNU General Public License v3.0
130 stars 35 forks source link

Using `PhaseEncodingDirection` field to distinguish sequences #212

Closed djoerch closed 9 months ago

djoerch commented 11 months ago

Is your feature request related to a problem? Please describe. In my data, the dwi sequence and the reversed-phase sequence have the same name and get mapped to the same sequence sample in the bidseditor. It would be helpful if the field PhaseEncodingDirection could be used in the template to detect them as two distinct sequences. But when I add PhaseEncodingDirection to the DICOM attributes in the bidsmap template, they remain empty in the editor.

Describe the solution you'd like I believe this is related to #201, but not sure if I overlooked an option for doing what I want. Is it possible to use the field PhaseEncodingDirection to distinguish sequences at all?

marcelzwiers commented 11 months ago

The reason is that PhaseEncodingDirection is not a DICOM tag, but something that dcm2niix produces. As far as I know, there is nothing in the DICOM header that can be used directly, so the best one can do is to use a different protocol name when scanning the inverted read-out scan

marcelzwiers commented 11 months ago

Perhaps, if the dcm2niix PhaseEncodingDirection logic is not too complicated I could implement it in dcm2niix2bids. It would be great if @neurolabusc could give some guidance here :-)

neurolabusc commented 11 months ago

For Siemens, you read the CSA header. For GE, modrn releases use Rectilinear Phase Encode Reordering (0018,9034). You can find concrete validation datasets for both manufacturers, see dcm_qa_nih. The phase encoding polarity is not recorded in the DICOM images created by Philips.

marcelzwiers commented 11 months ago

Thanks, that's helpful. So CSA it is, what do you say, any chance of finding this info in (future) Siemens XA headers?

neurolabusc commented 11 months ago

@marcelzwiers you can find Siemens XA30 enhanced as well as classic interoperability validation datasets. For XA you can read Phase EncodingDirection directly from the private tag 0021,111C or parse the CSA header (0021,1019). Beware, as this dataset demonstrates, that the a Siemens XA scanner can export the same scan with different tags depending on whether the enhanced or classic output is selected (e.g. ImageType vs ImageTypeText).

marcelzwiers commented 9 months ago

Should work now with commit e85d1f3cce70af1e3c661431434413713e519f3f