96template <
typename texture_t>
struct Radon3D {
98 static_assert(texture_t::DIMENSIONALITY == 3);
140 ret.flatOutput = torch::zeros(at::IntArrayRef({
phiValues.numel()}),
volume.contiguous().options());
158 return {VectorType::Full(-.5 *
planeSize),
General tools and structs.
#define __host__
Definition Global.h:17
#define __device__
Definition Global.h:22
__host__ __device__ constexpr T VecDot(const Vec< T, N > &lhs, const Vec< T, N > &rhs)
reg23::Vec dot product
Definition Vec.h:667
at::Tensor DRadon3DDR_CPU(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection)
Compute the derivative with respect to plane-origin distance of an approximation of the Radon transfo...
Definition Radon3DCPU.cpp:31
__host__ at::Tensor Radon3D_CUDA(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection)
An implementation of reg23::Radon3D_CPU that uses CUDA parallelisation.
__host__ at::Tensor DRadon3DDR_CUDA(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection)
An implementation of reg23::DRadon3DDR_CPU that uses CUDA parallelisation.
at::Tensor Radon3D_CPU(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection)
Compute an approximation of the Radon transform of the given 3D volume.
Definition Radon3DCPU.cpp:10
Vec< TextureAddressMode, DIMENSIONALITY > StringsToAddressModes(const std::array< std::string_view, DIMENSIONALITY > &strings)
Definition Texture.h:44
Definition GridSample3DCPU.cpp:6
__host__ at::Tensor DRadon3DDR_CUDA_V2(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection)
An implementation of reg23::DRadon3DDR_CPU that uses CUDA parallelisation.
__host__ at::Tensor Radon3D_CUDA_V2(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection)
An implementation of reg23::Radon3D_CPU that uses CUDA parallelisation.
A functor class that represents a linear transformation of two variables: intercept + gradient1 * x +...
Definition Common.h:59
A functor class that represents a linear transformation: intercept + gradient * x.
Definition Common.h:27
texture_t inputTexture
Definition Radon3D.h:107
FloatType scaleFactor
Definition Radon3D.h:109
Linear< VectorType > mappingIndexToOffset
Definition Radon3D.h:108
at::Tensor flatOutput
Definition Radon3D.h:110
__host__ static __device__ float DIntegrateLoopedDMappingParameter(const texture_t &texture, const Linear2< VectorType > &mappingIndexToTexCoord, const VectorType &dTexCoordDMappingParameter, int64_t samplesPerDirection)
Definition Radon3D.h:245
typename texture_t::IntType IntType
Definition Radon3D.h:100
typename texture_t::FloatType FloatType
Definition Radon3D.h:101
__host__ static __device__ Linear2< VectorType > GetMappingIndexToTexCoord(const texture_t &textureIn, FloatType phi, FloatType theta, FloatType r, const Linear< VectorType > &mappingIToOffset)
Definition Radon3D.h:174
__host__ static __device__ float IntegrateLooped(const texture_t &texture, const Linear2< VectorType > &mappingIndexToTexCoord, int64_t samplesPerDirection)
Definition Radon3D.h:221
__host__ static __device__ Linear< VectorType > GetMappingIToOffset(FloatType planeSize, int64_t samplesPerDirection)
Definition Radon3D.h:155
typename texture_t::VectorType VectorType
Definition Radon3D.h:103
typename texture_t::SizeType SizeType
Definition Radon3D.h:102
typename texture_t::AddressModeType AddressModeType
Definition Radon3D.h:104
static __host__ CommonData Common(const at::Tensor &volume, const at::Tensor &volumeSpacing, const at::Tensor &phiValues, const at::Tensor &thetaValues, const at::Tensor &rValues, int64_t samplesPerDirection, at::DeviceType device)
Definition Radon3D.h:113
__host__ static __device__ VectorType GetDTexCoordDR(const texture_t &textureIn, FloatType phi, FloatType theta, FloatType r)
Definition Radon3D.h:197