diff --git a/console/nii_dicom.cpp b/console/nii_dicom.cpp index e627ee2a..4b658766 100644 --- a/console/nii_dicom.cpp +++ b/console/nii_dicom.cpp @@ -4348,7 +4348,7 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D #define kImplementationVersionName 0x0002 + (0x0013 << 16) #define kSourceApplicationEntityTitle 0x0002 + (0x0016 << 16) #define kDirectoryRecordSequence 0x0004 + (0x1220 << 16) -// #define kSpecificCharacterSet 0x0008+(0x0005 << 16 ) //someday we should handle foreign characters... +//#define kSpecificCharacterSet 0x0008+(0x0005 << 16 ) //someday we should handle foreign characters... #define kImageTypeTag 0x0008 + (0x0008 << 16) #define kSOPInstanceUID 0x0008 + (0x0018 << 16) // Philips inserts time as last item, e.g. ?.?.?.YYYYMMDDHHmmSS.SSSS // not reliable https://neurostars.org/t/heudiconv-no-extraction-of-slice-timing-data-based-on-philips-dicoms/2201/21 @@ -5436,6 +5436,14 @@ struct TDICOMdata readDICOMx(char *fname, struct TDCMprefs *prefs, struct TDTI4D d.isSegamiOasis = true; break; } + /* case kSpecificCharacterSet : { + char charTxt[kDICOMStr]; + dcmStr(lLength, &buffer[lPos], charTxt); + //issue878 dcm_qa_uih is ISO_IR 192 aka UTF-8 ! + if (strcmp(charTxt, "ISO_IR 100") != 0) { + printWarning("Issue878: Specific Character Set (0008,0005) is not ISO-IR 100. Non-latin characters may be mangled.\n"); + } + } */ case kDirectoryRecordSequence: { d.isRawDataStorage = true; break; diff --git a/console/nii_dicom.h b/console/nii_dicom.h index 08657a95..fa8ce8b4 100644 --- a/console/nii_dicom.h +++ b/console/nii_dicom.h @@ -50,7 +50,7 @@ extern "C" { #define kCPUsuf " " // unknown CPU #endif -#define kDCMdate "v1.0.20241022" +#define kDCMdate "v1.0.20241024" #define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf static const int kMaxEPI3D = 1024; // maximum number of EPI images in Siemens Mosaic diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 6be40c84..2aec8038 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -1452,15 +1452,18 @@ tse3d: T2*/ } else isSep = true; } - if ((d.isHasMagnitude) && ((strstr(d.imageType, "_M_") == NULL) && (strstr(d.imageType, "_MAGNITUDE_") == NULL))) + //issue881 Philips enhanced includes magnitude and Hz images into one file + bool isHz = d.isHasReal && d.isRealIsPhaseMapHz; + //n.b. issue881 alias `M` does not prevent appending `MAGNITUDE` + if ((!isHz) && (d.isHasMagnitude) && (strstr(d.imageType, "_MAGNITUDE_") == NULL)) fprintf(fp, "\", \"MAGNITUDE"); - if ((d.isHasPhase) && ((strstr(d.imageType, "_P_") == NULL) && (strstr(d.imageType, "_PHASE_") == NULL))) + if ((!isHz) && (d.isHasPhase) && (strstr(d.imageType, "_PHASE_") == NULL)) fprintf(fp, "\", \"PHASE"); - if ((d.isHasReal) && ((strstr(d.imageType, "_R_") == NULL) && (strstr(d.imageType, "_REAL_") == NULL))) + if ((!isHz) && (d.isHasReal) && (strstr(d.imageType, "_REAL_") == NULL)) fprintf(fp, "\", \"REAL"); - if ((d.isHasImaginary) && ((strstr(d.imageType, "_I_") == NULL) && (strstr(d.imageType, "_IMAGINARY_") == NULL))) + if ((!isHz) && (d.isHasImaginary) && (strstr(d.imageType, "_IMAGINARY_") == NULL)) fprintf(fp, "\", \"IMAGINARY"); - if ((d.isRealIsPhaseMapHz) && ((strstr(d.imageType, "_FIELDMAPHZ_") == NULL))) + if ((isHz) && ((strstr(d.imageType, "_FIELDMAPHZ_") == NULL))) fprintf(fp, "\", \"FIELDMAPHZ"); fprintf(fp, "\"],\n"); }