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

The purpose of this class is to view an image as a 3D+vector dimension image rather than a 4+D image. Therefore all dimensions above the third are cast as a vector. If there is demand I may create a matrixx verion as well. More...

#include <accessors.h>

Inherits npl::NDConstView< T >.

Inherited by npl::LanczosInterp3DView< T >, npl::LinInterp3DView< T >, and npl::NNInterp3DView< T >.

Public Member Functions

 Vector3DConstView (std::shared_ptr< const NDArray > in)
 
 Vector3DConstView ()
 
virtual T operator() (int64_t x=0, int64_t y=0, int64_t z=0, int64_t t=0)
 Gets value at array index and then casts to T. More...
 
virtual T get (int64_t x=0, int64_t y=0, int64_t z=0, int64_t t=0)
 Gets value at array index and then casts to T. More...
 
virtual T operator() (double x=0, double y=0, double z=0, int64_t t=0)
 Gets value at array index and then casts to T. More...
 
virtual T get (double x=0, double y=0, double z=0, int64_t t=0)
 Gets value at array index and then casts to T. More...
 
void setArray (ptr< const NDArray > in)
 
int64_t tlen ()
 

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::Vector3DConstView< T >

The purpose of this class is to view an image as a 3D+vector dimension image rather than a 4+D image. Therefore all dimensions above the third are cast as a vector. If there is demand I may create a matrixx verion as well.

Template Parameters
TType of value to cast and return

Definition at line 557 of file accessors.h.

Constructor & Destructor Documentation

template<typename T>
npl::Vector3DConstView< T >::Vector3DConstView ( std::shared_ptr< const NDArray in)
inline

Definition at line 560 of file accessors.h.

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

Definition at line 563 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>
virtual T npl::Vector3DConstView< T >::get ( int64_t  x = 0,
int64_t  y = 0,
int64_t  z = 0,
int64_t  t = 0 
)
inlinevirtual

Gets value at array index and then casts to T.

Returns
value

Reimplemented in npl::LanczosInterp3DView< T >, npl::NNInterp3DView< T >, npl::LinInterp3DView< T >, and npl::LinInterp3DView< double >.

Definition at line 585 of file accessors.h.

template<typename T>
virtual T npl::Vector3DConstView< T >::get ( double  x = 0,
double  y = 0,
double  z = 0,
int64_t  t = 0 
)
inlinevirtual

Gets value at array index and then casts to T.

Returns
value

Reimplemented in npl::LanczosInterp3DView< T >, npl::NNInterp3DView< T >, npl::LinInterp3DView< T >, and npl::LinInterp3DView< double >.

Definition at line 614 of file accessors.h.

template<typename T>
virtual T npl::Vector3DConstView< T >::operator() ( int64_t  x = 0,
int64_t  y = 0,
int64_t  z = 0,
int64_t  t = 0 
)
inlinevirtual

Gets value at array index and then casts to T.

Returns
value

Reimplemented in npl::LanczosInterp3DView< T >, npl::NNInterp3DView< T >, npl::LinInterp3DView< T >, and npl::LinInterp3DView< double >.

Definition at line 571 of file accessors.h.

template<typename T>
virtual T npl::Vector3DConstView< T >::operator() ( double  x = 0,
double  y = 0,
double  z = 0,
int64_t  t = 0 
)
inlinevirtual

Gets value at array index and then casts to T.

Returns
value

Reimplemented in npl::LanczosInterp3DView< T >, npl::NNInterp3DView< T >, npl::LinInterp3DView< T >, and npl::LinInterp3DView< double >.

Definition at line 599 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>
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: