![]() |
aimsdata
4.7.0
Neuroimaging data handling
|
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< SparseOrDenseMatrix > | matrix () const |
carto::rc_ptr< SparseOrDenseMatrix > | matrix () |
void | setMatrix (carto::rc_ptr< SparseOrDenseMatrix > matrix) |
const BrainStuctureToMeshMap & | brainStructureMap () const |
BrainStuctureToMeshMap & | brainStructureMap () |
void | setBrainStructureMap (const BrainStuctureToMeshMap &smap) |
RoiTextureList * | roiTextureFromDimension (int dim) const |
Get ROI information for a given matrix dimension. More... | |
TextureList * | 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. 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 &) |
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.
typedef std::map<std::string, int> aims::CiftiTools::BrainStuctureToMeshMap |
Definition at line 72 of file ciftitools.h.
typedef std::vector<carto::rc_ptr<TimeTexture<int> > > aims::CiftiTools::RoiTextureList |
Definition at line 73 of file ciftitools.h.
typedef std::vector<carto::rc_ptr<TimeTexture<float> > > aims::CiftiTools::TextureList |
Definition at line 74 of file ciftitools.h.
aims::CiftiTools::CiftiTools | ( | carto::rc_ptr< SparseOrDenseMatrix > | matrix, |
const BrainStuctureToMeshMap & | smap = BrainStuctureToMeshMap() |
||
) |
aims::CiftiTools::~CiftiTools | ( | ) |
|
inline |
Definition at line 86 of file ciftitools.h.
|
inline |
Definition at line 88 of file ciftitools.h.
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
|
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)
|
static |
std::string aims::CiftiTools::dimensionType | ( | int | dim | ) | const |
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 ]
void aims::CiftiTools::getBrainModelsInfo | ( | carto::Object | cifti_info, |
RoiTextureList & | |||
) | const |
void aims::CiftiTools::getBrainModelsTexture | ( | carto::Object | cifti_info, |
TextureList & | texlist, | ||
int | dim, | ||
const std::vector< int > & | dim_indices_pos | ||
) | const |
size_t aims::CiftiTools::getBrainStructureMeshNumberOfNodes | ( | int | dim, |
const std::string & | struct_name | ||
) | const |
std::list<std::string> aims::CiftiTools::getBrainStructures | ( | int | dim, |
bool | keepSurfaces = true , |
||
bool | keepVoxels = true |
||
) | const |
carto::Object aims::CiftiTools::getDimensionObject | ( | int | dim | ) | const |
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.
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.
|
static |
void aims::CiftiTools::getParcelsInfo | ( | carto::Object | cifti_info, |
RoiTextureList & | |||
) | const |
void aims::CiftiTools::getParcelsTexture | ( | carto::Object | cifti_info, |
TextureList & | texlist, | ||
int | dim, | ||
const std::vector< int > & | dim_indices_pos | ||
) | const |
|
static |
|
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.
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 |
|
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.
|
inline |
Definition at line 81 of file ciftitools.h.
|
inline |
Definition at line 83 of file ciftitools.h.
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.
|
inline |
Definition at line 90 of file ciftitools.h.
void aims::CiftiTools::setMatrix | ( | carto::rc_ptr< SparseOrDenseMatrix > | matrix | ) |
int aims::CiftiTools::valuesDimNum | ( | ) | const |
|
static |
|
static |