17#ifndef __interp_nearest_h__
18#define __interp_nearest_h__
67 template <
class ImageType>
70 using typename Base<ImageType>::value_type;
81 template <
class VectorType>
82 bool voxel (
const VectorType& pos) {
94 template <
class VectorType>
101 template <
class VectorType>
110 return out_of_bounds_value;
116 Eigen::Matrix<value_type, Eigen::Dynamic, 1> row (
size_t axis) {
118 assert (
axis < ImageType::ndim());
120 Eigen::Matrix<value_type, Eigen::Dynamic, 1> out_of_bounds_row (ImageType::size(
axis));
121 out_of_bounds_row.setOnes();
122 out_of_bounds_row *= out_of_bounds_value;
123 return out_of_bounds_row;
125 return ImageType::row(
axis);
132 template <
class ImageType,
typename... Args>
This class defines the interface for classes that perform image interpolation.
Eigen::Vector3d intravoxel_offset(const VectorType &pos)
This class provides access to the voxel intensities of an Image, using nearest-neighbour interpolatio...
constexpr I round(const T x)
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
Nearest< ImageType > make_nearest(const ImageType &parent, Args &&... args)