From 5bff3c91adf74829b729d0db38b005b8f1dc07de Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 14 Aug 2024 09:54:17 -0400 Subject: [PATCH] Only append PHASE, REAL, etc to ImageType if term or alias not already present (https://github.com/rordenlab/dcm2niix/issues/851) --- console/nii_dicom_batch.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 539b0e19..fcf22971 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1431,15 +1431,15 @@ tse3d: T2*/ } else isSep = true; } - if ((d.isHasMagnitude) && ((d.manufacturer == kMANUFACTURER_GE) || ( (strstr(d.imageType, "_M_") == NULL) && (strstr(d.imageType, "_MAGNITUDE_") == NULL)))) + if ((d.isHasMagnitude) && ((strstr(d.imageType, "_M_") == NULL) && (strstr(d.imageType, "_MAGNITUDE_") == NULL))) fprintf(fp, "\", \"MAGNITUDE"); - if ((d.isHasPhase) && ((d.manufacturer == kMANUFACTURER_GE) || (strstr(d.imageType, "_PHASE_") == NULL))) - fprintf(fp, "\", \"PHASE"); //"_IMAGINARY_" - if ((d.isHasReal) && ((d.manufacturer == kMANUFACTURER_GE) || (strstr(d.imageType, "_REAL_") == NULL))) + if ((d.isHasPhase) && ((strstr(d.imageType, "_P_") == NULL) && (strstr(d.imageType, "_PHASE_") == NULL))) + fprintf(fp, "\", \"PHASE"); + if ((d.isHasReal) && ((strstr(d.imageType, "_R_") == NULL) && (strstr(d.imageType, "_REAL_") == NULL))) fprintf(fp, "\", \"REAL"); - if ((d.isHasImaginary) && ((d.manufacturer == kMANUFACTURER_GE) || (strstr(d.imageType, "_IMAGINARY_") == NULL))) + if ((d.isHasImaginary) && ((strstr(d.imageType, "_I_") == NULL) && (strstr(d.imageType, "_IMAGINARY_") == NULL))) fprintf(fp, "\", \"IMAGINARY"); - if ((d.isRealIsPhaseMapHz)) // && ((d.manufacturer == kMANUFACTURER_GE) || (strstr(d.imageType, "_IMAGINARY_") == NULL)) ) + if ((d.isRealIsPhaseMapHz) && ((strstr(d.imageType, "_FIELDMAPHZ_") == NULL))) fprintf(fp, "\", \"FIELDMAPHZ"); fprintf(fp, "\"],\n"); }