Create SAFTStructs.h
This commit is contained in:
11
SAFT/SAFTStructs.h
Normal file
11
SAFT/SAFTStructs.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef __SAFTSTRUCTS_H__
|
||||||
|
#define __SAFTSTRUCTS_H__
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
struct Matrix_t{
|
||||||
|
void* Data;
|
||||||
|
size_t NumberOfDims;
|
||||||
|
size_t Dims[3];
|
||||||
|
size_t DataSize;
|
||||||
|
};
|
||||||
|
#endif // __SAFTSTRUCTS_H__
|
||||||
@@ -4,7 +4,7 @@ set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
|
|||||||
enable_language(CUDA)
|
enable_language(CUDA)
|
||||||
|
|
||||||
add_library(SaftATT SHARED ./src/SAFT_ATT.cpp ./src/saft.cu ./src/processAScans.cpp ./src/saft.cpp )
|
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)
|
set_target_properties(SaftATT PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
target_compile_options(SaftATT PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
target_compile_options(SaftATT PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
||||||
# -O3
|
# -O3
|
||||||
|
|||||||
@@ -977,23 +977,23 @@ void preintegrateAscans(
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t* GetDimensions(const Matrix_a& matrix)
|
const size_t* GetDimensions(const Matrix_t& matrix)
|
||||||
{
|
{
|
||||||
return matrix.Dims;
|
return matrix.Dims;
|
||||||
}
|
}
|
||||||
const void* GetPr(const Matrix_a& matrix){
|
const void* GetPr(const Matrix_t& matrix){
|
||||||
return matrix.Data;
|
return matrix.Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetNumberOfDimensions(const Matrix_a& matrix){
|
size_t GetNumberOfDimensions(const Matrix_t& matrix){
|
||||||
return matrix.NumberOfDims;
|
return matrix.NumberOfDims;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetNumberOfElements(const Matrix_a& matrix){
|
size_t GetNumberOfElements(const Matrix_t& matrix){
|
||||||
return matrix.DataSize;
|
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;
|
// double * A, * B, * Y;
|
||||||
size_t AScan_Nx, AScan_Mx,
|
size_t AScan_Nx, AScan_Mx,
|
||||||
pix_vect_Nx, pix_vect_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( " plhs[2] = Output_Ascans = mxCreateNumericMatrix( [3000?,nAscans], mxSINGLE_CLASS, mxREAL); \n");
|
||||||
// printf( " ================================================================================================= \n");
|
// printf( " ================================================================================================= \n");
|
||||||
printf("Wrong number of input arguments.");
|
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
|
// assign input arguments... // Bestimme die Eingangswerte
|
||||||
const Matrix_a& AScan = params [0]; // AScan-Data
|
const Matrix_t& AScan = params [0]; // AScan-Data
|
||||||
const Matrix_a& pix_vect = params [1]; // Startpoint
|
const Matrix_t& pix_vect = params [1]; // Startpoint
|
||||||
|
|
||||||
const Matrix_a& receiver_index = params [2]; // Index Data for Receiver-Position Data
|
const Matrix_t& 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_t& 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_t& 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& 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_t& 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_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_t& 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_t& sos_startPoint = params [9]; // Startpoint of Speed of Sound Grid
|
||||||
const Matrix_a& sos_res = params [10]; // SoS Grid Resolution
|
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_t& res = params [12]; // Output Volume Resolution
|
||||||
const Matrix_a& timeint = params [13]; // Sample-Rate
|
const Matrix_t& timeint = params [13]; // Sample-Rate
|
||||||
const Matrix_a& IMAGE_XYZ = params [14]; // Output Volume XYZ
|
const Matrix_t& IMAGE_XYZ = params [14]; // Output Volume XYZ
|
||||||
const Matrix_a& IMAGE_SUM = params [15]; // Volume from previous Call
|
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_t& BlockDim = params [16]; // Block Dimension to use for GPU
|
||||||
const Matrix_a& GPUs = params [17]; // Welche GPUs sollen genutzt werden?
|
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;
|
ATTMode_3DVolume = true;
|
||||||
printf ( "Interpolated Index SAFT (-SOS -ATT)\n");
|
printf ( "Interpolated Index SAFT (-SOS -ATT)\n");
|
||||||
printf(" -> Currently not implemented => exit");
|
printf(" -> Currently not implemented => exit");
|
||||||
return Matrix_a();
|
return Matrix_t();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
SOSMode_3DVolume = false;
|
SOSMode_3DVolume = false;
|
||||||
ATTMode_3DVolume = false;
|
ATTMode_3DVolume = false;
|
||||||
printf ( "Kernel-Mode (+SOS +ATT)\n");
|
printf ( "Kernel-Mode (+SOS +ATT)\n");
|
||||||
printf(" -> Currently not implemented => exit");
|
printf(" -> Currently not implemented => exit");
|
||||||
return Matrix_a();;
|
return Matrix_t();;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SOSMode_3DVolume = false;
|
SOSMode_3DVolume = false;
|
||||||
ATTMode_3DVolume = false;
|
ATTMode_3DVolume = false;
|
||||||
printf ( " -> SAFT_MODE %i is out of range [0..3] => use Standard SAFT\n", SAFT_MODE);
|
printf ( " -> SAFT_MODE %i is out of range [0..3] => use Standard SAFT\n", SAFT_MODE);
|
||||||
printf ( "Standard SAFT without correction (-SOS -ATT)\n");
|
printf ( "Standard SAFT without correction (-SOS -ATT)\n");
|
||||||
return Matrix_a();;
|
return Matrix_t();;
|
||||||
break;
|
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]);
|
// printf( "plhs[0] = Output_Voxels = mxCreateNumericArray( ndim(%i), dims{%i %i %i}, mxDOUBLE_CLASS, mxREAL);\n", ndim, dims[0], dims[1], dims[2]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Matrix_a Output_Voxels;
|
Matrix_t Output_Voxels;
|
||||||
Output_Voxels.NumberOfDims = ndim;
|
Output_Voxels.NumberOfDims = ndim;
|
||||||
Output_Voxels.Dims[0] = dims[0];
|
Output_Voxels.Dims[0] = dims[0];
|
||||||
Output_Voxels.Dims[1] = dims[1];
|
Output_Voxels.Dims[1] = dims[1];
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
#define __SAFT_ATT_H__
|
#define __SAFT_ATT_H__
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
struct Matrix_a{
|
#include "SAFTStructs.h"
|
||||||
void* Data;
|
extern Matrix_t SAFT_ATT(std::vector<Matrix_t>& params);
|
||||||
size_t NumberOfDims;
|
|
||||||
size_t Dims[3];
|
|
||||||
size_t DataSize;
|
|
||||||
};
|
|
||||||
extern Matrix_a SAFT_ATT(std::vector<Matrix_a>& params);
|
|
||||||
#endif // __SAFT_ATT_H__
|
#endif // __SAFT_ATT_H__
|
||||||
@@ -4,7 +4,7 @@ set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
|
|||||||
enable_language(CUDA)
|
enable_language(CUDA)
|
||||||
|
|
||||||
add_library(SaftTofi SHARED ./src/SAFT_TOFI.cpp ./src/saft.cu ./src/processAScans.cpp ./src/saft.cpp )
|
add_library(SaftTofi SHARED ./src/SAFT_TOFI.cpp ./src/saft.cu ./src/processAScans.cpp ./src/saft.cpp )
|
||||||
target_include_directories(SaftTofi PRIVATE ./src /usr/local/cuda/include )
|
target_include_directories(SaftTofi PRIVATE ../SAFT ./src /usr/local/cuda/include )
|
||||||
set_target_properties(SaftTofi PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(SaftTofi PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
target_compile_options(SaftTofi PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
target_compile_options(SaftTofi PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
||||||
--compiler-options -fPIC
|
--compiler-options -fPIC
|
||||||
@@ -14,4 +14,6 @@ target_compile_options(SaftTofi PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
|||||||
>)
|
>)
|
||||||
|
|
||||||
target_link_libraries(SaftTofi PRIVATE ${CUDA_RUNTIME_LIBRARY} )
|
target_link_libraries(SaftTofi PRIVATE ${CUDA_RUNTIME_LIBRARY} )
|
||||||
set_target_properties(SaftTofi PROPERTIES PUBLIC_HEADER ${CMAKE_CURRENT_LIST_DIR}/src/SAFT_TOFI.h)
|
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH)
|
||||||
|
set(SAFT_HEADER ${CMAKE_CURRENT_LIST_DIR}/src/SAFT_TOFI.h ${_DIR}/SAFT/SAFTStructs.h)
|
||||||
|
set_target_properties(SaftTofi PROPERTIES PUBLIC_HEADER "${SAFT_HEADER}")
|
||||||
@@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
struct Matrix_t{
|
#include "SAFTStructs.h"
|
||||||
void* Data;
|
|
||||||
size_t NumberOfDims;
|
|
||||||
size_t Dims[3];
|
|
||||||
size_t DataSize;
|
|
||||||
};
|
|
||||||
extern Matrix_t SAFT_TOFI(std::vector<Matrix_t>& params);
|
extern Matrix_t SAFT_TOFI(std::vector<Matrix_t>& params);
|
||||||
#endif // __SAFT_TOFI_H__
|
#endif // __SAFT_TOFI_H__
|
||||||
Reference in New Issue
Block a user