Closed mr-jaemin closed 1 year ago
@mr-jaemin thanks. Please test latest commit to development branch and close if this resolves your issue.
@neurolabusc Thanks Chris! The commit implemented the precedence correctly. But, I realized that the original code implementation with the public tag Rectilinear Phase Encode tag
(0018, 9034) was swapped:
LINEAR
corresponds to PhaseEncodingPolarityGE
= "Flipped"
REVERSE_LINEAR
corresponds to PhaseEncodingPolarityGE
= "Unflipped"
as shown below:
The code should be swapped as follows:
if (toupper(buffer[lPos]) == 'L')
d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_FLIPPED;
if (toupper(buffer[lPos]) == 'R')
d.phaseEncodingGE = kGE_PHASE_ENCODING_POLARITY_UNFLIPPED;
break;
We didn't realize this swap bug because the private tag previously overrides the public tag in a correct way until this commit.
@mr-jaemin the current behavior seems consistent with both dcm2niix and dicm2nii for both GE and Siemens. For example, see this Siemens data dcm_qa_xa30. This usage has a long history, the main issue is to ensure that two scans with opposite polarity are given opposite signs.
Series 10 "SeriesDescription": "DWI_dir80_PA", "PhaseEncodingDirection": "j",
Series 17 "SeriesDescription": "DWI_dir80_AP", "PhaseEncodingDirection": "j-",
Please let me find the GE in-vivo datasets, demonstrating the behavior very soon.
-Prior to 27 version (like DV26), dcm2niix would be still accurate -But, 27+ version dataset with the public tag, after the above commit, the behavior has changed now (wrong).
Here are the visual demonstration using DV26 and RX29 datasets with two dcm2niix versions (v1.0.20230201 and v1.0.20220915):
dMRI_PA:
"SoftwareVersions": "29\LX\RX29.1_R01_2111.a", with the public tag
(0018,9034) CS [LINEAR]
"ConversionSoftwareVersion": "v1.0.20230201", "PhaseEncodingDirection": "j-" (wrong)
"ConversionSoftwareVersion": "v1.0.20220915", "PhaseEncodingDirection": "j", (correct)
dMRI_AP:
"SoftwareVersions": "29\LX\RX29.1_R01_2111.a", with the public tag
(0018,9034) CS [REVERSE_LINEAR]
"ConversionSoftwareVersion": "v1.0.20230201", "PhaseEncodingDirection": "j" (wrong)
"ConversionSoftwareVersion": "v1.0.20220915", "PhaseEncodingDirection": "j-", (correct)
dMRI_PA "SoftwareVersions": "27\LX\MR Software release:DV26.0_R06_2132.a", without the public tag "ConversionSoftwareVersion": "v1.0.20230201", "PhaseEncodingDirection": "j" (correct) "ConversionSoftwareVersion": "v1.0.20220915", "PhaseEncodingDirection": "j", (correct)
dMRI_AP "SoftwareVersions": "27\LX\MR Software release:DV26.0_R06_2132.a", without the public tag "ConversionSoftwareVersion": "v1.0.20230201", "PhaseEncodingDirection": "j-" (correct) "ConversionSoftwareVersion": "v1.0.20220915", "PhaseEncodingDirection": "j-", (correct)
@mr-jaemin the current behavior seems consistent with both dcm2niix and dicm2nii for both GE and Siemens.
@neurolabusc Could you please confirm that your GE dataset was with version 26 or older? In other word, the Rectilinear Phase Encode
tag (0018, 9034) doesn't exist. If so, this makes sense.
@mr-jaemin : I find it interesting that your first set of images for "dMRI_PA" show a region of pronounced frontal compression in the sagittal view. That's not what I'd expect for a "PA" polarity scan.
Also, I'm curious if you know if Linear
and Reverse_Linear
in (0018,9034) are actually defined by the DICOM standard? i.e., as a practical matter, can one vendor's coordinate system be such that Linear
for them is Reverse_Linear
for another?
@mharms Agreed that images look different. A pair of images with opposite phase encoding polarity (AP/PA or pepolar=0,1 for GE) were collected on the same subject within a single exam. For this thread, let's keep it simple.
Regarding the (0018, 9034), that's a good question. I can find this:
Rectilinear phase encode reordering. Defined Terms: LINEAR CENTRIC SEGMENTED REVERSE_LINEAR REVERSE_CENTRIC
I can't comment on the DICOM standard or other vendors. However, for GE systems, this tag is well-defined with the CV pepolar
in diffusion EPI only since 27 version or later such that:
peopolar = 0 --> LINEAR
peopolar = 1 --> REVERSE_LINEAR
as summarized in the above slide.
Also, in dcm2niix, the tag is currently utilized for GE only as shown in the above code.
I wanted to add additional images (clinical DWI images, not DTI) with typical PA/AP distortion:
40005_ORIG_Ax_DWI_fwd_hi_res (PA) (0018,9034) CS [LINEAR]
40006_ORIG_Ax_DWI_rev_hi_res (AP) (0018,9034) CS [REVERSE_LINEAR]
The latest commit/merge resolved the fix. I have confirmed the following GE phase encoding polarity testing datasets:
"ConversionSoftwareVersion": "v1.0.20230201"
dcm2niix detect
PhaseEncodingPolarityGE
correctly either readingRectilinear Phase Encode
tag (0018, 9034) (27+ versions) or decoding the private UserDefineDataGE (0043,102A) here. Sample DICOM datasets & details are documented here. However, I found an exception. dcm2niix reportsPhaseEncodingPolarityGE
incorrect with theREV_POL
series from GE diffusionDistortion Correction (PROGRES)
feature.GE PROGRES collects two sets of spin-echo images with opposite phase-encoding polarity. While the
REV_POL
(reverse polarity) images is internally collected & utilized for distortion correction, DICOM will not be generated by default. With CVrhdistcorr_ctrl +=16
change, including ABCD study, thisREV_POL
images will be saved as a separate series.Despite of the correctly reported
Rectilinear Phase Encode
tag (0018, 9034) in theREV_POL
, dcm2niix currently reportsPhaseEncodingPolarityGE
andPhaseEncodingDirection
incorrectly including the development version (v1.0.20230127). I suspect this public tag information was overridden by the private tag (0043,102A). I would suggest that precedence should be given toRectilinear Phase Encode
tag (0018, 9034)Sample dataset consists of 3 series from a single DTI scan with PROGRES: 05_DTI (Distortion Corrected) 510_ORIGDTI (UnCorrected Forward polarity) 511_REV_POLDTI (UnCorrected Reverse polarity)
511_REV_POL__DTI reports
But, dcm2niix reports incorrectly:
Both 510_ORIG_DTI and 05_DTI reports correctly