83template <
typename texture_t>
struct Radon2D {
85 static_assert(texture_t::DIMENSIONALITY == 2);
87 using IntType =
typename texture_t::IntType;
123 ret.flatOutput = torch::zeros(at::IntArrayRef({
phiValues.numel()}),
image.contiguous().options());
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
__host__ at::Tensor DRadon2DDR_CUDA(const at::Tensor &image, const at::Tensor &imageSpacing, const at::Tensor &phiValues, const at::Tensor &rValues, int64_t samplesPerLine)
An implementation of reg23::DRadon2DDR_CPU that uses CUDA parallelisation.
__host__ at::Tensor Radon2D_CUDA(const at::Tensor &image, const at::Tensor &imageSpacing, const at::Tensor &phiValues, const at::Tensor &rValues, int64_t samplesPerLine)
An implementation of reg23::Radon2D_CPU that uses CUDA parallelisation.
at::Tensor Radon2D_CPU(const at::Tensor &image, const at::Tensor &imageSpacing, const at::Tensor &phiValues, const at::Tensor &rValues, int64_t samplesPerLine)
Compute an approximation of the Radon transform of the given 2D image.
Definition Radon2DCPU.cpp:15
at::Tensor DRadon2DDR_CPU(const at::Tensor &image, const at::Tensor &imageSpacing, const at::Tensor &phiValues, const at::Tensor &rValues, int64_t samplesPerLine)
Compute the derivative with respect to plane-origin distance of an approximation of the Radon transfo...
Definition Radon2DCPU.cpp:33
Vec< TextureAddressMode, DIMENSIONALITY > StringsToAddressModes(const std::array< std::string_view, DIMENSIONALITY > &strings)
Definition Texture.h:44
Definition GridSample3DCPU.cpp:6
__host__ at::Tensor Radon2D_CUDA_V2(const at::Tensor &image, const at::Tensor &imageSpacing, const at::Tensor &phiValues, const at::Tensor &rValues, int64_t samplesPerLine)
An implementation of reg23::Radon2D_CPU that uses CUDA parallelisation.
A functor class that represents a linear transformation: intercept + gradient * x.
Definition Common.h:27
FloatType scaleFactor
Definition Radon2D.h:96
at::Tensor flatOutput
Definition Radon2D.h:97
Linear< VectorType > mappingIndexToOffset
Definition Radon2D.h:95
texture_t inputTexture
Definition Radon2D.h:94
__host__ static __device__ VectorType GetDTexCoordDR(const texture_t &textureIn, FloatType phi, FloatType r)
Definition Radon2D.h:174
__host__ static __device__ Linear< VectorType > GetMappingIndexToTexCoord(const texture_t &textureIn, FloatType phi, FloatType r, const Linear< VectorType > &mappingIToOffset)
Definition Radon2D.h:155
typename texture_t::SizeType SizeType
Definition Radon2D.h:89
__host__ static __device__ float IntegrateLooped(const texture_t &texture, const Linear< VectorType > &mappingIndexToTexCoord, int64_t samplesPerLine)
Definition Radon2D.h:194
typename texture_t::IntType IntType
Definition Radon2D.h:87
__host__ static __device__ float DIntegrateLoopedDMappingParameter(const texture_t &texture, const Linear< VectorType > &mappingIndexToTexCoord, const VectorType &dTexCoordDMappingParameter, int64_t samplesPerLine)
Definition Radon2D.h:216
static __host__ CommonData Common(const at::Tensor &image, const at::Tensor &imageSpacing, const at::Tensor &phiValues, const at::Tensor &rValues, int64_t samplesPerLine, at::DeviceType device)
Definition Radon2D.h:100
typename texture_t::VectorType VectorType
Definition Radon2D.h:90
__host__ static __device__ Linear< VectorType > GetMappingIToOffset(FloatType lineLength, int64_t samplesPerLine)
Definition Radon2D.h:138
typename texture_t::FloatType FloatType
Definition Radon2D.h:88
typename texture_t::AddressModeType AddressModeType
Definition Radon2D.h:91