From 160aaa2213e7e7814c499cdb913ea73e0363e46a Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 20 Jul 2022 07:32:20 -0400 Subject: [PATCH] Issue 618 (https://github.com/rordenlab/dcm2niix/issues/618) --- BIDS/README.md | 15 +++++++++------ Siemens/README.md | 2 +- console/nii_dicom_batch.cpp | 7 +++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/BIDS/README.md b/BIDS/README.md index eba4b81a..d018fa5d 100644 --- a/BIDS/README.md +++ b/BIDS/README.md @@ -35,6 +35,7 @@ The Defined By column uses: The Unit column uses: +- b : boolean - deg : degrees - f : fraction - kg : Kilogram @@ -316,17 +317,19 @@ Fields specific to Siemens V*-series (e.g. VB, VE) MRI systems (e.g. Verio, Trio | DwellTime | | DICOM tag 0019,1018 | B | | BandwidthPerPixelPhaseEncode | Hz | DICOM tag 0019,1028 | D | | ImageOrientationText | | DICOM tag 0051,100E | D | +| NonlinearGradientCorrection | b | DICOM tag 0008,0008 | B | ### Manufacturer Siemens Magnetic Resonance Imaging (XA) Fields specific to Siemens XA-series MRI systems (Sola, Vida). -| Field | Unit | Comments | Defined By | -|------------------------------|------|---------------------|------------| -| ReceiveCoilActiveElements | | DICOM tag 0021,114F | B | -| BandwidthPerPixelPhaseEncode | Hz | DICOM tag 0021,1153 | D | -| ScanningSequence | | DICOM tag 0021,105a | D | -| PostLabelDelay | s | DICOM tag 0018,9258 | D | +| Field | Unit | Comments | Defined By | +|------------------------------|------|------------------------|------------| +| ReceiveCoilActiveElements | | DICOM tag 0021,114F | B | +| BandwidthPerPixelPhaseEncode | Hz | DICOM tag 0021,1153 | D | +| ScanningSequence | | DICOM tag 0021,105a | D | +| PostLabelDelay | s | DICOM tag 0018,9258 | D | +| NonlinearGradientCorrection | b | 0008,0008 or 0021,1175 | B | ### Manufacturer UIH diff --git a/Siemens/README.md b/Siemens/README.md index 0ad9a333..d387031e 100644 --- a/Siemens/README.md +++ b/Siemens/README.md @@ -82,7 +82,7 @@ The Siemens CSA header also stores some ASL details as a base64 stream. These ca ## Nonlinear Gradient Correction -dcm2niix does not populate the recommended [NonlinearGradientCorrection](https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#sequence-specifics) BIDS tag. dcm2niix does save the DICOM [Image Type (0008,0008)](https://dicom.innolitics.com/ciods/rt-dose/general-image/00080008) tag as `ImageType`, and recent versions will also export a private tag (0021,1175) as `ImageTypeText`. The inclusion of `DIS2D` or `DIS3D` in these one of these fields (the former prior to XA30, the latter with XA30 and later) is consistent with `NonlinearGradientCorrection` being `True`. See [issue 597](https://github.com/rordenlab/dcm2niix/issues/597) for further details. +dcm2niix does not populate the recommended [NonlinearGradientCorrection](https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#sequence-specifics) BIDS tag. dcm2niix does save the DICOM [Image Type (0008,0008)](https://dicom.innolitics.com/ciods/rt-dose/general-image/00080008) tag as `ImageType`, and recent versions will also export a private tag (0021,1175) as `ImageTypeText`. The inclusion of `DIS2D` or `DIS3D` in these one of these fields (the former prior to XA30, the latter with XA30 and later) is consistent with `NonlinearGradientCorrection` being `true` while `ND` suggests `false`. See [issue 597](https://github.com/rordenlab/dcm2niix/issues/597) for further details. ## Sample Datasets diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index f8dadbbd..83af5878 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1326,6 +1326,13 @@ tse3d: T2*/ } fprintf(fp, "\"],\n"); } + if ((strstr(d.imageTypeText, "_DIS2D") != NULL) || (strstr(d.imageType, "_DIS2D") != NULL) || + (strstr(d.imageTypeText, "_DIS3D") != NULL) || (strstr(d.imageType, "_DIS3D") != NULL)) + fprintf(fp, "\t\"NonlinearGradientCorrection\": true,\n"); + if ((strstr(d.imageTypeText, "_ND") != NULL) || (strstr(d.imageType, "_ND") != NULL) || + (strstr(d.imageTypeText, "_ND") != NULL) || (strstr(d.imageType, "_ND") != NULL)) + fprintf(fp, "\t\"NonlinearGradientCorrection\": false,\n"); + if (d.isDerived) //DICOM is derived image or non-spatial file (sounds, etc) fprintf(fp, "\t\"RawImage\": false,\n"); if (d.seriesNum > 0)