Closed jhlegarreta closed 5 years ago
The short version:
In-plane Phase Encoding Direction
(0018,1312) was COLS (j) or ROWS (i). For axial scans COLS would be R<>L and ROWS would be A<>P. Note that for your sample dcm2niix is able to always determine this accurately (all your scans are A<>P). This is unsurprising, as we are able to use a known DICOM tag. However, working out the phase encoding polarity (blip up or blip down) is complicated by two factors: there is no formal DICOM tag for this, and the BIDS format simply provides a "-" modifier to report reversed blip. Therefore the BIDS tag "PhaseEncodingDirection": "j"
is used both for known polarity and when polarity is unknown. This is unfortunate, but it reflects a conscious decision of the BIDS team to keep backward compatibility. Since dcm2niix is a BIDS compliant tool, you need to lobby the BIDS team if you want to change this behavior.PhaseEncodingAxis
and PhaseEncodingPolarity
. The Axis would tell us if the axial scan had R<>L or A<>P phase encoding and could always be determined, while the Polarity would only be populated if the phase encoding polarity could be detected, and would disambiguate blip direction (blip up or blip down). However, the BIDS team discourages storing redundant data twice (avoiding name conflicts) and strives for backwards compatibility. The combination of these laudable goals means we stick with the single PhaseEncodingDirection
tag. Therefore, dcm2niix does as much as it possibly can, but in some cases the user will still need to determine phase encoding polarity."PhaseEncodingPolarityGE": "Unflipped"
or "PhaseEncodingPolarityGE": "Flipped"
. I realize this tag is against the nature of the BIDS spirit to report things only once. However, since I do not have access to GE hardware, and the detection algorithm is unable to determine this property for some systems, I think this flag helps the user realize when we think the polarity is meaningful. If you have a GE system, I would ask you to contact your vendor and lobby them to report these important sequence details in a simple method. Full details on GE DICOM conversion is here.PhaseEncodingDirection
specifies the direction in image space. This explains why a axial A->P scan from a Siemens scanner reports "PhaseEncodingDirection": "j-"
when you might expect that from a P->A scan. I STRONGLY
discourage this, but you can use the hidden dcm2niix conversion flag -y y
to flip the y-coordinate (so the raw DICOM rows will be copied) and this will necessarily flip the polarity of all image-space row metrics (bvecs, phase encoding polarity).Hi Chris. I'm confused. I thought it had been decided back here https://github.com/rordenlab/dcm2niix/issues/163#issuecomment-380887134 that PhaseEncodingDirection
should only be used if the polarity is known (which is consistent with the intention of the BIDS spec). i.e., PhaseEncodingDirection
should not be used if the polarity is NOT known. Did something change since that discussion?
@mharms yes, thanks for your correction. Recent versions of dcm2niix will use the tag PhaseEncodingAxis
instead of PhaseEncodingDirection
when the phase encoding polarity is unknown. Since I do not have access to hardware that makes the problematic images, I have little experience with these.
if any user has access to Philips hardware (or a Siemens Vida XA10), it would be great to have enhanced DICOM datasets that illustrate diffusion gradient direction and phase encoding for this equipment. There are a few DICOM images for this equipment. However, the is nothing equivalent to the Siemens (pre-XA10), GE or UIH validation DICOM datasets. These reference datasets are intentionally very small (low spatial resolution, very few volumes) that are run with every commit of dcm2niix code. Given that enhanced DICOM is very vulnerable to disruption by non-enhanced aware tools (e.g. attempts to anonymize or convert to implicit VR can corrupt these datasets), it would be really useful to have reference examples of what these images should look like.
@neurolabusc thanks for the detailed answer !
Well, I see that this is harder than I thought, and that dcm2niix
makes as best as it can to get the information as accurately as vendor's provide. I appreciate the effort.
A few comments:
For axial scans COLS would be R<>L and ROWS would be A<>P. Note that for your sample dcm2niix is able to always determine this accurately (all your scans are A<>P).
Does this mean for any A<>P
blipup/blipdowns I should see the InPlanePhaseEncodingDirectionDICOM
tag in the JSON have the ROW
value?
I'd dare to say that this is not consistent with what I see.
As for the PhaseEncodingAxis
tag, if PhaseEncodingDirection
will have the same value when the phase polarity is known or unknown, then how do I know if I need to have a look/trust the PhaseEncodingAxis
tag value to tell a P->A
from an A->P
?
Correct me if I'm wrong, but whether we have one or a thousand subjects, we'd need to open their blipup/blipdowns one by one and rely on some expert to tell whether it's an A->P
, a P->A
or neither.
Now the question I have is whether I can be confident that if a P->A
blipup/blipdown acquisition is present in the DICOM files dmc2niix
will name it as *b0*
or *B0*
. I am sorry if this has an evident answer.
As for the file naming, I appreciate the comment. If I'm not mistaken, and according to the NITRC docs, %q
is the sequence name, not the acquisition number. A random filename I got looks like this: {subject_ID}_DTI_b0_AP_SENSE_SE.nii.gz
.
As you mention, I do not think the acquisition number is meaningful to my purposes.
Finally, according to the DICOM standard, the corresponding tag for the SequenceName would be 0018,0024
(which is what I meant to have with %q
), in which case the dcm2niix
NITRC documentation would not be accurate. Please, correct me if I'm wrong.
%u
is acquisition number and %q
is sequence name ScanningSequence (0018,0020). %z
is SequenceName (0018,0024). dcm2niix simply transcribes the values rote, and you will want to work out a reliable algorithm for detecting these scans. For your sample, b0
might be sufficient, but looking at my Siemens Prisma/Trio data our DWI images are often ep_b0
, but can vary (e.g. epse2d
, ep_b5
). none
is not an option. In theory, a GE user might acquire 2D slices using spiral in and spiral out. I do think you should be able to work out a pretty straightforward algorithm for your Philips data to detect pairs of diffusion data with different directions. Likewise, other EPI scans (ASL, fMRI, resting state) will report phase encoding direction bu will not be b0, though you may want to ignore those scans.
PhaseEncodingDirection
when both direction and polarity can be determined and PhaseEncodingAxis
when the polarity is unknown. However, be aware that I do not have access to Philips or GE hardware, and people generally only share data when things go wrong. I have literally dozens of examples of Philips enhanced DICOMs that were mangled by other tools, but not a single reference set of what a pure Philips enhanced DWI scan looks like. I do my best to provide a robust tool, but my coverage is limited and this supporting this software must take a back seat to the my other responsibilities."InPlanePhaseEncodingDirectionDICOM": "COL"
and for RL you will see "InPlanePhaseEncodingDirectionDICOM": "ROW"
. Click here for examples from Siemens and Siemens/GE. Thanks for all this supplementary explanations @neurolabusc . I appreciate the time you've taken to answer.
I see that the question is nontrivial and it requires lots of experience. I'll let you know if I come to some meaningful conclusion or if I can somehow improve dcm2niix
.
In the meantime, I'm closing the issue then.
Description
Although the filenames produced by
dcm2niix
to transform DWI DICOM files into NIfTI files identifies files and labels them as being reverse B0 (i.e. PA) files, it seems not to be in agreement when visually inspecting the volumes.Also, the
PhaseEncodingDirection
tag value in the JSON file created by dcm2niix for the reverse B0 files (whether they contain the direction label in the filename or not), seems not be consistent across studiesScanner manufacturer and model
Scanner manufacturer and model as written in the
JSON
file tagsManufacturer
andManufacturersModelName
produced bydcm2niix
, forward/reverse B0 filename relevant part generated bydcm2niix
,PhaseEncodingDirection
tag value in the correspondingJSON
files and AP/PA presence by visual inspection:dmc2niix and OS version
dcm2niiX version v1.0.20181125 GCC5.4.0 (64-bit Linux)
Command used when doing the DICOM to NIfTI conversion
dcm2niix -o $study_nifti_out_path -f %i_%p_%q $study_dicom_path
executed inside a loop over all the DICOM folders, and where
$study_nifti_out_path
is my output path for thedcm2niix
generated NIfTI files for each study, and$study_dicom_path
is the path of each DICOM folder where the original data files live.