CiftiLib
A C++ library for CIFTI-2 and CIFTI-1 files
cifti::VolumeSpace Class Reference

Public Types

enum  OrientTypes {
  LEFT_TO_RIGHT = 0 , RIGHT_TO_LEFT = 4 , POSTERIOR_TO_ANTERIOR = 1 , ANTERIOR_TO_POSTERIOR = 5 ,
  INFERIOR_TO_SUPERIOR = 2 , SUPERIOR_TO_INFERIOR = 6
}
 

Public Member Functions

 VolumeSpace (const int64_t dims[3], const std::vector< std::vector< float > > &sform)
 
 VolumeSpace (const int64_t dims[3], const float sform[12])
 
void setSpace (const int64_t dims[3], const std::vector< std::vector< float > > &sform)
 
void setSpace (const int64_t dims[3], const float sform[12])
 
const int64_t * getDims () const
 
const std::vector< std::vector< float > > & getSform () const
 
void getSpacingVectors (Vector3D &iStep, Vector3D &jStep, Vector3D &kStep, Vector3D &origin) const
 
bool matchesVolumeSpace (const VolumeSpace &right) const
 
bool operator== (const VolumeSpace &right) const
 
bool operator!= (const VolumeSpace &right) const
 
bool isPlumb () const
 returns true if volume space is not skew, and each axis and index is separate
 
void getOrientAndSpacingForPlumb (OrientTypes *orientOut, float *spacingOut, float *originOut) const
 returns orientation, spacing, and center (spacing/center can be negative, spacing/center is LPI rearranged to ijk (first dimension uses first element), will assert false if isOblique is true)
 
void getOrientation (OrientTypes orientOut[3]) const
 get just orientation, even for non-plumb volumes
 
template<typename T >
void indexToSpace (const T *indexIn, float *coordOut) const
 returns coordinate triplet of an index triplet
 
template<typename T >
void indexToSpace (const T &indexIn1, const T &indexIn2, const T &indexIn3, float *coordOut) const
 returns coordinate triplet of three indices
 
template<typename T >
void indexToSpace (const T *indexIn, float &coordOut1, float &coordOut2, float &coordOut3) const
 returns three coordinates of an index triplet
 
template<typename T >
void indexToSpace (const T &indexIn1, const T &indexIn2, const T &indexIn3, float &coordOut1, float &coordOut2, float &coordOut3) const
 returns three coordinates of three indices
 
void spaceToIndex (const float *coordIn, float *indexOut) const
 returns floating point index triplet of a given coordinate triplet
 
void spaceToIndex (const float &coordIn1, const float &coordIn2, const float &coordIn3, float *indexOut) const
 returns floating point index triplet of three given coordinates
 
void spaceToIndex (const float *coordIn, float &indexOut1, float &indexOut2, float &indexOut3) const
 returns three floating point indexes of a given coordinate triplet
 
void spaceToIndex (const float &coordIn1, const float &coordIn2, const float &coordIn3, float &indexOut1, float &indexOut2, float &indexOut3) const
 returns three floating point indexes of three given coordinates
 
void enclosingVoxel (const float *coordIn, int64_t *indexOut) const
 returns integer index triplet of voxel whose center is closest to the coordinate triplet
 
void enclosingVoxel (const float &coordIn1, const float &coordIn2, const float &coordIn3, int64_t *indexOut) const
 returns integer index triplet of voxel whose center is closest to the three coordinates
 
void enclosingVoxel (const float *coordIn, int64_t &indexOut1, int64_t &indexOut2, int64_t &indexOut3) const
 returns integer indexes of voxel whose center is closest to the coordinate triplet
 
void enclosingVoxel (const float &coordIn1, const float &coordIn2, const float &coordIn3, int64_t &indexOut1, int64_t &indexOut2, int64_t &indexOut3) const
 returns integer indexes of voxel whose center is closest to the three coordinates
 
template<typename T >
bool indexValid (const T *indexIn) const
 
bool indexValid (const int64_t &indexIn1, const int64_t &indexIn2, const int64_t &indexIn3) const
 checks if an index is within array dimensions
 
int64_t getIndex (const int64_t &indexIn1, const int64_t &indexIn2, const int64_t &indexIn3) const
 
template<typename T >
int64_t getIndex (const T *indexIn) const
 
void readCiftiXML1 (XmlReader &xml)
 
void readCiftiXML2 (XmlReader &xml)
 
void writeCiftiXML1 (XmlWriter &xml) const
 
void writeCiftiXML2 (XmlWriter &xml) const
 

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