17#ifndef __interp_base_h__
18#define __interp_base_h__
69 template <
class ImageType>
class Base :
public ImageType,
public Transform
72 using image_type = ImageType;
77 Base (
const ImageType& parent, value_type value_when_out_of_bounds = default_out_of_bounds_value()) :
80 out_of_bounds_value (value_when_out_of_bounds),
81 bounds { parent.size(0) - 0.5, parent.size(1) - 0.5, parent.size(2) - 0.5 },
181 const value_type out_of_bounds_value;
183 static inline value_type default_out_of_bounds_value () {
184 return std::numeric_limits<value_type>::quiet_NaN();
199 template <
class VectorType>
202 pos[1] <= -0.5 || pos[1] >=
bounds[1] ||
203 pos[2] <= -0.5 || pos[2] >=
bounds[2])));
210 template <
class VectorType>
This class defines the interface for classes that perform image interpolation.
Eigen::Vector3d intravoxel_offset(const VectorType &pos)
void set_out_of_bounds(const bool value)
bool set_out_of_bounds(const VectorType &pos)
constexpr I floor(const T x)
template function with cast to different type
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
MR::default_type value_type
double default_type
the default type used throughout MRtrix
constexpr default_type NaN