From aa5dfdab76326f51db963f562d091b3d2f9653fb Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Thu, 10 Dec 2020 13:21:18 -0500 Subject: [PATCH] Fix PAR/REC ADC detection (https://github.com/rordenlab/dcm2niix/issues/462) --- FILENAMING.md | 1 + console/nii_dicom.cpp | 3 ++- console/nii_dicom_batch.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/FILENAMING.md b/FILENAMING.md index 4b79224c..620f9030 100644 --- a/FILENAMING.md +++ b/FILENAMING.md @@ -49,6 +49,7 @@ In general dcm2niix creates images with 3D dimensions, or 4 dimensions when the Some post-fixes are specific to Philips DICOMs - _ADC Philips specific case. A DWI image where derived isotropic, ADC or trace volume was appended to the series. Since this image will disrupt subsequent processing, and because subsequent processing (dwidenoise, topup, eddy) will yield better derived images, dcm2niix will also create an additional image without this volume. Therefore, the _ADC file should typically be discarded. If you want dcm2niix to discard these useless derived images, use the ignore feature ('-i y'). + - _fieldmaphz unwrapped B0 field map (in Hz) generated by a Philips scanner. Suggests Image Type (0008,0008) includes the terms 'B0' and 'MAP'. - _Raw Philips XX_* DICOMs (Raw Data Storage). - _PS Philips PS_* DICOMs (Grayscale Softcopy Presentation State). diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index 0b642fbb..d85bcf9f 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -1969,7 +1969,7 @@ int kbval = 33; //V3: 27 } //diskSlice ++; bool isADC = false; - if ((maxNumberOfGradientOrients >= 2) && (cols[kbval] > 50) && isSameFloat(0.0, cols[kv1]) && isSameFloat(0.0, cols[kv2]) && isSameFloat(0.0, cols[kv2]) ) { + if ((maxNumberOfGradientOrients >= 2) && (cols[kbval] > 50) && isSameFloat(0.0, cols[kv1]) && isSameFloat(0.0, cols[kv2]) && isSameFloat(0.0, cols[kv3]) ) { isADC = true; ADCwarning = true; } @@ -2447,6 +2447,7 @@ int kbval = 33; //V3: 27 d.imageStart = 0; if (d.CSA.numDti >= kMaxDTI4D) { printError("Unable to convert DTI [increase kMaxDTI4D] found %d directions\n", d.CSA.numDti); + printMessage(" slices*grad*bval*cardiac*echo*dynamic*mix*label = %d*%d*%d*%d*%d*%d*%d*%d\n", d.xyzDim[3], maxNumberOfGradientOrients,maxNumberOfDiffusionValues, maxNumberOfCardiacPhases, maxNumberOfEchoes, maxNumberOfDynamics, maxNumberOfMixes, maxNumberOfLabels); d.CSA.numDti = 0; }; //check if dimensions vary diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 4c593e78..3e577421 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -6119,7 +6119,7 @@ bool isSameSet (struct TDICOMdata d1, struct TDICOMdata d2, struct TDCMopts* opt } if (d1.coilCrc != d2.coilCrc) { if (!warnings->coilVaries) - printMessage("Slices not stacked: coil varies\n"); + printMessage("Slices not stacked: coil varies '%s' vs '%s'\n", d1.coilName, d2.coilName); warnings->coilVaries = true; *isCoilVaries = true; return false;