NPL
Neurological Programs and Libraries
npl::LinInterpNDView< T > Class Template Reference

The purpose of this class is to view an image as a continuous ND image and to sample at a continuous ND-position within. More...

#include <accessors.h>

Inherits npl::NDConstView< T >.

Public Member Functions

 LinInterpNDView (std::shared_ptr< const NDArray > in, BoundaryConditionT bound=ZEROFLUX)
 
 LinInterpNDView ()
 
operator() (double x=0, double y=0, double z=0, double t=0, double u=0, double v=0, double w=0, double q=0)
 Gets value at array index and then casts to T. More...
 
operator() (const std::vector< float > &index)
 Gets value at array index and then casts to T. More...
 
operator() (const std::vector< double > &index)
 Gets value at array index and then casts to T. More...
 
operator() (std::initializer_list< double > index)
 Gets value at array index and then casts to T. More...
 
operator() (std::initializer_list< float > index)
 Gets value at array index and then casts to T. More...
 
get (const vector< double > &cindex)
 Gets value at array index and then casts to T. More...
 
get (const std::vector< int64_t > &index)
 Gets value at array index and then casts to T. More...
 
get (size_t len, int64_t *index)
 Gets value at array index and then casts to T. More...
 
operator[] (const std::vector< int64_t > &index)
 Gets value at array index and then casts to T. More...
 
get (size_t len, const double *incindex)
 Gets value at array index and then casts to T. More...
 
void setArray (ptr< const NDArray > in)
 
int64_t tlen ()
 

Public Attributes

BoundaryConditionT m_boundmethod
 
bool m_ras
 if true, then this assumes the inputs are RAS coordinates rather than indexes. Default is false More...
 

Protected Member Functions

operator[] (int64_t i)
 Gets value at array index and then casts to T doesn't make sense for interpolation. More...
 

Static Protected Member Functions

template<typename U >
static T castgetStatic (void *ptr)
 This is a wrapper function that will be called to safely cast from the underlying type. More...
 

Protected Attributes

std::shared_ptr< const NDArrayparent
 Where to get the dat a from. Also the shared_ptr prevents dealloc. More...
 
T(* castget )(void *ptr)
 Function pointer to the correct function for casting from the underlying type. More...
 

Detailed Description

template<typename T>
class npl::LinInterpNDView< T >

The purpose of this class is to view an image as a continuous ND image and to sample at a continuous ND-position within.

Template Parameters
TType of value to cast and return

Definition at line 879 of file accessors.h.

Constructor & Destructor Documentation

template<typename T >
npl::LinInterpNDView< T >::LinInterpNDView ( std::shared_ptr< const NDArray in,
BoundaryConditionT  bound = ZEROFLUX 
)
inline

Definition at line 882 of file accessors.h.

template<typename T >
npl::LinInterpNDView< T >::LinInterpNDView ( )
inline

Definition at line 887 of file accessors.h.

Member Function Documentation

template<typename T>
template<typename U >
static T npl::NDConstView< T >::castgetStatic ( void *  ptr)
inlinestaticprotectedinherited

This is a wrapper function that will be called to safely cast from the underlying type.

Template Parameters
UUnderlying type of pixel, figured out in the constructor
Parameters
ptrPointer to memory where the pixel is.
Returns
Correctly cast value

Definition at line 467 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::get ( const vector< double > &  cindex)
inline

Gets value at array index and then casts to T.

Returns
value

Definition at line 979 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::get ( const std::vector< int64_t > &  index)
inline

Gets value at array index and then casts to T.

Parameters
indexn-d index to access
Returns
value

Definition at line 991 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::get ( size_t  len,
int64_t *  index 
)
inline

Gets value at array index and then casts to T.

Parameters
lenlength of index array
indexn-d index to access
Returns
value

Definition at line 1009 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::get ( size_t  len,
const double *  incindex 
)
inline

Gets value at array index and then casts to T.

Returns
value

Definition at line 1040 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator() ( double  x = 0,
double  y = 0,
double  z = 0,
double  t = 0,
double  u = 0,
double  v = 0,
double  w = 0,
double  q = 0 
)
inline

Gets value at array index and then casts to T.

Parameters
xx-dimension
yy-dimension
zz-dimension
t4th dimension
u5th dimension
v6th dimension
w7th dimension
q8th dimension
Returns
value Interpolated value at given position

Definition at line 903 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator() ( const std::vector< float > &  index)
inline

Gets value at array index and then casts to T.

Parameters
indexPosition in ND-space to interpolate
Returns
value Interpolated value at given position

Definition at line 918 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator() ( const std::vector< double > &  index)
inline

Gets value at array index and then casts to T.

Parameters
indexPosition in ND-space to interpolate
Returns
value Interpolated value at given position

Definition at line 935 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator() ( std::initializer_list< double >  index)
inline

Gets value at array index and then casts to T.

Parameters
indexPosition in ND-space to interpolate
Returns
value Interpolated value at given position

Definition at line 947 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator() ( std::initializer_list< float >  index)
inline

Gets value at array index and then casts to T.

Parameters
indexPosition in ND-space to interpolate
Returns
value Interpolated value at given position

Definition at line 964 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator[] ( const std::vector< int64_t > &  index)
inline

Gets value at array index and then casts to T.

Parameters
indexn-d index to access
Returns
value

Definition at line 1025 of file accessors.h.

template<typename T >
T npl::LinInterpNDView< T >::operator[] ( int64_t  i)
inlineprotected

Gets value at array index and then casts to T doesn't make sense for interpolation.

Returns
value

Definition at line 1124 of file accessors.h.

template<typename T>
void npl::NDConstView< T >::setArray ( ptr< const NDArray in)
inlineinherited

Definition at line 334 of file accessors.h.

template<typename T>
int64_t npl::NDConstView< T >::tlen ( )
inlineinherited

Definition at line 453 of file accessors.h.

Member Data Documentation

template<typename T>
T(* npl::NDConstView< T >::castget) (void *ptr)
protectedinherited

Function pointer to the correct function for casting from the underlying type.

Parameters
ptrlocation in memory where the pixel is stored

Definition at line 483 of file accessors.h.

template<typename T >
BoundaryConditionT npl::LinInterpNDView< T >::m_boundmethod

Definition at line 1108 of file accessors.h.

template<typename T >
bool npl::LinInterpNDView< T >::m_ras

if true, then this assumes the inputs are RAS coordinates rather than indexes. Default is false

Definition at line 1114 of file accessors.h.

template<typename T>
std::shared_ptr<const NDArray> npl::NDConstView< T >::parent
protectedinherited

Where to get the dat a from. Also the shared_ptr prevents dealloc.

Definition at line 470 of file accessors.h.


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