Developer documentation
Version 3.0.3-105-gd3941f44
MR::Interp::SplineInterpBase< ImageType, SplineType, PType > Class Template Reference

This class provides access to the voxel intensities of an image using cubic spline interpolation. More...

#include "interp/cubic.h"

Inheritance diagram for MR::Interp::SplineInterpBase< ImageType, SplineType, PType >:
MR::Interp::Base< ImageType > MR::Transform MR::Interp::SplineInterp< ImageType, SplineType, PType >

Protected Member Functions

ssize_t clamp (ssize_t x, ssize_t dim) const
 
- Protected Member Functions inherited from MR::Interp::Base< ImageType >
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

SplineType H [3]
 
Eigen::Vector3d P
 
- Protected Attributes inherited from MR::Interp::Base< ImageType >
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 SplineType, Math::SplineProcessingType PType>
class MR::Interp::SplineInterpBase< ImageType, SplineType, PType >

This class provides access to the voxel intensities of an image using cubic spline interpolation.

Interpolation is only performed along the first 3 (spatial) axes. The (integer) position along the remaining axes should be set using the template DataSet 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 72 of file cubic.h.

Member Function Documentation

◆ clamp()

template<class ImageType , class SplineType , Math::SplineProcessingType PType>
ssize_t MR::Interp::SplineInterpBase< ImageType, SplineType, PType >::clamp ( ssize_t  x,
ssize_t  dim 
) const
inlineprotected

Definition at line 85 of file cubic.h.

Member Data Documentation

◆ H

template<class ImageType , class SplineType , Math::SplineProcessingType PType>
SplineType MR::Interp::SplineInterpBase< ImageType, SplineType, PType >::H[3]
protected

Definition at line 82 of file cubic.h.

◆ P

template<class ImageType , class SplineType , Math::SplineProcessingType PType>
Eigen::Vector3d MR::Interp::SplineInterpBase< ImageType, SplineType, PType >::P
protected

Definition at line 83 of file cubic.h.


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