aimsdata  5.0.5
Neuroimaging data handling
aims::GraphManip Class Reference

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 Motion talairach (const Graph &g)
 Extract Talairach transformation (graph -> Talairach) More...
 
static void storeTalairach (Graph &g, const Motion &m, bool force_old_attributes=false)
 Store Talairach transformation in graph. More...
 
static bool hasOldTalairachTransform (const Graph &g)
 Test if a Graph has the old Talairach attributes. More...
 
static bool buckets2Volume (Graph &g)
 converts internal representations of graph nodes from buckets to volume More...
 
static bool volume2Buckets (Graph &g, CreateBucketFunc f=0)
 converts internal representations of graph nodes from volume to buckets. More...
 
static GraphElementCodegraphElementCode (Graph &, const std::string &syntax, const std::string &id)
 
static GraphElementCodegraphElementCodeByAtt (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. More...
 
template<typename T >
static GraphgraphFromVolume (const AimsData< T > &vol, T background=0, std::map< T, std::string > *trans=0)
 builds a ROI graph from a volume of labels More...
 
template<typename T >
static void graphFromVolume (const AimsData< 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 More...
 
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. More...
 
static GraphmergeGraph (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)
 

Detailed Description

Various manipulations on graphs.

Definition at line 123 of file graphmanip.h.

Member Typedef Documentation

◆ CreateBucketFunc

typedef BucketMap<Void>*(* aims::GraphManip::CreateBucketFunc) (GraphObject *, const std::string &)

Definition at line 127 of file graphmanip.h.

Member Function Documentation

◆ attributeColor()

std::vector<int> aims::GraphManip::attributeColor ( const Graph graph,
const std::string &  att 
)

◆ buckets2Volume()

static bool aims::GraphManip::buckets2Volume ( Graph g)
static

converts internal representations of graph nodes from buckets to volume

Returns
false if it fails: if all buckets have not been read from disk

◆ completeGraph()

static void aims::GraphManip::completeGraph ( Graph )
static

Completes folds graph information.

Adds missing information to sulcal nodes, like meshes surface...

◆ defaultExtensionForObjectType()

static std::string aims::GraphManip::defaultExtensionForObjectType ( const std::string &  otype,
const std::string &  dtype 
)
static

Referenced by storeAims().

◆ graphElementCode()

static GraphElementCode& aims::GraphManip::graphElementCode ( Graph ,
const std::string &  syntax,
const std::string &  id 
)
static

◆ graphElementCodeByAtt()

static GraphElementCode& aims::GraphManip::graphElementCodeByAtt ( Graph ,
const std::string &  syntax,
const std::string &  attrib 
)
static

Referenced by storeAims().

◆ graphFromVolume() [1/2]

template<typename T >
static Graph* aims::GraphManip::graphFromVolume ( const AimsData< T > &  vol,
background = 0,
std::map< T, std::string > *  trans = 0 
)
static

builds a ROI graph from a volume of labels

◆ graphFromVolume() [2/2]

template<typename T >
static void aims::GraphManip::graphFromVolume ( const AimsData< T > &  vol,
Graph g,
background = 0,
std::map< T, std::string > *  trans = 0,
bool  automaticBackgroundSearch = true 
)
static

builds a ROI graph from a volume of labels

◆ hasOldTalairachTransform()

static bool aims::GraphManip::hasOldTalairachTransform ( const Graph g)
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.

◆ mergeGraph()

static Graph* aims::GraphManip::mergeGraph ( const std::string &  ,
Graph ,
Graph ,
bool  mergeMesh = true,
bool  invNormal = false 
)
static

◆ printGraphElementTable()

static void aims::GraphManip::printGraphElementTable ( const Graph ,
std::ostream &  ostr = std::cout 
)
static

◆ setAttributeColor() [1/3]

static void aims::GraphManip::setAttributeColor ( Graph graph,
const std::string &  att,
const AimsRGB  
)
static

◆ setAttributeColor() [2/3]

static void aims::GraphManip::setAttributeColor ( Graph graph,
const std::string &  att,
const AimsRGBA  
)
static

◆ setAttributeColor() [3/3]

static void aims::GraphManip::setAttributeColor ( Graph graph,
const std::string &  att,
const std::vector< int > &   
)
static

◆ storeAims()

template<typename T >
void aims::GraphManip::storeAims ( Graph graph,
GraphObject vertex,
const std::string &  attribute,
carto::rc_ptr< T >  obj 
)
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, defaultExtensionForObjectType(), aims::GraphElementCode::global_filename, aims::GraphElementCode::global_index_attribute, graphElementCodeByAtt(), aims::GraphElementCode::local_file_attribute, and aims::GraphElementCode::objectType.

Referenced by aims::Tex2Graph< T >::makeGraph().

◆ storeTalairach()

static void aims::GraphManip::storeTalairach ( Graph g,
const Motion m,
bool  force_old_attributes = false 
)
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.

◆ talairach()

static Motion aims::GraphManip::talairach ( const Graph g)
static

Extract Talairach transformation (graph -> Talairach)

The transformation is returned from one of these sources, in order of priority:

  1. The "transformations" attribute, corresponding to the "Talairach-AC/PC-Anatomist" referential.
  2. The legacy "Talairach_translation", "Talairach_rotation", and "Talairach_scale" attributes.
  3. Otherwise, identity is returned.

◆ volume2Buckets()

static bool aims::GraphManip::volume2Buckets ( Graph g,
CreateBucketFunc  f = 0 
)
static

converts internal representations of graph nodes from volume to buckets.

Returns
false if it fails: if all volumes have not been read from disk

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