SiGraph: sulcal graphs


labelsTranslator.h
Go to the documentation of this file.
1
2#ifndef SI_FOLD_LABELSTRANSLATOR_H
3#define SI_FOLD_LABELSTRANSLATOR_H
4
5
6#include <map>
7#include <string>
8#include <si/graph/cgraph.h>
9
10class Tree;
11
12namespace aims
13{
14 class SelectionSet;
15}
16
17
18namespace sigraph
19{
20
26 class FoldLabelsTranslator : public std::map<std::string, std::string>
27 {
28 public:
29 FoldLabelsTranslator() : std::map<std::string, std::string>() {}
30 FoldLabelsTranslator( const std::string & filename )
31 : std::map<std::string, std::string>()
32 { readLabels( filename ); }
34 const std::string & filename = "" )
35 : std::map<std::string, std::string>()
36 { makeFromModel( mg, filename ); }
38
43 void readLabels( const std::string & filename );
49 void makeFromModel( const MGraph & mg, const std::string & filename );
55 void translate( CGraph & gr, const std::string & ilabel="name",
56 const std::string & olabel="name",
57 const std::string & altilabel = "" ) const;
58 std::string lookupLabel( std::string label ) const;
59
60 protected:
61 bool readJFM95( const std::string & filename );
62 bool readHierarchy( const std::string & filename );
63 bool readSelection( const std::string & filename );
64 bool makeFromModelJFM95( const MGraph & mg, const std::string & filename );
65 bool makeFromModelHierarchy( const MGraph & mg,
66 const std::string & filename );
67 /* bool makeFromModelSelection( const MGraph & mg,
68 const std::string & filename ); */
69
70 private:
71 void insertTree( const Tree & t );
72 void insertTree( const Tree & t, const std::set<std::string> & mnames );
73 void insertSelection( const aims::SelectionSet & );
74 };
75
76}
77
78#endif
79
80
Graphes avec étiquettes et gestion de cliques (classe abstraite).
Definition cgraph.h:37
void translate(CGraph &gr, const std::string &ilabel="name", const std::string &olabel="name", const std::string &altilabel="") const
Change les labels d'un graphe.
bool makeFromModelHierarchy(const MGraph &mg, const std::string &filename)
std::string lookupLabel(std::string label) const
bool makeFromModelJFM95(const MGraph &mg, const std::string &filename)
bool readJFM95(const std::string &filename)
bool readSelection(const std::string &filename)
bool readHierarchy(const std::string &filename)
void makeFromModel(const MGraph &mg, const std::string &filename)
Initializes table from a file AND a model graph.
FoldLabelsTranslator(const MGraph &mg, const std::string &filename="")
FoldLabelsTranslator(const std::string &filename)
void readLabels(const std::string &filename)
Initialise la table à partir d'un fichier.
Graph modèle (classe abstraite).
Definition mgraph.h:48
STL namespace.