49 std::move(spacing), std::move(centrePosition), std::move(addressModes)};
77 At({index.X() + 1, index.Y(), index.Z()});
79 {index.X() + 1, index.Y() + 1, index.Z()});
81 {index.X() + 1, index.Y(), index.Z() + 1});
83 {index.X() + 1, index.Y() + 1, index.Z() + 1});
102 At({index.X() + 1, index.Y() + 1, index.Z()}) -
At({index.X(), index.Y() + 1, index.Z()}));
103 const float l1 = (1.f -
fVertical) * (
At({index.X() + 1, index.Y(), index.Z() + 1}) -
104 At({index.X(), index.Y(), index.Z() + 1})) +
fVertical * (
105 At({index.X() + 1, index.Y() + 1, index.Z() + 1}) -
At(
106 {index.X(), index.Y() + 1, index.Z() + 1}));
123 At({index.X() + 1, index.Y() + 1, index.Z()}) -
At({index.X() + 1, index.Y(), index.Z()}));
124 const float l1 = (1.f -
fHorizontal) * (
At({index.X(), index.Y() + 1, index.Z() + 1}) -
126 At({index.X() + 1, index.Y() + 1, index.Z() + 1}) -
At(
127 {index.X() + 1, index.Y(), index.Z() + 1}));
144 At({index.X() + 1, index.Y(), index.Z() + 1}) -
At({index.X() + 1, index.Y(), index.Z()}));
145 const float r1 = (1.f -
fHorizontal) * (
At({index.X(), index.Y() + 1, index.Z() + 1}) -
147 At({index.X() + 1, index.Y() + 1, index.Z() + 1}) -
At(
148 {index.X() + 1, index.Y() + 1, index.Z()}));
168 At({index.X() + 1, index.Y() + 1, index.Z()}) -
At({index.X(), index.Y() + 1, index.Z()}));
169 const float x1 = (1.f -
fVertical) * (
At({index.X() + 1, index.Y(), index.Z() + 1}) -
170 At({index.X(), index.Y(), index.Z() + 1})) +
fVertical * (
171 At({index.X() + 1, index.Y() + 1, index.Z() + 1}) -
At(
172 {index.X(), index.Y() + 1, index.Z() + 1}));
176 At({index.X() + 1, index.Y() + 1, index.Z()}) -
At({index.X() + 1, index.Y(), index.Z()}));
177 const float y1 = (1.f -
fHorizontal) * (
At({index.X(), index.Y() + 1, index.Z() + 1}) -
179 At({index.X() + 1, index.Y() + 1, index.Z() + 1}) -
At(
180 {index.X() + 1, index.Y(), index.Z() + 1}));
185 At({index.X() + 1, index.Y(), index.Z() + 1}) -
At({index.X() + 1, index.Y(), index.Z()}));
186 const float z1 = (1.f -
fHorizontal) * (
At({index.X(), index.Y() + 1, index.Z() + 1}) -
188 At({index.X() + 1, index.Y() + 1, index.Z() + 1}) -
At(
189 {index.X() + 1, index.Y() + 1, index.Z()}));
#define __host__
Definition Global.h:17
#define __device__
Definition Global.h:22
A 3D texture stored for access by the CPU.
Definition Texture3DCPU.h:15
__host__ __device__ float Sample(VectorType texCoord) const
Definition Texture3DCPU.h:71
__host__ __device__ VectorType DSampleDTexCoord(VectorType texCoord) const
Definition Texture3DCPU.h:157
static Texture3DCPU FromTensor(const at::Tensor &volume, VectorType spacing, VectorType centrePosition=VectorType::Full(0), AddressModeType addressModes=AddressModeType::Full(TextureAddressMode::ZERO))
Definition Texture3DCPU.h:45
Texture3DCPU & operator=(const Texture3DCPU &)=default
__host__ __device__ float At(const SizeType &index) const
Definition Texture3DCPU.h:56
Texture3DCPU & operator=(Texture3DCPU &&)=default
Texture3DCPU(const float *_ptr, SizeType _size, VectorType _spacing=VectorType::Full(1.), VectorType _centrePosition=VectorType::Full(0), AddressModeType _addressModes=AddressModeType::Full(TextureAddressMode::ZERO))
Definition Texture3DCPU.h:21
Texture3DCPU(Texture3DCPU &&)=default
Texture3DCPU(const Texture3DCPU &)=default
__host__ __device__ float DSampleDX(VectorType texCoord) const
Definition Texture3DCPU.h:94
__host__ __device__ float DSampleDY(VectorType texCoord) const
Definition Texture3DCPU.h:115
__host__ __device__ float DSampleDZ(VectorType texCoord) const
Definition Texture3DCPU.h:136
A parent texture class containing template data and functionality.
Definition Texture.h:71
__host__ __device__ const SizeType & Size() const
Definition Texture.h:82
Vec< TextureAddressMode, dimensionality > AddressModeType
Definition Texture.h:78
__host__ __device__ constexpr Vec< newT, N > StaticCast() const
Construct a Vec with the elements form this one cast to a new type.
Definition Vec.h:237
__host__ __device__ constexpr Vec< newT, N > Apply(const std::function< newT(T)> &f) const
Map all elements with a common std::function mapping function.
Definition Vec.h:285
__host__ __device__ constexpr const T & X() const
Get a constant reference to the first element.
Definition Vec.h:417
__host__ __device__ constexpr const T & Z() const
Get a constant reference to the third element.
Definition Vec.h:443
__host__ __device__ constexpr const T & Y() const
Get a constant reference to the second element.
Definition Vec.h:427
__host__ static __device__ constexpr Vec Full(const double &value)
Construct a Vec, copying the given value into every element.
Definition Vec.h:64
Vec< TextureAddressMode, DIMENSIONALITY > StringsToAddressModes(const std::array< std::string_view, DIMENSIONALITY > &strings)
Definition Texture.h:44
@ ZERO
Sampling locations outside texture coordinate range will be read as 0.
Definition GridSample3DCPU.cpp:6