NPL
Neurological Programs and Libraries
npl::Vector3DView< 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::NDView< T >.

Public Member Functions

 Vector3DView (std::shared_ptr< NDArray > in)
 
 Vector3DView ()
 
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...
 
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...
 
void set (int64_t x, int64_t y, int64_t z, int64_t t, T v)
 Gets value at array index and then casts to T. More...
 
void setArray (ptr< 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...
 
template<typename U >
static void castsetStatic (void *ptr, const T &val)
 This is a wrapper function that will be called to safely cast to the underlying type. More...
 

Protected Attributes

std::shared_ptr< 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...
 
void(* castset )(void *ptr, const T &v)
 Function pointer to the correct function for casting to the underlying type. This should be set during construction. More...
 

Detailed Description

template<typename T>
class npl::Vector3DView< 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 697 of file accessors.h.

Constructor & Destructor Documentation

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

Definition at line 700 of file accessors.h.

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

Definition at line 703 of file accessors.h.

Member Function Documentation

template<typename T >
template<typename U >
static T npl::NDView< 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 272 of file accessors.h.

template<typename T >
template<typename U >
static void npl::NDView< T >::castsetStatic ( void *  ptr,
const T &  val 
)
inlinestaticprotectedinherited

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

Template Parameters
UUnderlying type of pixel, figured out in the constructor
Parameters
ptrPointer to memory where the pixel is.
valnew value to write

Definition at line 287 of file accessors.h.

template<typename T >
T npl::Vector3DView< T >::get ( int64_t  x = 0,
int64_t  y = 0,
int64_t  z = 0,
int64_t  t = 0 
)
inline

Gets value at array index and then casts to T.

Returns
value

Definition at line 722 of file accessors.h.

template<typename T >
T npl::Vector3DView< T >::operator() ( int64_t  x = 0,
int64_t  y = 0,
int64_t  z = 0,
int64_t  t = 0 
)
inline

Gets value at array index and then casts to T.

Returns
value

Definition at line 709 of file accessors.h.

template<typename T >
void npl::Vector3DView< T >::set ( int64_t  x,
int64_t  y,
int64_t  z,
int64_t  t,
v 
)
inline

Gets value at array index and then casts to T.

Returns
value

Definition at line 735 of file accessors.h.

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

Definition at line 73 of file accessors.h.

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

Definition at line 258 of file accessors.h.

Member Data Documentation

template<typename T >
T(* npl::NDView< 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 303 of file accessors.h.

template<typename T >
void(* npl::NDView< T >::castset) (void *ptr, const T &v)
protectedinherited

Function pointer to the correct function for casting to the underlying type. This should be set during construction.

Parameters
ptrpointer to memory
vvalue to cast and write

Definition at line 313 of file accessors.h.

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

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

Definition at line 290 of file accessors.h.


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