ISIS Core Library 0.7.2 (api 3.0.0)
Public Member Functions | Static Public Attributes | Protected Member Functions

isis::data::_internal::NDimensional< DIMS > Class Template Reference

#include <ndimensional.hpp>

Public Member Functions

void getCoordsFromLinIndex (const size_t index, size_t d[DIMS]) const
 Compute coordinates from linear index,.
size_t getDimSize (size_t idx) const
util::FixedVector< float, DIMS > getFoV (const util::FixedVector< float, DIMS > &voxelSize, const util::FixedVector< float, DIMS > &voxelGap) const
size_t getLinearIndex (const util::FixedVector< size_t, DIMS > &d) const
size_t getLinearIndex (const size_t d[DIMS]) const
 Compute linear index from n-dimensional index,.
size_t getRelevantDims () const
 get amount of relevant dimensions (last dim with size>1) e.g.
std::string getSizeAsString (std::string delim="x") const
 generates a string representing the size
util::FixedVector< size_t, DIMS > getSizeAsVector () const
 generates a FixedVector<DIMS> representing the size
size_t getVolume () const
 Get the size of the object in elements of TYPE.
void init (const util::FixedVector< size_t, DIMS > &d)
void init (const size_t d[DIMS])
 Initializes the size-vector.
bool isInRange (const size_t d[DIMS]) const
 Check if index fits into the dimensional size of the object.
 NDimensional (const NDimensional &src)

Static Public Attributes

static const size_t dims = DIMS

Protected Member Functions

 NDimensional ()

Detailed Description

template<unsigned short DIMS>
class isis::data::_internal::NDimensional< DIMS >

Base class for anything that has dimensional size

Definition at line 61 of file ndimensional.hpp.


Constructor & Destructor Documentation

template<unsigned short DIMS>
isis::data::_internal::NDimensional< DIMS >::NDimensional ( ) [inline, protected]

Definition at line 65 of file ndimensional.hpp.

template<unsigned short DIMS>
isis::data::_internal::NDimensional< DIMS >::NDimensional ( const NDimensional< DIMS > &  src) [inline]

Definition at line 81 of file ndimensional.hpp.


Member Function Documentation

template<unsigned short DIMS>
void isis::data::_internal::NDimensional< DIMS >::getCoordsFromLinIndex ( const size_t  index,
size_t  d[DIMS] 
) const [inline]

Compute coordinates from linear index,.

Parameters:
darray to put the computed coordinates in (d[0] will be most iterating element / lowest dimension)
indexthe linear index to compute the coordinates from

Definition at line 100 of file ndimensional.hpp.

template<unsigned short DIMS>
size_t isis::data::_internal::NDimensional< DIMS >::getDimSize ( size_t  idx) const [inline]
Returns:
the size of the object in the given dimension

Definition at line 119 of file ndimensional.hpp.

template<unsigned short DIMS>
util::FixedVector<float, DIMS> isis::data::_internal::NDimensional< DIMS >::getFoV ( const util::FixedVector< float, DIMS > &  voxelSize,
const util::FixedVector< float, DIMS > &  voxelGap 
) const [inline]

Definition at line 149 of file ndimensional.hpp.

template<unsigned short DIMS>
size_t isis::data::_internal::NDimensional< DIMS >::getLinearIndex ( const size_t  d[DIMS]) const [inline]

Compute linear index from n-dimensional index,.

Parameters:
darray of indexes (d[0] is most iterating element / lowest dimension)

Definition at line 88 of file ndimensional.hpp.

template<unsigned short DIMS>
size_t isis::data::_internal::NDimensional< DIMS >::getLinearIndex ( const util::FixedVector< size_t, DIMS > &  d) const [inline]

Compute linear index from n-dimensional index,.

Parameters:
darray of indexes (d[0] is most iterating element / lowest dimension)

Definition at line 92 of file ndimensional.hpp.

template<unsigned short DIMS>
size_t isis::data::_internal::NDimensional< DIMS >::getRelevantDims ( ) const [inline]

get amount of relevant dimensions (last dim with size>1) e.g.

on a slice (1x64x1x1) it will be 2

Definition at line 137 of file ndimensional.hpp.

template<unsigned short DIMS>
std::string isis::data::_internal::NDimensional< DIMS >::getSizeAsString ( std::string  delim = "x") const [inline]

generates a string representing the size

Definition at line 124 of file ndimensional.hpp.

template<unsigned short DIMS>
util::FixedVector<size_t, DIMS> isis::data::_internal::NDimensional< DIMS >::getSizeAsVector ( ) const [inline]

generates a FixedVector<DIMS> representing the size

Definition at line 129 of file ndimensional.hpp.

template<unsigned short DIMS>
size_t isis::data::_internal::NDimensional< DIMS >::getVolume ( ) const [inline]

Get the size of the object in elements of TYPE.

Returns:
$ \prod_{i=0}^{DIMS-1} getDimSize(i) $

Definition at line 115 of file ndimensional.hpp.

template<unsigned short DIMS>
void isis::data::_internal::NDimensional< DIMS >::init ( const util::FixedVector< size_t, DIMS > &  d) [inline]

Definition at line 77 of file ndimensional.hpp.

template<unsigned short DIMS>
void isis::data::_internal::NDimensional< DIMS >::init ( const size_t  d[DIMS]) [inline]

Initializes the size-vector.

This must be done before anything else, or behaviour will be undefined.

Parameters:
darray with sizes to use. (d[0] is most iterating element / lowest dimension)

Definition at line 73 of file ndimensional.hpp.

template<unsigned short DIMS>
bool isis::data::_internal::NDimensional< DIMS >::isInRange ( const size_t  d[DIMS]) const [inline]

Check if index fits into the dimensional size of the object.

Parameters:
dindex to be checked (d[0] is most iterating element / lowest dimension)
Returns:
true if given index will get a reasonable result when used for getLinearIndex

Definition at line 108 of file ndimensional.hpp.


Field Documentation

template<unsigned short DIMS>
const size_t isis::data::_internal::NDimensional< DIMS >::dims = DIMS [static]

Definition at line 67 of file ndimensional.hpp.


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