Add DICOMExporter and use it to save images.

This commit is contained in:
kradchen
2023-08-01 15:59:47 +08:00
parent e1b732d4cc
commit 7ff7f20cae
3 changed files with 288 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
#include "MatlabWriter.h"
#include "config/config.h"
#include "log/log.h"
#include "common/DICOMExporter.h"
#include "common/getMeasurementMetaData.h"
#include "common/getGeometryInfo.h"
#include "common/estimatePulseLength.h"
@@ -34,6 +35,8 @@ void Recon::startReconstructions(const std::string& aDataPath, const std::string
MatlabWriter writer(aOutputPath);
Parser dataParser(aDataPath);
Parser refParser(aDataRefPath);
Recon::DICOMExporter exporter(dataParser.getPatientData());
exporter.setExportBasePath(aOutputPath);
if(!dataParser.getShotList()->isValid())
{
RECON_INFO("data path is invalid.");
@@ -219,8 +222,10 @@ void Recon::startReconstructions(const std::string& aDataPath, const std::string
transmissionResult = startTransmissionReconstruction(mp_inter, mpRef_inter, slList_inter, snList_inter, rlList_inter, rnList_inter, temp, tempRef, geom, geomRef, expInfo, expInfoRef, preComputes, &dataParser, &refParser);
attAvailable = true;
sosAvailable = true;
writer.setMatrix(transmissionResult.recoSOS, "sos");
writer.setMatrix(transmissionResult.recoATT, "att");
exporter.exportDICOM(transmissionResult.recoSOS, DICOMExporter::SOS);
exporter.exportDICOM(transmissionResult.recoATT, DICOMExporter::ATT);
// writer.setMatrix(transmissionResult.recoSOS, "sos");
// writer.setMatrix(transmissionResult.recoATT, "att");
}
if(reflectParams::runReflectionReco)
@@ -245,8 +250,9 @@ void Recon::startReconstructions(const std::string& aDataPath, const std::string
reflectParams::gpuSelectionList = reconParams::gpuSelectionList;
RECON_INFO("Start reflectionRecostruction.");
Matrix env = startReflectionReconstruction(&dataParser, preProcessData.saftMode, mp_inter, slList_inter, snList_inter, rlList_inter, rnList_inter, geom, preProcessData.transRecos, expInfo, preComputes);
writer.setMatrix(env, "reflect");
// writer.setMatrix(env, "reflect");
exporter.exportDICOM(env, Recon::DICOMExporter::REFL);
}
writer.write();
// writer.write();
}