aimsdata  5.1.2
Neuroimaging data handling
aims::CiftiTools Class Reference

CIFTI-2 shaped matrices manipulation tools. More...

#include <aims/sparsematrix/ciftitools.h>

Public Types

typedef std::map< std::string, int > BrainStuctureToMeshMap
 
typedef std::vector< carto::rc_ptr< TimeTexture< int > > > RoiTextureList
 
typedef std::vector< carto::rc_ptr< TimeTexture< float > > > TextureList
 

Public Member Functions

 CiftiTools (carto::rc_ptr< SparseOrDenseMatrix > matrix, const BrainStuctureToMeshMap &smap=BrainStuctureToMeshMap())
 
 ~CiftiTools ()
 
const carto::rc_ptr< SparseOrDenseMatrixmatrix () const
 
carto::rc_ptr< SparseOrDenseMatrixmatrix ()
 
void setMatrix (carto::rc_ptr< SparseOrDenseMatrix > matrix)
 
const BrainStuctureToMeshMapbrainStructureMap () const
 
BrainStuctureToMeshMapbrainStructureMap ()
 
void setBrainStructureMap (const BrainStuctureToMeshMap &smap)
 
RoiTextureListroiTextureFromDimension (int dim) const
 Get ROI information for a given matrix dimension. More...
 
TextureListexpandedValueTextureFromDimension (int dim, const std::vector< int > &dim_indices_pos, TextureList *existing_tex_list=0) const
 Get matrix data in textures, possibly expanded to regions if needed. More...
 
int valuesDimNum () const
 
std::string dimensionType (int dim) const
 
carto::Object getDimensionObject (int dim) const
 
template<typename T >
void buildDimensionObjectFromLabelsTexture (int dim, const TimeTexture< T > &tex)
 buid a dimension object in a simple case where the matrix (probably non-cifti) is a reduced matrix over regions of a single mesh More...
 
void getParcelsInfo (carto::Object cifti_info, RoiTextureList &) const
 
void getBrainModelsInfo (carto::Object cifti_info, RoiTextureList &) const
 
void getBrainModelsTexture (carto::Object cifti_info, TextureList &texlist, int dim, const std::vector< int > &dim_indices_pos) const
 
void getParcelsTexture (carto::Object cifti_info, TextureList &texlist, int dim, const std::vector< int > &dim_indices_pos) const
 
std::list< std::string > getBrainStructures (int dim, bool keepSurfaces=true, bool keepVoxels=true) const
 
std::vector< int > getIndicesForBrainStructure (int dim, const std::string &struct_name) const
 Get the list of matrix indices corresponding to a given brain structure, on a given dimension. More...
 
std::vector< int > getIndicesForSurfaceIndices (int dim, int surface_num, const std::vector< int > &roi_indices) const
 Get the list of matrix indices corresponding to a given region on a mesh, for a given dimension. More...
 
size_t getBrainStructureMeshNumberOfNodes (int dim, const std::string &struct_name) const
 
bool isMatchingSurface (int dim, const AimsTimeSurface< 3, Void > &mesh, std::list< std::string > &brainmodels, int &surf_index, int surf_hint=0) const
 checks if the given mesh matches a surface description in the given dimension of the Cifti matrix. More...
 
template<typename T >
bool isMatchingTexture (int dim, const TimeTexture< T > &tex, std::list< std::string > &brainmodels, int &surf_index, int surf_hint=0) const
 checks if the given texture matches a surface description in the given dimension of the Cifti matrix. More...
 
bool isMatchingSurfaceOrTexture (int dim, size_t nvertices, const carto::Object header, std::list< std::string > &brainmodels, int &surf_index, int surf_hint=0) const
 

Static Public Member Functions

static BrainStuctureToMeshMap defaultBrainStructureToMeshMap ()
 Define the brain structure to mesh mapping: several meshes may be involved in CIFTI data mapping (typically a left hemisphere mesh and a right) More...
 
static int valuesDimNum (carto::Object cifti_info)
 
static size_t valuesDimSize (const SparseOrDenseMatrix &mat, int value_dim)
 
static std::string dimensionType (carto::Object cifti_info, int dim)
 
static void getLabelsInfo (carto::Object cifti_info, RoiTextureList &)
 
static void getSeriesInfo (carto::Object cifti_info, RoiTextureList &)
 

Detailed Description

CIFTI-2 shaped matrices manipulation tools.

This class eases manipulation of matrices (SparseOrDenseMatrix) with CIFTI information in their header. CIFTI information specify the nature of data contained in the matrix, and can bring ROIs or parcellations information.

Mainly one can obtain textures to map matrix information onto meshes. Textures may be ROI information (label textures, TimeTexture<int>), or matrix values textures, possibly expanded onto brain regions (TimeTexture<float> in this case).

Definition at line 69 of file ciftitools.h.

Member Typedef Documentation

◆ BrainStuctureToMeshMap

typedef std::map<std::string, int> aims::CiftiTools::BrainStuctureToMeshMap

Definition at line 72 of file ciftitools.h.

◆ RoiTextureList

Definition at line 73 of file ciftitools.h.

◆ TextureList

Definition at line 74 of file ciftitools.h.

Constructor & Destructor Documentation

◆ CiftiTools()

aims::CiftiTools::CiftiTools ( carto::rc_ptr< SparseOrDenseMatrix matrix,
const BrainStuctureToMeshMap smap = BrainStuctureToMeshMap() 
)

◆ ~CiftiTools()

aims::CiftiTools::~CiftiTools ( )

Member Function Documentation

◆ brainStructureMap() [1/2]

BrainStuctureToMeshMap& aims::CiftiTools::brainStructureMap ( )
inline

Definition at line 88 of file ciftitools.h.

◆ brainStructureMap() [2/2]

const BrainStuctureToMeshMap& aims::CiftiTools::brainStructureMap ( ) const
inline

Definition at line 86 of file ciftitools.h.

◆ buildDimensionObjectFromLabelsTexture()

template<typename T >
void aims::CiftiTools::buildDimensionObjectFromLabelsTexture ( int  dim,
const TimeTexture< T > &  tex 
)

buid a dimension object in a simple case where the matrix (probably non-cifti) is a reduced matrix over regions of a single mesh

◆ defaultBrainStructureToMeshMap()

static BrainStuctureToMeshMap aims::CiftiTools::defaultBrainStructureToMeshMap ( )
static

Define the brain structure to mesh mapping: several meshes may be involved in CIFTI data mapping (typically a left hemisphere mesh and a right)

◆ dimensionType() [1/2]

static std::string aims::CiftiTools::dimensionType ( carto::Object  cifti_info,
int  dim 
)
static

◆ dimensionType() [2/2]

std::string aims::CiftiTools::dimensionType ( int  dim) const

◆ expandedValueTextureFromDimension()

TextureList* aims::CiftiTools::expandedValueTextureFromDimension ( int  dim,
const std::vector< int > &  dim_indices_pos,
TextureList existing_tex_list = 0 
) const

Get matrix data in textures, possibly expanded to regions if needed.

Parcels data will be expanded to all vertices of each parcel, etc. The resulting textures can be mapped on appropriate brain meshes.

Scalar or time series data will be stored in texture timepoints.

Labels data will be stored in separate textures because they provide possibly different colormaps. In this case the returned list will have the size meshes_number * labels_number, and will be stored in this order:

[ mesh0_label0, mesh1_label0, .. meshN_label0, mesh0_label1, .. meshN_label1, .. mesh0_label0, .. meshN_labelM ]

◆ getBrainModelsInfo()

void aims::CiftiTools::getBrainModelsInfo ( carto::Object  cifti_info,
RoiTextureList  
) const

◆ getBrainModelsTexture()

void aims::CiftiTools::getBrainModelsTexture ( carto::Object  cifti_info,
TextureList texlist,
int  dim,
const std::vector< int > &  dim_indices_pos 
) const

◆ getBrainStructureMeshNumberOfNodes()

size_t aims::CiftiTools::getBrainStructureMeshNumberOfNodes ( int  dim,
const std::string &  struct_name 
) const

◆ getBrainStructures()

std::list<std::string> aims::CiftiTools::getBrainStructures ( int  dim,
bool  keepSurfaces = true,
bool  keepVoxels = true 
) const

◆ getDimensionObject()

carto::Object aims::CiftiTools::getDimensionObject ( int  dim) const

◆ getIndicesForBrainStructure()

std::vector<int> aims::CiftiTools::getIndicesForBrainStructure ( int  dim,
const std::string &  struct_name 
) const

Get the list of matrix indices corresponding to a given brain structure, on a given dimension.

◆ getIndicesForSurfaceIndices()

std::vector<int> aims::CiftiTools::getIndicesForSurfaceIndices ( int  dim,
int  surface_num,
const std::vector< int > &  roi_indices 
) const

Get the list of matrix indices corresponding to a given region on a mesh, for a given dimension.

◆ getLabelsInfo()

static void aims::CiftiTools::getLabelsInfo ( carto::Object  cifti_info,
RoiTextureList  
)
static

◆ getParcelsInfo()

void aims::CiftiTools::getParcelsInfo ( carto::Object  cifti_info,
RoiTextureList  
) const

◆ getParcelsTexture()

void aims::CiftiTools::getParcelsTexture ( carto::Object  cifti_info,
TextureList texlist,
int  dim,
const std::vector< int > &  dim_indices_pos 
) const

◆ getSeriesInfo()

static void aims::CiftiTools::getSeriesInfo ( carto::Object  cifti_info,
RoiTextureList  
)
static

◆ isMatchingSurface()

bool aims::CiftiTools::isMatchingSurface ( int  dim,
const AimsTimeSurface< 3, Void > &  mesh,
std::list< std::string > &  brainmodels,
int &  surf_index,
int  surf_hint = 0 
) const
inline

checks if the given mesh matches a surface description in the given dimension of the Cifti matrix.

Returns true if it matches, and in this case, brainmodels and surf_index are filled in accordingly. surf_hint specifies which surface (index) is tested first.

Definition at line 177 of file ciftitools.h.

References isMatchingSurfaceOrTexture().

◆ isMatchingSurfaceOrTexture()

bool aims::CiftiTools::isMatchingSurfaceOrTexture ( int  dim,
size_t  nvertices,
const carto::Object  header,
std::list< std::string > &  brainmodels,
int &  surf_index,
int  surf_hint = 0 
) const

◆ isMatchingTexture()

template<typename T >
bool aims::CiftiTools::isMatchingTexture ( int  dim,
const TimeTexture< T > &  tex,
std::list< std::string > &  brainmodels,
int &  surf_index,
int  surf_hint = 0 
) const
inline

checks if the given texture matches a surface description in the given dimension of the Cifti matrix.

Returns true if it matches, and in this case, brainmodels and surf_index are filled in accordingly. surf_hint specifies which surface (index) is tested first.

Definition at line 191 of file ciftitools.h.

References isMatchingSurfaceOrTexture().

◆ matrix() [1/2]

carto::rc_ptr<SparseOrDenseMatrix> aims::CiftiTools::matrix ( )
inline

Definition at line 83 of file ciftitools.h.

◆ matrix() [2/2]

const carto::rc_ptr<SparseOrDenseMatrix> aims::CiftiTools::matrix ( ) const
inline

Definition at line 81 of file ciftitools.h.

◆ roiTextureFromDimension()

RoiTextureList* aims::CiftiTools::roiTextureFromDimension ( int  dim) const

Get ROI information for a given matrix dimension.

If the matrix dimension defines ROIs (parcels, brain regions), textures defining these regions are built.

If the matrix dimension defines labels, an empty texture will be created, with appropriate colormap information

If the matrix dimensions defines scalars or series, this function will probably not be useful.

◆ setBrainStructureMap()

void aims::CiftiTools::setBrainStructureMap ( const BrainStuctureToMeshMap smap)
inline

Definition at line 90 of file ciftitools.h.

◆ setMatrix()

void aims::CiftiTools::setMatrix ( carto::rc_ptr< SparseOrDenseMatrix matrix)

◆ valuesDimNum() [1/2]

int aims::CiftiTools::valuesDimNum ( ) const

◆ valuesDimNum() [2/2]

static int aims::CiftiTools::valuesDimNum ( carto::Object  cifti_info)
static

◆ valuesDimSize()

static size_t aims::CiftiTools::valuesDimSize ( const SparseOrDenseMatrix mat,
int  value_dim 
)
static

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