From af865bb815cc523dcb56bd9de4adfcb688e0243d Mon Sep 17 00:00:00 2001 From: kradchen Date: Thu, 26 Sep 2024 14:11:24 +0800 Subject: [PATCH] feat: load DICOM modality from config.bin --- src/common/DICOMExporter.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/DICOMExporter.cpp b/src/common/DICOMExporter.cpp index 42b3afa..cde631d 100644 --- a/src/common/DICOMExporter.cpp +++ b/src/common/DICOMExporter.cpp @@ -26,7 +26,6 @@ namespace { UID_CTImageStorage); aDataset->putAndInsertString(DCM_SOPClassUID, UID_CTImageStorage); - aDataset->putAndInsertString(DCM_Modality, "CT"); aDataset->putAndInsertString(DCM_TransferSyntaxUID, UID_LittleEndianImplicitTransferSyntax); aDataset->putAndInsertString(DCM_ImageType, "ORIGINAL\\PRIMARY"); @@ -94,6 +93,7 @@ namespace Recon mStudyInstanceUID = aPatientData.getStudyUID(); } std::string measurementID = aMetaData.getMeasurementID(); + unsigned long dateIndex = measurementID.find('_'); unsigned long timeIndex = measurementID.find('T'); OFDateTime currentDateTime; @@ -178,12 +178,15 @@ namespace Recon ::initialSeriesTime(dataset, mStudyTime); + dataset->putAndInsertString(DCM_Modality, mPatientData.getModality().empty()? + "CT":mPatientData.getModality().data()); + dataset->putAndInsertString(DCM_InstitutionName, mPatientData.getInstituationName().empty()? - "InstName":mPatientData.getInstituationName().data()); + "":mPatientData.getInstituationName().data()); dataset->putAndInsertString(DCM_InstitutionAddress, mPatientData.getInstituationAddress().empty()? - "default addr":mPatientData.getInstituationAddress().data()); + "":mPatientData.getInstituationAddress().data()); dataset->putAndInsertString(DCM_ReferringPhysicianName,mPatientData.getReferringPhysicianName().empty()? - "ReferringPhysician": mPatientData.getOperatorName().data()); + "": mPatientData.getReferringPhysicianName().data()); dataset->putAndInsertString(DCM_PatientName, mPatientData.getPatientName().empty()? "TestPatient":mPatientData.getPatientName().data()); dataset->putAndInsertString(DCM_PatientSex, mPatientData.getPatientSex().data());