Compare commits
7 Commits
dev-sunwen
...
dev.0.0.1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c9af2aae9 | ||
|
|
093b2451c1 | ||
|
|
4dce7c90ce | ||
|
|
34d7086b47 | ||
|
|
b070c3d5a8 | ||
|
|
356691ee6f | ||
|
|
d028a604a4 |
@@ -12,7 +12,6 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
|||||||
|
|
||||||
find_package(Aurora REQUIRED)
|
find_package(Aurora REQUIRED)
|
||||||
find_package(Parser REQUIRED)
|
find_package(Parser REQUIRED)
|
||||||
find_package(Req REQUIRED)
|
|
||||||
find_package(URDepends REQUIRED)
|
find_package(URDepends REQUIRED)
|
||||||
find_package(DCMTK REQUIRED)
|
find_package(DCMTK REQUIRED)
|
||||||
set(DCMTK_WITH_JPEG OFF)
|
set(DCMTK_WITH_JPEG OFF)
|
||||||
@@ -26,14 +25,12 @@ add_executable(UR ${cpp_files} ${cu_files} ${cxx_files} ${header_files} ${Auror
|
|||||||
target_include_directories(UR PUBLIC ./src/)
|
target_include_directories(UR PUBLIC ./src/)
|
||||||
target_include_directories(UR PUBLIC ${Aurora_INCLUDE_DIRS})
|
target_include_directories(UR PUBLIC ${Aurora_INCLUDE_DIRS})
|
||||||
target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS})
|
target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS})
|
||||||
target_include_directories(UR PUBLIC ${Req_INCLUDES_DIRS})
|
|
||||||
target_include_directories(UR PUBLIC ${Parser_INCLUDE_DIRS})
|
target_include_directories(UR PUBLIC ${Parser_INCLUDE_DIRS})
|
||||||
target_include_directories(UR PUBLIC ${URDepends_INCLUDES_DIRS})
|
target_include_directories(UR PUBLIC ${URDepends_INCLUDES_DIRS})
|
||||||
target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS})
|
target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS})
|
||||||
target_link_libraries(UR PUBLIC ${Aurora_Libraries})
|
target_link_libraries(UR PUBLIC ${Aurora_Libraries})
|
||||||
target_link_libraries(UR PUBLIC dcmdata)
|
target_link_libraries(UR PUBLIC dcmdata)
|
||||||
target_link_libraries(UR PUBLIC matio)
|
target_link_libraries(UR PUBLIC matio)
|
||||||
target_link_libraries(UR PUBLIC Req)
|
|
||||||
target_link_libraries(UR PUBLIC Parser)
|
target_link_libraries(UR PUBLIC Parser)
|
||||||
|
|
||||||
target_link_libraries(UR PUBLIC URDepends::TransDetection)
|
target_link_libraries(UR PUBLIC URDepends::TransDetection)
|
||||||
@@ -65,7 +62,7 @@ enable_testing()
|
|||||||
file(GLOB_RECURSE test_cpp test/*.cpp)
|
file(GLOB_RECURSE test_cpp test/*.cpp)
|
||||||
add_executable(UR_Test ${cpp_files} ${header_files} ${Aurora_Source} ${test_cpp} )
|
add_executable(UR_Test ${cpp_files} ${header_files} ${Aurora_Source} ${test_cpp} )
|
||||||
target_include_directories(UR_Test PUBLIC ./test/ ./src/)
|
target_include_directories(UR_Test PUBLIC ./test/ ./src/)
|
||||||
target_compile_options(UR_Test PUBLIC ${Aurora_Complie_Options} "-march=native")
|
# target_compile_options(UR_Test PUBLIC ${Aurora_Complie_Options} "-march=native")
|
||||||
target_include_directories(UR_Test PUBLIC ${DCMTK_INCLUDE_DIRS})
|
target_include_directories(UR_Test PUBLIC ${DCMTK_INCLUDE_DIRS})
|
||||||
target_include_directories(UR_Test PUBLIC ${Aurora_INCLUDE_DIRS})
|
target_include_directories(UR_Test PUBLIC ${Aurora_INCLUDE_DIRS})
|
||||||
target_include_directories(UR_Test PUBLIC ${Parser_INCLUDE_DIRS})
|
target_include_directories(UR_Test PUBLIC ${Parser_INCLUDE_DIRS})
|
||||||
|
|||||||
@@ -130,11 +130,12 @@ namespace Recon
|
|||||||
}
|
}
|
||||||
exportDCM(path, reflectParams::imageStartpoint.getData(),
|
exportDCM(path, reflectParams::imageStartpoint.getData(),
|
||||||
reflectParams::imageEndpoint.getData(), XYZ, aMatrix.getData(), type);
|
reflectParams::imageEndpoint.getData(), XYZ, aMatrix.getData(), type);
|
||||||
|
RECON_INFO("Save DICOM to Path:{0}, type:{1}==================>",path,(int)type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DICOMExporter::exportDCM(string path, float * startPoint, float* endPoint, int* imageXYZ,float* data, int type)
|
void DICOMExporter::exportDCM(string path, float * startPoint, float* endPoint, int* imageXYZ,float* data, int type)
|
||||||
{
|
{
|
||||||
long Rows = imageXYZ[0], Cols = imageXYZ[1] ,Slices = imageXYZ[2];
|
long Rows = imageXYZ[1], Cols = imageXYZ[0] ,Slices = imageXYZ[2];
|
||||||
DcmFileFormat dcmFile;
|
DcmFileFormat dcmFile;
|
||||||
DcmDataset* dataset = dcmFile.getDataset();
|
DcmDataset* dataset = dcmFile.getDataset();
|
||||||
DcmMetaInfo* metaInfo = dcmFile.getMetaInfo();
|
DcmMetaInfo* metaInfo = dcmFile.getMetaInfo();
|
||||||
@@ -157,7 +158,7 @@ namespace Recon
|
|||||||
"InstName":mPatientData.getInstituationName().data());
|
"InstName":mPatientData.getInstituationName().data());
|
||||||
dataset->putAndInsertString(DCM_InstitutionAddress, mPatientData.getInstituationAddress().empty()?
|
dataset->putAndInsertString(DCM_InstitutionAddress, mPatientData.getInstituationAddress().empty()?
|
||||||
"default addr":mPatientData.getInstituationAddress().data());
|
"default addr":mPatientData.getInstituationAddress().data());
|
||||||
dataset->putAndInsertString(DCM_ReferringPhysicianName,mPatientData.getOperatorName().empty()?
|
dataset->putAndInsertString(DCM_ReferringPhysicianName,mPatientData.getReferringPhysicianName().empty()?
|
||||||
"ReferringPhysician": mPatientData.getOperatorName().data());
|
"ReferringPhysician": mPatientData.getOperatorName().data());
|
||||||
dataset->putAndInsertString(DCM_PatientName, mPatientData.getPatientName().empty()?
|
dataset->putAndInsertString(DCM_PatientName, mPatientData.getPatientName().empty()?
|
||||||
"TestPatient":mPatientData.getPatientName().data());
|
"TestPatient":mPatientData.getPatientName().data());
|
||||||
@@ -183,7 +184,7 @@ namespace Recon
|
|||||||
endPoint[2]*(float)1000.0,
|
endPoint[2]*(float)1000.0,
|
||||||
endPoint[0]*(float)1000.0,
|
endPoint[0]*(float)1000.0,
|
||||||
};
|
};
|
||||||
float originLocation =endPoint[1]*1000.0;
|
float originLocation =-endPoint[2]*1000.0;
|
||||||
dataset->putAndInsertString(DCM_SliceThickness, to_string(spacing[2]).data());
|
dataset->putAndInsertString(DCM_SliceThickness, to_string(spacing[2]).data());
|
||||||
dataset->putAndInsertUint16(DCM_Rows, Rows);
|
dataset->putAndInsertUint16(DCM_Rows, Rows);
|
||||||
dataset->putAndInsertUint16(DCM_Columns, Cols);
|
dataset->putAndInsertUint16(DCM_Columns, Cols);
|
||||||
@@ -228,11 +229,11 @@ namespace Recon
|
|||||||
{
|
{
|
||||||
dataset->putAndInsertString(DCM_AccessionNumber, to_string(i).data());
|
dataset->putAndInsertString(DCM_AccessionNumber, to_string(i).data());
|
||||||
dataset->putAndInsertString(DCM_InstanceNumber, to_string(i).data());
|
dataset->putAndInsertString(DCM_InstanceNumber, to_string(i).data());
|
||||||
string pos = to_string(originPosition[0] ) + "\\" +
|
string pos = to_string(originPosition[1] ) + "\\" +
|
||||||
to_string(originPosition[1]- i * spacing[2]) + "\\" +
|
to_string(originPosition[2]+ i * spacing[2]) + "\\" +
|
||||||
to_string(originPosition[2]);
|
to_string(originPosition[0]);
|
||||||
dataset->putAndInsertString(DCM_ImagePositionPatient, pos.data());
|
dataset->putAndInsertString(DCM_ImagePositionPatient, pos.data());
|
||||||
string loc = to_string(originLocation - i * spacing[2]);
|
string loc = to_string(originLocation + i * spacing[2]);
|
||||||
dataset->putAndInsertString(DCM_SliceLocation, loc.data());
|
dataset->putAndInsertString(DCM_SliceLocation, loc.data());
|
||||||
|
|
||||||
// set SOPInstanceUID
|
// set SOPInstanceUID
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
namespace Recon
|
namespace Recon
|
||||||
{
|
{
|
||||||
const std::string DEFAULT_CONFIG_PATH = "/home/UR/ConfigFiles/";
|
const std::string DEFAULT_CONFIG_PATH = "/home/UR/ConfigFiles/";
|
||||||
const std::string DEFAULT_OUTPUT_PATH = "/home/UR/ReconResult/sun.mat";
|
const std::string DEFAULT_OUTPUT_PATH = "/home/UR/ReconResult/";
|
||||||
const std::string DEFAULT_OUTPUT_FILENAME = "sun.mat";
|
const std::string DEFAULT_OUTPUT_FILENAME = "sun.mat";
|
||||||
|
|
||||||
std::string getPath(const std::string &aFullPath);
|
std::string getPath(const std::string &aFullPath);
|
||||||
|
|||||||
@@ -1,36 +1,16 @@
|
|||||||
#include "notify.h"
|
#include "notify.h"
|
||||||
#include "Request.h"
|
|
||||||
#include "log/log.h"
|
#include "log/log.h"
|
||||||
namespace Recon {
|
namespace Recon {
|
||||||
std::string ReconID;
|
std::string ReconID;
|
||||||
Req::Request req;
|
|
||||||
bool notifyStart(const std::string& aReconID ){
|
bool notifyStart(const std::string& aReconID ){
|
||||||
ReconID = aReconID;
|
return true;
|
||||||
Req::Request::Init();
|
|
||||||
req.setClientCertificate("/home/krad/workdir/ReconTester/client.crt","/home/krad/workdir/ReconTester/client.key");
|
|
||||||
std::string str = "{\"ReconID\": \""+ReconID+"\"}";
|
|
||||||
std::unordered_map<std::string, std::string> headers;
|
|
||||||
headers["Content-Type"] = "application/json";
|
|
||||||
auto resp = req.post("https://127.0.0.1:5002/Task/Start/",str,headers);
|
|
||||||
return resp->httpCode() == 200;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool notifyFinish(){
|
bool notifyFinish(){
|
||||||
std::string str = "{\"ReconID\": \""+ReconID+"\"}";
|
return true;
|
||||||
std::unordered_map<std::string, std::string> headers;
|
|
||||||
headers["Content-Type"] = "application/json";
|
|
||||||
auto resp = req.post("https://127.0.0.1:5002/Task/Finish/",str,headers);
|
|
||||||
Req::Request::Dispose();
|
|
||||||
return resp->httpCode() == 200;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool notifyProgress( int percent){
|
bool notifyProgress( int percent){
|
||||||
char buffer[2048] = {0};
|
return true;
|
||||||
sprintf(buffer, "https://192.168.1.15:5003/Task/Notify/%d/", percent);
|
|
||||||
std::string str = "{\"ReconID\": \""+ReconID+"\"}";
|
|
||||||
std::unordered_map<std::string, std::string> headers;
|
|
||||||
headers["Content-Type"] = "application/json";
|
|
||||||
auto resp = req.post(buffer,str,headers);
|
|
||||||
return resp->httpCode() == 200;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
155
src/main.cxx
155
src/main.cxx
@@ -1,138 +1,89 @@
|
|||||||
|
#include "Parser.h"
|
||||||
#include "AuroraDefs.h"
|
|
||||||
#include "CudaMatrix.h"
|
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "log/notify.h"
|
#include "log/notify.h"
|
||||||
|
#include "log/notify.h"
|
||||||
#include "Data/ElementIndex.h"
|
#include <cstdio>
|
||||||
#include "Matrix.h"
|
|
||||||
#include "Parser.h"
|
|
||||||
#include "ShotList/ShotList.h"
|
|
||||||
#include "config/config.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#include <mutex>
|
|
||||||
#include <ostream>
|
|
||||||
#include <thread>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "MatlabReader.h"
|
||||||
#define EIGEN_USE_MKL_ALL
|
#define EIGEN_USE_MKL_ALL
|
||||||
|
|
||||||
#include "src/common/fileHelper.h"
|
#include "src/common/fileHelper.h"
|
||||||
#include "startReconstructions.h"
|
#include "startReconstructions.h"
|
||||||
|
|
||||||
|
#include "transmissionReconstruction/detection/detection.h"
|
||||||
|
#include "transmissionReconstruction/detection/detection.cuh"
|
||||||
|
#include "startReconstructions.h"
|
||||||
#include "log/log.h"
|
#include "log/log.h"
|
||||||
/* 0 is data path.
|
/* 0 is data path.
|
||||||
1 is dataRef path.
|
1 is dataRef path.
|
||||||
2 is output path.
|
2 is output path.
|
||||||
3 is config file path.
|
3 is config file path.
|
||||||
*/
|
*/
|
||||||
#include "Data/OneTasAScanData.h"
|
|
||||||
#include "Data/AScanData.h"
|
|
||||||
#include "Data/TasElementIndex.h"
|
|
||||||
#include "Data/ElectricIndex.h"
|
|
||||||
#include "Data/PatientData.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include "Function.h"
|
|
||||||
#include "Function1D.h"
|
|
||||||
#include "Function2D.h"
|
|
||||||
#include "Function1D.cuh"
|
|
||||||
#include "Function2D.cuh"
|
|
||||||
#include "MatlabWriter.h"
|
|
||||||
#include "MatlabReader.h"
|
|
||||||
#include "/usr/local/cuda-10.1/targets/x86_64-linux/include/cufft.h"
|
|
||||||
#include </usr/local/cuda-10.1/targets/x86_64-linux/include/cuda_runtime.h>
|
|
||||||
#include "Aurora.h"
|
|
||||||
#include "common/dataBlockCreation/removeDataFromArrays.h"
|
|
||||||
#include <random>
|
|
||||||
|
|
||||||
#include <thrust/device_vector.h>
|
|
||||||
#include <thrust/execution_policy.h>
|
|
||||||
#include <thrust/sort.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <cuda_runtime.h>
|
|
||||||
#include <cuda_texture_types.h>
|
|
||||||
#include <texture_fetch_functions.h>
|
|
||||||
#include "reflectionReconstruction/preprocessData/imageExtrapolation.h"
|
|
||||||
#include <Data/PatientData.h>
|
|
||||||
#include "transmissionReconstruction/detection/getTransmissionData.cuh"
|
|
||||||
|
|
||||||
std::mutex mutex;
|
|
||||||
std::condition_variable condition;
|
|
||||||
std::vector<int> vector;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
// Aurora::CudaMatrix fxDevice = Aurora::Matrix::fromRawData(new float[10]{1,2,3,4,5,6,7,8,9,10}, 5,1,1,Aurora::Complex).toDeviceMatrix();
|
int argNum = 5;
|
||||||
// Aurora::CudaMatrix fhDevice = Aurora::Matrix::fromRawData(new float[10]{2,3,4,3,2,5,2,1,2,4}, 5,1,1,Aurora::Complex).toDeviceMatrix();
|
|
||||||
// Aurora::CudaMatrix fxReal = Aurora::real(fxDevice);
|
|
||||||
// Aurora::CudaMatrix fhReal = Aurora::real(fhDevice);
|
|
||||||
// Aurora::CudaMatrix fxImag = Aurora::imag(fxDevice);
|
|
||||||
// Aurora::CudaMatrix fhImag = Aurora::imag(fhDevice);
|
|
||||||
// Aurora::CudaMatrix real = fxReal *fhReal + fxImag * fhImag;
|
|
||||||
// Aurora::CudaMatrix image = fxImag * fhReal - fxReal * fhImag;
|
|
||||||
// Aurora::Matrix result = Aurora::complex(real, image).toHostMatrix();
|
|
||||||
// result.printf();
|
|
||||||
// result = getTransmissionDataSubFunction(fxDevice, fhDevice).toHostMatrix();
|
|
||||||
// result.printf();
|
|
||||||
// return 0;
|
|
||||||
|
|
||||||
|
|
||||||
int argNum = 4;
|
|
||||||
std::vector<std::string> args(argNum);
|
std::vector<std::string> args(argNum);
|
||||||
//args[0] = "/DataCenter/科正测试/00e04b741e9f_20231130T091019";
|
args[0] = "";
|
||||||
//args[1] = "/DataCenter/科正测试/00e04b741e9f_20231130T091019";
|
args[1] = "/home/sun/20230418T145123/";
|
||||||
args[0] = "/home/sun/20230418T145123/";
|
args[2] = "/home/sun/20230418T141000/";
|
||||||
args[1] = "/home/sun/20230418T141000/";
|
args[3] = Recon::DEFAULT_OUTPUT_PATH;
|
||||||
//args[0] = "/home/krad/TestStore/00e04b741e9f_20231123T153138/";
|
args[4] = Recon::DEFAULT_CONFIG_PATH;
|
||||||
//args[1] = "/home/krad/TestStore/00e04b741e9f_20231123T152045/";
|
|
||||||
args[2] = Recon::DEFAULT_OUTPUT_PATH;
|
|
||||||
args[3] = Recon::DEFAULT_CONFIG_PATH;
|
|
||||||
// args[3] = "/home/UR/";
|
|
||||||
argc = argc <= argNum? argc-1 : argNum;
|
argc = argc <= argNum? argc-1 : argNum;
|
||||||
for (int i = 0; i < argc; i++)
|
for (int i = 0; i < argc; i++)
|
||||||
{
|
{
|
||||||
args[i] = argv[i+1];
|
args[i] = argv[i+1];
|
||||||
}
|
}
|
||||||
|
std::string outPutPath = args[3];
|
||||||
if(args[0].empty())
|
std::string directoryPath = outPutPath;
|
||||||
|
auto defaultLogger = getLogger("Main",outPutPath.data());
|
||||||
|
spdlog::set_default_logger(defaultLogger);
|
||||||
|
std::string ReconID = args[0];
|
||||||
|
ReconID = ReconID=="none"?"":ReconID;
|
||||||
|
RECON_INFO("Read UR Args =====================");
|
||||||
|
RECON_INFO("ReconID:{0}",ReconID);
|
||||||
|
if(args[1].empty())
|
||||||
{
|
{
|
||||||
RECON_INFO("No reconstruction data.");
|
RECON_INFO("No reconstruction data.");
|
||||||
return 0;
|
return -2;
|
||||||
}
|
}
|
||||||
std::string configPath = Recon::fixPathSlash(args[3]);
|
std::string configPath = Recon::fixPathSlash(args[4]);
|
||||||
Recon::initalizeConfig(configPath);
|
Recon::initalizeConfig(configPath);
|
||||||
if( args[1].empty() && Recon::transParams::runTransmissionReco)
|
if( args[2].empty() && Recon::transParams::runTransmissionReco)
|
||||||
{
|
{
|
||||||
RECON_INFO("Running transmission reconstruction, but no refrence data.");
|
RECON_INFO("Running transmission reconstruction, but no refrence data.");
|
||||||
return 0;
|
return -3;
|
||||||
}
|
}
|
||||||
|
RECON_INFO("configPath:{0}",configPath);
|
||||||
|
|
||||||
|
|
||||||
|
outPutPath = Recon::fixPathSlash(outPutPath);
|
||||||
|
|
||||||
std::string outPutPath = args[2];
|
|
||||||
std::string directoryPath = outPutPath;
|
|
||||||
if(Recon::endsWithMat(outPutPath))
|
|
||||||
{
|
|
||||||
directoryPath = Recon::getPath(outPutPath);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outPutPath = Recon::fixPathSlash(outPutPath) + Recon::DEFAULT_OUTPUT_FILENAME;
|
|
||||||
}
|
|
||||||
if(!Recon::isDirectory(directoryPath))
|
if(!Recon::isDirectory(directoryPath))
|
||||||
{
|
{
|
||||||
RECON_INFO("Output directory is not valid.");
|
RECON_INFO("Output directory is not valid.");
|
||||||
return 0;
|
return -4;
|
||||||
|
}
|
||||||
|
RECON_INFO("outPutPath:{0}",directoryPath);
|
||||||
|
std::string dataPath = Recon::fixPathSlash(args[1]);
|
||||||
|
RECON_INFO("dataPath:{0}",dataPath);
|
||||||
|
std::string dataRefPath = Recon::fixPathSlash(args[2]);
|
||||||
|
RECON_INFO("dataRefPath:{0}",dataRefPath);
|
||||||
|
RECON_INFO("UR Args End=======================");
|
||||||
|
RECON_INFO("UR Start");
|
||||||
|
Recon::notifyStart(ReconID);
|
||||||
|
int exitcode = Recon::startReconstructions(dataPath, dataRefPath, outPutPath+Recon::DEFAULT_OUTPUT_FILENAME);
|
||||||
|
if (exitcode == 0)
|
||||||
|
{
|
||||||
|
RECON_INFO("UR Finish");
|
||||||
|
if (!Recon::notifyFinish()) {
|
||||||
|
RECON_ERROR("Notify Finish failed!");
|
||||||
|
return -100;
|
||||||
|
}
|
||||||
|
return exitcode;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return exitcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string dataPath = Recon::fixPathSlash(args[0]);
|
|
||||||
std::string dataRefPath = Recon::fixPathSlash(args[1]);
|
|
||||||
RECON_INFO("start");
|
|
||||||
Recon::startReconstructions(dataPath, dataRefPath, outPutPath);
|
|
||||||
SPDLOG_INFO("finish");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ CudaMatrix Recon::calculateAttenuationCuda(const CudaMatrix &ascans,
|
|||||||
ascans.getData(), ascans2.getData(),
|
ascans.getData(), ascans2.getData(),
|
||||||
ascansRef.getData(), ascansRef2.getData(),
|
ascansRef.getData(), ascansRef2.getData(),
|
||||||
ascans2.getDimSize(0));
|
ascans2.getDimSize(0));
|
||||||
|
cudaDeviceSynchronize();
|
||||||
auto pulseEnergy = Aurora::sum(ascans2^2);
|
auto pulseEnergy = Aurora::sum(ascans2^2);
|
||||||
auto pulseEnergyEmpty = Aurora::sum(ascansRef2^2);
|
auto pulseEnergyEmpty = Aurora::sum(ascansRef2^2);
|
||||||
|
|
||||||
@@ -86,6 +86,7 @@ Recon::detectAttVectorizedCuda(const CudaMatrix &Ascan, const CudaMatrix &AscanR
|
|||||||
endPos.getData(), startPosRef.getData(), endPosRef.getData(),
|
endPos.getData(), startPosRef.getData(), endPosRef.getData(),
|
||||||
tof.getData(), tof2.getData(), sizeAscan.getData(), sampleRate,
|
tof.getData(), tof2.getData(), sizeAscan.getData(), sampleRate,
|
||||||
offsetElectronicSamples,detectionWindowATT);
|
offsetElectronicSamples,detectionWindowATT);
|
||||||
|
cudaDeviceSynchronize();
|
||||||
return calculateAttenuationCuda(envelopeOfAScan, startPos, endPos,
|
return calculateAttenuationCuda(envelopeOfAScan, startPos, endPos,
|
||||||
envelopeOfReferenceAScan, startPosRef,
|
envelopeOfReferenceAScan, startPosRef,
|
||||||
endPosRef);
|
endPosRef);
|
||||||
@@ -189,6 +190,7 @@ Recon::TimeWindowResultC Recon::applyTimeWindowing(const Aurora::CudaMatrix &Asc
|
|||||||
calcResult.endSearch.getData(),AscanBlock.getData(),AscanBlockProcessed.getData(),
|
calcResult.endSearch.getData(),AscanBlock.getData(),AscanBlockProcessed.getData(),
|
||||||
AscanBlock.getDimSize(0));
|
AscanBlock.getDimSize(0));
|
||||||
}
|
}
|
||||||
|
cudaDeviceSynchronize();
|
||||||
Recon::TimeWindowResultC result;
|
Recon::TimeWindowResultC result;
|
||||||
result.startSearch = calcResult.startSearch;
|
result.startSearch = calcResult.startSearch;
|
||||||
result.AscanBlockProcessed = AscanBlockProcessed;
|
result.AscanBlockProcessed = AscanBlockProcessed;
|
||||||
@@ -306,6 +308,7 @@ Recon::DetectResultC Recon::detectTofAndAtt(
|
|||||||
}
|
}
|
||||||
auto shiftInSamples = zerosCuda(1, c1.getDimSize(1));
|
auto shiftInSamples = zerosCuda(1, c1.getDimSize(1));
|
||||||
findMaxIndexKernel<<<c.getDimSize(1),256>>>(c.getData(),c.getDimSize(0),shiftInSamples.getData(),maxlag);
|
findMaxIndexKernel<<<c.getDimSize(1),256>>>(c.getData(),c.getDimSize(0),shiftInSamples.getData(),maxlag);
|
||||||
|
cudaDeviceSynchronize();
|
||||||
if (useTimeWindowing) {
|
if (useTimeWindowing) {
|
||||||
shiftInSamples = shiftInSamples - diffStartSearch;
|
shiftInSamples = shiftInSamples - diffStartSearch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,9 +246,7 @@ namespace Recon {
|
|||||||
//1ms
|
//1ms
|
||||||
result.outATT = attValue/100 ;
|
result.outATT = attValue/100 ;
|
||||||
}
|
}
|
||||||
Recon::notifyProgress(10 + 10 * (iter/numIter));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace Recon
|
|||||||
float TVAL3Beta;
|
float TVAL3Beta;
|
||||||
float TVAL3Beta0;
|
float TVAL3Beta0;
|
||||||
bool nonNeg = false;
|
bool nonNeg = false;
|
||||||
|
int deviceIndex ;
|
||||||
};
|
};
|
||||||
|
|
||||||
Aurora::Matrix solve( Aurora::Sparse& M, Aurora::Matrix& b, const Aurora::Matrix& dims, int niter, TVAL3SolverOptions solverOptions, int aDevice){
|
Aurora::Matrix solve( Aurora::Sparse& M, Aurora::Matrix& b, const Aurora::Matrix& dims, int niter, TVAL3SolverOptions solverOptions, int aDevice){
|
||||||
|
|||||||
Reference in New Issue
Block a user