Developer documentation
Version 3.0.3-105-gd3941f44
MR::Interp::Base< ImageType > Class Template Reference

This class defines the interface for classes that perform image interpolation. More...

#include "interp/base.h"

Inheritance diagram for MR::Interp::Base< ImageType >:
MR::Transform MR::Interp::LinearInterpBase< ImageType, LinearInterpProcessingType::Derivative > MR::Interp::LinearInterpBase< ImageType, LinearInterpProcessingType::Value > MR::Interp::LinearInterpBase< ImageType, LinearInterpProcessingType::ValueAndDerivative > MR::Interp::SplineInterpBase< ImageType, SplineType, Math::SplineProcessingType::Derivative > MR::Interp::SplineInterpBase< ImageType, SplineType, Math::SplineProcessingType::Value > MR::Interp::SplineInterpBase< ImageType, SplineType, Math::SplineProcessingType::ValueAndDerivative > MR::Interp::LinearInterpBase< ImageType, PType > MR::Interp::Nearest< ImageType > MR::Interp::Sinc< ImageType > MR::Interp::SplineInterpBase< ImageType, SplineType, PType >

Protected Member Functions

template<class VectorType >
bool set_out_of_bounds (const VectorType &pos)
 
void set_out_of_bounds (const bool value)
 
template<class VectorType >
Eigen::Vector3d intravoxel_offset (const VectorType &pos)
 

Protected Attributes

default_type bounds [3]
 
bool out_of_bounds
 

Additional Inherited Members

- Public Member Functions inherited from MR::Transform
void * operator new (std::size_t size)
 
void * operator new[] (std::size_t size)
 
void operator delete (void *ptr)
 
void operator delete[] (void *ptr)
 
template<class HeaderType >
 Transform (const HeaderType &header)
 An object for transforming between voxel, scanner and image coordinate spaces. More...
 
 Transform (const Transform &)=default
 
 Transform (Transform &&)=default
 
Transformoperator= (const Transform &)=delete
 
Transformoperator= (Transform &&)=delete
 
- Static Public Member Functions inherited from MR::Transform
template<class HeaderType >
static transform_type get_default (const HeaderType &header)
 
- Public Attributes inherited from MR::Transform
const Eigen::DiagonalMatrix< default_type, 3 > voxelsize
 
const transform_type voxel2scanner
 
const transform_type scanner2voxel
 
const transform_type image2scanner
 
const transform_type scanner2image
 

Detailed Description

template<class ImageType>
class MR::Interp::Base< ImageType >

This class defines the interface for classes that perform image interpolation.

Interpolation is generally performed along the first 3 (spatial) axes; the (integer) position along the remaining axes should be set using the template ImageType class. The spatial coordinates can be set using the functions voxel(), image(), and scanner(). For example:

auto input = Image<float>::create (argument[0]);
// create an Interp::Cubic object using input as the parent data set:
Interp::Cubic<decltype(input)> interp (input);
// set the scanner-space position to [ 10.2 3.59 54.1 ]:
interp.scanner (10.2, 3.59, 54.1);
// get the value at this position:
float value = interp.value();
static Image create(const std::string &image_name, const Header &template_header, bool add_to_command_history=true)
Definition: image.h:192
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
Definition: SH.h:233
vector< ParsedArgument > argument
the list of arguments parsed from the command-line
SplineInterp< ImageType, Math::HermiteSpline< typename ImageType::value_type >, Math::SplineProcessingType::Value > Cubic
Definition: cubic.h:522

The template input class must be usable with this type of syntax:

int xsize = input.size(0); // return the dimension
int ysize = input.size(1); // along the x, y & z dimensions
int zsize = input.size(2);
float v[] = { input.spacing(0), input.spacing(1), input.spacing(2) }; // return voxel dimensions
input.index(0) = 0; // these lines are used to
input.index(1)--; // set the current position
input.index(2)++; // within the data set
float f = input.value();
transform_type M = input.transform(); // a valid 4x4 transformation matrix
Eigen::Transform< default_type, 3, Eigen::AffineCompact > transform_type
the type for the affine transform of an image:
Definition: types.h:234

Definition at line 69 of file base.h.

Member Function Documentation

◆ intravoxel_offset()

template<class ImageType >
template<class VectorType >
Eigen::Vector3d MR::Interp::Base< ImageType >::intravoxel_offset ( const VectorType &  pos)
inlineprotected

Definition at line 211 of file base.h.

◆ set_out_of_bounds() [1/2]

template<class ImageType >
void MR::Interp::Base< ImageType >::set_out_of_bounds ( const bool  value)
inlineprotected

Definition at line 206 of file base.h.

◆ set_out_of_bounds() [2/2]

template<class ImageType >
template<class VectorType >
bool MR::Interp::Base< ImageType >::set_out_of_bounds ( const VectorType &  pos)
inlineprotected

Definition at line 200 of file base.h.

Member Data Documentation

◆ bounds

template<class ImageType >
default_type MR::Interp::Base< ImageType >::bounds[3]
protected

Definition at line 194 of file base.h.

◆ out_of_bounds

template<class ImageType >
bool MR::Interp::Base< ImageType >::out_of_bounds
protected

Definition at line 195 of file base.h.


The documentation for this class was generated from the following file: