First update.

This commit is contained in:
sunwen
2023-10-09 09:29:21 +08:00
parent a434c105c0
commit 903ac2c087
56 changed files with 1044 additions and 1021 deletions

View File

@@ -83,7 +83,7 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
}
//getMeasurementMetaData
double maxNumTAS = max(auroraUnion(slList, rlList)).getData()[0];
float maxNumTAS = max(auroraUnion(slList, rlList)).getData()[0];
MeasurementInfo expInfo = loadMeasurementInfos(&dataParser);
TempInfo temp = getTemperatureInfo(&dataParser, maxNumTAS);
CEInfo ce = getCEInfo(&dataParser, expInfo);
@@ -107,7 +107,7 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
motorPosAvailableRef = transformationInfo.motorPos;
if(transformationMatricesRef.isNull())
{
Matrix motorPos1 = Matrix::fromRawData(new double[1] {1}, 1);
Matrix motorPos1 = Matrix::fromRawData(new float[1] {1}, 1);
transformationMatricesRef = getTransformationMatrix(&refParser, motorPos1).rotationMatrix;
}
else
@@ -159,7 +159,7 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
Recon::notifyProgress(3);
if(expInfo.sampleRate != reflectParams::aScanReconstructionFrequency)
{
reflectParams::expectedAScanDataLength = ceil(expInfo.numberSamples * ((double)reflectParams::aScanReconstructionFrequency / expInfo.sampleRate));
reflectParams::expectedAScanDataLength = ceil(expInfo.numberSamples * ((float)reflectParams::aScanReconstructionFrequency / expInfo.sampleRate));
}
Recon::notifyProgress(4);
TransmissionReconstructionResult transmissionResult;
@@ -175,7 +175,7 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
{
preComputes.matchedFilterRef = createMatchedFilter(ceRef.ceRef, ceRef.measuredCEUsed, reflectParams::findDefects, reconParams::removeOutliersFromCEMeasured, expInfo.Hardware);
}
preComputes.timeInterval = (double)1 / reflectParams::aScanReconstructionFrequency;
preComputes.timeInterval = (float)1 / reflectParams::aScanReconstructionFrequency;
preComputes.measuredCEUsed = ce.measuredCEUsed;
preComputes.measuredCE_TASIndices = ce.tasIndices;
preComputes.measuredCE_receiverIndices = ce.receiverIndices;
@@ -205,7 +205,7 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
transParams::pulseLengthRefSamples = estimatePulseLength(ceEstimatePulseLengthRef, reflectParams::aScanReconstructionFrequency);
Matrix iMp;
Matrix mp_inter = intersect(motorPosAvailable, transParams::motorPos, iMp);
double* mpRef_interData = Aurora::malloc(iMp.getDataSize());
float* mpRef_interData = Aurora::malloc(iMp.getDataSize());
for(int i=0; i<iMp.getDataSize(); ++i)
{
mpRef_interData[i] = motorPosAvailableRef[iMp[i] - 1];
@@ -224,10 +224,10 @@ int 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;
exporter.exportDICOM(transmissionResult.recoSOS, DICOMExporter::SOS);
exporter.exportDICOM(transmissionResult.recoATT, DICOMExporter::ATT);
// 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,7 +245,7 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
Matrix snList_inter = intersect(snList, reflectParams::senderElementList);
Matrix rlList_inter = intersect(rlList, reflectParams::receiverTasList);
Matrix rnList_inter = intersect(rnList, reflectParams::receiverElementList);
preComputes.timeInterval = (double)1 / reflectParams::aScanReconstructionFrequency;
preComputes.timeInterval = (float)1 / reflectParams::aScanReconstructionFrequency;
preComputes.measuredCEUsed = ce.measuredCEUsed;
preComputes.measuredCE_TASIndices = ce.tasIndices;
preComputes.measuredCE_receiverIndices = ce.receiverIndices;
@@ -255,10 +255,11 @@ int Recon::startReconstructions(const std::string& aDataPath, const std::string&
Recon::notifyProgress(25);
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");
exporter.exportDICOM(env, Recon::DICOMExporter::REFL);
writer.setMatrix(env, "reflect");
//exporter.exportDICOM(env, Recon::DICOMExporter::REFL);
Recon::notifyProgress(99);
}
writer.write();
return 0;
// writer.write();
}