Create SAFTStructs.h
This commit is contained in:
@@ -4,7 +4,7 @@ set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
|
||||
enable_language(CUDA)
|
||||
|
||||
add_library(SaftATT SHARED ./src/SAFT_ATT.cpp ./src/saft.cu ./src/processAScans.cpp ./src/saft.cpp )
|
||||
target_include_directories(SaftATT PRIVATE ./src /usr/local/cuda/include )
|
||||
target_include_directories(SaftATT PRIVATE ../SAFT ./src /usr/local/cuda/include )
|
||||
set_target_properties(SaftATT PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
target_compile_options(SaftATT PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
||||
# -O3
|
||||
|
||||
@@ -977,23 +977,23 @@ void preintegrateAscans(
|
||||
#endif
|
||||
}
|
||||
|
||||
const size_t* GetDimensions(const Matrix_a& matrix)
|
||||
const size_t* GetDimensions(const Matrix_t& matrix)
|
||||
{
|
||||
return matrix.Dims;
|
||||
}
|
||||
const void* GetPr(const Matrix_a& matrix){
|
||||
const void* GetPr(const Matrix_t& matrix){
|
||||
return matrix.Data;
|
||||
}
|
||||
|
||||
size_t GetNumberOfDimensions(const Matrix_a& matrix){
|
||||
size_t GetNumberOfDimensions(const Matrix_t& matrix){
|
||||
return matrix.NumberOfDims;
|
||||
}
|
||||
|
||||
size_t GetNumberOfElements(const Matrix_a& matrix){
|
||||
size_t GetNumberOfElements(const Matrix_t& matrix){
|
||||
return matrix.DataSize;
|
||||
}
|
||||
|
||||
Matrix_a SAFT_ATT(std::vector<Matrix_a>& params){
|
||||
Matrix_t SAFT_ATT(std::vector<Matrix_t>& params){
|
||||
// double * A, * B, * Y;
|
||||
size_t AScan_Nx, AScan_Mx,
|
||||
pix_vect_Nx, pix_vect_Mx,
|
||||
@@ -1117,7 +1117,7 @@ size_t GetNumberOfElements(const Matrix_a& matrix){
|
||||
// printf( " plhs[2] = Output_Ascans = mxCreateNumericMatrix( [3000?,nAscans], mxSINGLE_CLASS, mxREAL); \n");
|
||||
// printf( " ================================================================================================= \n");
|
||||
printf("Wrong number of input arguments.");
|
||||
return Matrix_a();
|
||||
return Matrix_t();
|
||||
}
|
||||
|
||||
|
||||
@@ -1125,34 +1125,34 @@ size_t GetNumberOfElements(const Matrix_a& matrix){
|
||||
|
||||
|
||||
// assign input arguments... // Bestimme die Eingangswerte
|
||||
const Matrix_a& AScan = params [0]; // AScan-Data
|
||||
const Matrix_a& pix_vect = params [1]; // Startpoint
|
||||
const Matrix_t& AScan = params [0]; // AScan-Data
|
||||
const Matrix_t& pix_vect = params [1]; // Startpoint
|
||||
|
||||
const Matrix_a& receiver_index = params [2]; // Index Data for Receiver-Position Data
|
||||
const Matrix_a& emitter_index = params [3]; // Index Data for Emitter-Position Data
|
||||
const Matrix_a& receiver_list = params [4]; // Assignment Index to Receiver-Position Data
|
||||
const Matrix_a& emitter_list = params [5]; // Assignment Index to Emitter-Position Data
|
||||
const Matrix_t& receiver_index = params [2]; // Index Data for Receiver-Position Data
|
||||
const Matrix_t& emitter_index = params [3]; // Index Data for Emitter-Position Data
|
||||
const Matrix_t& receiver_list = params [4]; // Assignment Index to Receiver-Position Data
|
||||
const Matrix_t& emitter_list = params [5]; // Assignment Index to Emitter-Position Data
|
||||
|
||||
const Matrix_a& SAFT_mode = params [6]; // Assignment Index to Emitter-Position Data
|
||||
const Matrix_a& SAFT_variant = params [7]; // Assignment Index to Emitter-Position Data
|
||||
const Matrix_t& SAFT_mode = params [6]; // Assignment Index to Emitter-Position Data
|
||||
const Matrix_t& SAFT_variant = params [7]; // Assignment Index to Emitter-Position Data
|
||||
|
||||
const Matrix_a& speed = params [8]; // Speed of Sound Data (Single, per Ascan or SoS-Grid)
|
||||
const Matrix_a& sos_startPoint = params [9]; // Startpoint of Speed of Sound Grid
|
||||
const Matrix_a& sos_res = params [10]; // SoS Grid Resolution
|
||||
const Matrix_t& speed = params [8]; // Speed of Sound Data (Single, per Ascan or SoS-Grid)
|
||||
const Matrix_t& sos_startPoint = params [9]; // Startpoint of Speed of Sound Grid
|
||||
const Matrix_t& sos_res = params [10]; // SoS Grid Resolution
|
||||
|
||||
const Matrix_a& attVolume = params [11]; // Attenuation Data (Single, per Ascan or SoS-Grid)
|
||||
const Matrix_t& attVolume = params [11]; // Attenuation Data (Single, per Ascan or SoS-Grid)
|
||||
|
||||
const Matrix_a& res = params [12]; // Output Volume Resolution
|
||||
const Matrix_a& timeint = params [13]; // Sample-Rate
|
||||
const Matrix_a& IMAGE_XYZ = params [14]; // Output Volume XYZ
|
||||
const Matrix_a& IMAGE_SUM = params [15]; // Volume from previous Call
|
||||
const Matrix_t& res = params [12]; // Output Volume Resolution
|
||||
const Matrix_t& timeint = params [13]; // Sample-Rate
|
||||
const Matrix_t& IMAGE_XYZ = params [14]; // Output Volume XYZ
|
||||
const Matrix_t& IMAGE_SUM = params [15]; // Volume from previous Call
|
||||
|
||||
const Matrix_a& BlockDim = params [16]; // Block Dimension to use for GPU
|
||||
const Matrix_a& GPUs = params [17]; // Welche GPUs sollen genutzt werden?
|
||||
const Matrix_t& BlockDim = params [16]; // Block Dimension to use for GPU
|
||||
const Matrix_t& GPUs = params [17]; // Welche GPUs sollen genutzt werden?
|
||||
|
||||
const Matrix_a& medianWindow = params [18]; // width of used median filter
|
||||
const Matrix_t& medianWindow = params [18]; // width of used median filter
|
||||
|
||||
const Matrix_a& dbgMode = params [19]; // DebugMode and DebugMode-Parameter
|
||||
const Matrix_t& dbgMode = params [19]; // DebugMode and DebugMode-Parameter
|
||||
|
||||
|
||||
|
||||
@@ -1446,21 +1446,21 @@ size_t GetNumberOfElements(const Matrix_a& matrix){
|
||||
ATTMode_3DVolume = true;
|
||||
printf ( "Interpolated Index SAFT (-SOS -ATT)\n");
|
||||
printf(" -> Currently not implemented => exit");
|
||||
return Matrix_a();
|
||||
return Matrix_t();
|
||||
break;
|
||||
case 4:
|
||||
SOSMode_3DVolume = false;
|
||||
ATTMode_3DVolume = false;
|
||||
printf ( "Kernel-Mode (+SOS +ATT)\n");
|
||||
printf(" -> Currently not implemented => exit");
|
||||
return Matrix_a();;
|
||||
return Matrix_t();;
|
||||
break;
|
||||
default:
|
||||
SOSMode_3DVolume = false;
|
||||
ATTMode_3DVolume = false;
|
||||
printf ( " -> SAFT_MODE %i is out of range [0..3] => use Standard SAFT\n", SAFT_MODE);
|
||||
printf ( "Standard SAFT without correction (-SOS -ATT)\n");
|
||||
return Matrix_a();;
|
||||
return Matrix_t();;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2118,7 +2118,7 @@ size_t GetNumberOfElements(const Matrix_a& matrix){
|
||||
// printf( "plhs[0] = Output_Voxels = mxCreateNumericArray( ndim(%i), dims{%i %i %i}, mxDOUBLE_CLASS, mxREAL);\n", ndim, dims[0], dims[1], dims[2]);
|
||||
#endif
|
||||
|
||||
Matrix_a Output_Voxels;
|
||||
Matrix_t Output_Voxels;
|
||||
Output_Voxels.NumberOfDims = ndim;
|
||||
Output_Voxels.Dims[0] = dims[0];
|
||||
Output_Voxels.Dims[1] = dims[1];
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
#define __SAFT_ATT_H__
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
struct Matrix_a{
|
||||
void* Data;
|
||||
size_t NumberOfDims;
|
||||
size_t Dims[3];
|
||||
size_t DataSize;
|
||||
};
|
||||
extern Matrix_a SAFT_ATT(std::vector<Matrix_a>& params);
|
||||
#include "SAFTStructs.h"
|
||||
extern Matrix_t SAFT_ATT(std::vector<Matrix_t>& params);
|
||||
#endif // __SAFT_ATT_H__
|
||||
Reference in New Issue
Block a user