![]() |
aimsdata 6.0.0
Neuroimaging data handling
|
Various manipulations on graphs. More...
#include <aims/graph/graphmanip.h>
Public Types | |
| typedef BucketMap< Void > *(* | CreateBucketFunc) (GraphObject *, const std::string &) |
Public Member Functions | |
| std::vector< int > | attributeColor (const Graph &graph, const std::string &att) |
Static Public Member Functions | |
| static AffineTransformation3d | talairach (const Graph &g) |
| Extract Talairach transformation (graph -> Talairach) | |
| static void | storeTalairach (Graph &g, const AffineTransformation3d &m, bool force_old_attributes=false) |
| Store Talairach transformation in graph. | |
| static bool | hasOldTalairachTransform (const Graph &g) |
| Test if a Graph has the old Talairach attributes. | |
| static AffineTransformation3d | getICBMTransform (const Graph &g) |
| Extract the transformation to the MNI ICBM152 space. | |
| static AffineTransformation3d | getICBM2009cTemplateTransform (const Graph &g) |
| Extract the transformation to the MNI ICBM152 space, shifted to the "most standard" field of view of the template image, the one from the ICBM2009c_nlin_asym template from the MNI. | |
| static bool | buckets2Volume (Graph &g) |
| converts internal representations of graph nodes from buckets to volume | |
| static bool | volume2Buckets (Graph &g, CreateBucketFunc f=0) |
| converts internal representations of graph nodes from volume to buckets. | |
| static GraphElementCode & | graphElementCode (Graph &, const std::string &syntax, const std::string &id) |
| static GraphElementCode & | graphElementCodeByAtt (Graph &, const std::string &syntax, const std::string &attrib) |
| template<typename T> | |
| static void | storeAims (Graph &graph, GraphObject *vertex, const std::string &attribute, carto::rc_ptr< T > obj) |
| This template function stores the given object in the given Vertex / Edge of the graph and takes care of IO information to maintain in the graph. | |
| template<typename T> | |
| static Graph * | graphFromVolume (const carto::rc_ptr< carto::Volume< T > > &vol, T background=0, std::map< T, std::string > *trans=0) |
| builds a ROI graph from a volume of labels | |
| template<typename T> | |
| static void | graphFromVolume (const carto::rc_ptr< carto::Volume< T > > &vol, Graph &g, T background=0, std::map< T, std::string > *trans=0, bool automaticBackgroundSearch=true) |
| builds a ROI graph from a volume of labels | |
| static void | setAttributeColor (Graph &graph, const std::string &att, const AimsRGB &) |
| static void | setAttributeColor (Graph &graph, const std::string &att, const AimsRGBA &) |
| static void | setAttributeColor (Graph &graph, const std::string &att, const std::vector< int > &) |
| static void | completeGraph (Graph &) |
| Completes folds graph information. | |
| static Graph * | mergeGraph (const std::string &, Graph &, Graph &, bool mergeMesh=true, bool invNormal=false) |
| static void | printGraphElementTable (const Graph &, std::ostream &ostr=std::cout) |
| static std::string | defaultExtensionForObjectType (const std::string &otype, const std::string &dtype) |
| static std::list< Edge * > | getPath (const Vertex *from, const Vertex *to) |
| Get edges path from a vertex to another one. | |
Various manipulations on graphs.
Definition at line 125 of file graphmanip.h.
| typedef BucketMap< Void > *(* aims::GraphManip::CreateBucketFunc) (GraphObject *, const std::string &) |
Definition at line 128 of file graphmanip.h.
| std::vector< int > aims::GraphManip::attributeColor | ( | const Graph & | graph, |
| const std::string & | att ) |
|
static |
converts internal representations of graph nodes from buckets to volume
|
static |
Completes folds graph information.
Adds missing information to sulcal nodes, like meshes surface...
|
static |
Referenced by storeAims().
|
static |
Extract the transformation to the MNI ICBM152 space, shifted to the "most standard" field of view of the template image, the one from the ICBM2009c_nlin_asym template from the MNI.
Actually we find various fields of view for the templates. The one we use here is (193, 229, 193). The transform to the "real" ICBM space (0 roughly at AC) is provided in the output transformation header. This space has a fixed transformation with our Aims Talairach, along with the template volume size and voxel size. Includes shifts and axes inversions.
|
static |
Extract the transformation to the MNI ICBM152 space.
This space has a fixed transformation with our Aims Talairach.
|
static |
Get edges path from a vertex to another one.
Adapted from Yann Leprince's code on: https://github.com/HumanBrainProject/hbp-spatial-backend/blob/fc79a6adc5d71fe6a02021f0d36698c5fde86b43/hbp_spatial_backend/transform_graph.py#L36
TODO: detect ambiguities (multiple same-length chains)
|
static |
|
static |
Referenced by storeAims().
|
static |
builds a ROI graph from a volume of labels
|
static |
builds a ROI graph from a volume of labels
|
static |
Test if a Graph has the old Talairach attributes.
These attributes are "Talairach_translation", "Talairach_rotation" (both required), and "Talairach_scale" (optional). The modern way of storing the transformation to Talairach is in the "referentials" and "transformations" attributes.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
This template function stores the given object in the given Vertex / Edge of the graph and takes care of IO information to maintain in the graph.
More precisely, it calls GraphObject::setProperty and fills the GraphElementTable accordingly in the graph
Definition at line 46 of file graphmanip_d.h.
References aims::GraphElementCode::attribute, aims::GraphElementCode::dataType, carto::DataTypeCode< class T >::dataType(), defaultExtensionForObjectType(), aims::GraphElementCode::global_filename, aims::GraphElementCode::global_index_attribute, graphElementCodeByAtt(), aims::GraphElementCode::local_file_attribute, aims::GraphElementCode::objectType, and carto::DataTypeCode< class T >::objectType().
Referenced by aims::Tex2Graph< T >::makeGraph().
|
static |
Store Talairach transformation in graph.
The transformation is written in the modern attributes ("referentials" and "transformations"). It is also written to the legacy attributes ("Talairach_translation", "Talairach_rotation", and "Talairach_scale"), if these are already present, or if force_old_attributes is true.
|
static |
Extract Talairach transformation (graph -> Talairach)
The transformation is returned from one of these sources, in order of priority:
|
static |
converts internal representations of graph nodes from volume to buckets.