SiGraph: sulcal graphs


sigraph::MGraph Class Referenceabstract

Graph modèle (classe abstraite). More...

#include <si/graph/mgraph.h>

Inheritance diagram for sigraph::MGraph:
Collaboration diagram for sigraph::MGraph:

Classes

struct  VersionCheck
 Model-data version check result. More...
 

Public Types

enum  VersionStatus { Unversioned , VersionOk , Outdated }
 used for model-data version compatibility check More...
 
- Public Types inherited from Graph
typedef std::set< Vertex * > VSet
 
typedef std::set< Edge * > ESet
 
typedef carto::rc_ptr< GraphFactoryFactoryPtr
 
typedef VSet::value_type value_type
 
typedef VSet::pointer pointer
 
typedef VSet::reference reference
 
typedef VSet::const_reference const_reference
 
typedef VSet::iterator iterator
 
typedef VSet::const_iterator const_iterator
 
typedef VSet::reverse_iterator reverse_iterator
 
typedef VSet::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from carto::SyntaxedObject< PropertySet >
typedef internal::SyntaxedObjectSwitch< T, SUPERSUBCLASS(Interface, T)>::ContentType ContentType
 

Public Member Functions

virtual ~MGraph ()
 
virtual ModelFindermodelFinder ()=0
 Renvoie un sélecteur de modèle adapté au graphe modèle.
 
virtual void clearAll ()
 
virtual std::string domainFile (const std::string &graphname, const carto::AttributedObject *ao)
 
virtual std::string modelFile (const std::string &graphname, const carto::AttributedObject *ao, std::set< std::string > &otherFiles)
 
virtual void closeLearning ()
 Ferme l'apprentissage de tous les modèles.
 
virtual void initStats ()
 Initialise les stats.
 
virtual void initAdap ()
 Initialise les partie adaptatives (réseaux de neurones et autres)
 
virtual void initDomain ()
 Initialise les domaines d'influence.
 
virtual void removeUnusedModels (bool removeFiles=false, const std::string &prefix="")
 Elimine les noeuds et relations non-utilisés (de domaine vide)
 
virtual unsigned removeRareEdges (float freqmin)
 Enlève les relations peu fréquentes (max.
 
virtual void removeEdgesToVoid ()
 Enlève les relations avec le label 'brain'.
 
virtual void setWeights (double factor=1.)
 Fixe les poids des modèles des noeuds.
 
virtual void removeWeights ()
 Enlève les poids des modèles des noeuds.
 
virtual VersionCheck checkCompatibility (const Graph &data) const
 Checks compatibility between this model graph and the given data graph.
 
- Public Member Functions inherited from Graph
 Graph (const std::string &s="")
 
 Graph (const FactoryPtr factory, const std::string &s="")
 
virtual ~Graph ()
 
void extract (Graph &graph, InputIterator iv1, InputIterator iv2)
 
void clear ()
 
VertexaddVertex (const std::string &s="")
 
VertexcloneVertex (const Vertex *vertex)
 
bool hasVertex (const Vertex *vertex) const
 
void removeVertex (Vertex *vertex)
 
VertexrandomVertex () const
 
const std::set< Vertex * > & vertices () const
 
std::set< Vertex * > getVerticesWith (const std::string &s) const
 
std::set< Vertex * > getVerticesWith (const std::string &s, const T &t) const
 
EdgeaddUndirectedEdge (Vertex *vertex1, Vertex *vertex2, std::string s)
 
EdgeaddEdge (Vertex *vertex1, Vertex *vertex2, std::string s="")
 
EdgeaddDirectedEdge (Vertex *vertex1, Vertex *vertex2, std::string s)
 
bool hasEdge (const Edge *edge) const
 
void removeEdge (Edge *edge)
 
const std::set< Edge * > & edges () const
 
std::set< Edge * > edges (const Vertex *vertex1, const Vertex *vertex2) const
 
std::set< Edge * > getEdgesWith (const std::string &s) const
 
std::set< Edge * > getEdgesWith (const std::string &s, const T &t) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
size_t order () const
 
size_t size () const __attribute__((__deprecated__("use edgeSize() for " "the number of edges. In a future release
 
size_t size () will return the " "number properties as it does in GenericObject")))
 
size_t edgesSize () const
 
virtual bool isUndirected () const
 
virtual bool isDirected () const
 
virtual bool check (const carto::SyntaxSet &syntax, std::set< std::string > &missing) const
 
void clear ()
 
VertexaddVertex (const std::string &s="")
 
VertexcloneVertex (const Vertex *vertex)
 
bool hasVertex (const Vertex *vertex) const
 
void removeVertex (Vertex *vertex)
 
VertexrandomVertex () const
 
const std::set< Vertex * > & vertices () const
 
std::set< Vertex * > getVerticesWith (const std::string &s) const
 
std::set< Vertex * > getVerticesWith (const std::string &s, const T &t) const
 
EdgeaddUndirectedEdge (Vertex *vertex1, Vertex *vertex2, std::string s)
 
EdgeaddEdge (Vertex *vertex1, Vertex *vertex2, std::string s="")
 
EdgeaddDirectedEdge (Vertex *vertex1, Vertex *vertex2, std::string s)
 
bool hasEdge (const Edge *edge) const
 
void removeEdge (Edge *edge)
 
const std::set< Edge * > & edges () const
 
std::set< Edge * > edges (const Vertex *vertex1, const Vertex *vertex2) const
 
std::set< Edge * > getEdgesWith (const std::string &s) const
 
std::set< Edge * > getEdgesWith (const std::string &s, const T &t) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
size_t order () const
 
size_t size () const __attribute__((__deprecated__("use edgeSize() for " "the number of edges. In a future release
 
size_t size () will return the " "number properties as it does in GenericObject")))
 
size_t edgesSize () const
 
virtual bool isUndirected () const
 
virtual bool isDirected () const
 
virtual bool check (const carto::SyntaxSet &syntax, std::set< std::string > &missing) const
 
- Public Member Functions inherited from GraphObject
virtual ~GraphObject ()
 
- Public Member Functions inherited from carto::SyntaxedObject< PropertySet >
 SyntaxedObject (const std::string &s)
 
 SyntaxedObject (const SyntaxedObject &x)
 
 SyntaxedObject (const SyntaxedObject< PropertySet > &x)
 
 SyntaxedObject (const std::string &s)
 
 SyntaxedObject (const SyntaxedObject &x)
 
 SyntaxedObject (const SyntaxedObject< PropertySet > &x)
 

Protected Member Functions

 MGraph (const std::string synt)
 
virtual void parseDelete (carto::AttributedObject *ao)
 
- Protected Member Functions inherited from GraphObject
 GraphObject (const std::string &s)
 
 GraphObject (const GraphObject &x)
 

Additional Inherited Members

- Protected Attributes inherited from Graph
FactoryPtr _factory
 

Detailed Description

Graph modèle (classe abstraite).

Un graphe modèle est un graphe dont les noeuds contiennent des modèles (Model). Pour être utilisable, une classe dérivant de
MGraph doit comprendre les éléments et fonctions suivants:

  • Sélecteur de modèle: la fonction MGraph::modelFinder renvoie une référence sur un sélecteur (dérivé de ModelFinder). Le moyen le plus simple est de le garder dans l'attribut du graphe "model_finder", soit en le créant dans le constructeur, soit en chargeant le fichier graphe (auquel cas le Reader associé doit effectuer cette opération). Une fois stocké dans l'attribut "model_finder", il est automatiquement détruit par le destructeur de MGraph.
  • Les noeuds ont l'attribut "model" qui pointe sur un modèle d'évaluation de clique. Les modèles sont détruits automatiquement.
  • Les noeuds du graphe modèle ont généralement un attribut "domain"} (pointeur sur un Domain) qui donne le domaine de validité du modèle. Le domaine est souvent utilisé pour initialiser les étiquettes possibles pour les noeuds des graphes à étiqueter (CGraph). Les domaines sont optinnels, et sont automatiquement détruits par le destructeur de MGraph.

Definition at line 47 of file mgraph.h.

Member Enumeration Documentation

◆ VersionStatus

used for model-data version compatibility check

Enumerator
Unversioned 
VersionOk 
Outdated 

Definition at line 51 of file mgraph.h.

Constructor & Destructor Documentation

◆ ~MGraph()

virtual sigraph::MGraph::~MGraph ( )
virtual

◆ MGraph()

sigraph::MGraph::MGraph ( const std::string synt)
inlineprotected

Definition at line 134 of file mgraph.h.

References Graph::Graph().

Member Function Documentation

◆ checkCompatibility()

virtual VersionCheck sigraph::MGraph::checkCompatibility ( const Graph & data) const
virtual

Checks compatibility between this model graph and the given data graph.

Basically, versions and compatibility versions of both graphs are compared, but this function can be overriden to check more precise things.

4 properties govern the version checking:

  • in data graphs:
    • datagraph_VERSION is the current version of a data graph (folds, ROI, clusters etc). By default it can be the current carto library number
    • datagraph_compatibility_model_VERSION is the minimum model graph version number that can deal with it
  • in model graphs:
    • model_VERSION: verison of the model graph
    • model_compatibility_data_VERSION: minimum data graph version number that is accepted by this model

Using these 4 attributes, I think we can determine a correct behaviour even for models/data that are not known yet

References Graph::Graph().

◆ clearAll()

virtual void sigraph::MGraph::clearAll ( )
virtual

◆ closeLearning()

virtual void sigraph::MGraph::closeLearning ( )
virtual

Ferme l'apprentissage de tous les modèles.

◆ domainFile()

virtual std::string sigraph::MGraph::domainFile ( const std::string & graphname,
const carto::AttributedObject * ao )
virtual

◆ initAdap()

virtual void sigraph::MGraph::initAdap ( )
virtual

Initialise les partie adaptatives (réseaux de neurones et autres)

◆ initDomain()

virtual void sigraph::MGraph::initDomain ( )
virtual

Initialise les domaines d'influence.

◆ initStats()

virtual void sigraph::MGraph::initStats ( )
virtual

Initialise les stats.

◆ modelFile()

virtual std::string sigraph::MGraph::modelFile ( const std::string & graphname,
const carto::AttributedObject * ao,
std::set< std::string > & otherFiles )
virtual

◆ modelFinder()

virtual ModelFinder & sigraph::MGraph::modelFinder ( )
pure virtual

Renvoie un sélecteur de modèle adapté au graphe modèle.

Implemented in sigraph::FRGraph.

◆ parseDelete()

virtual void sigraph::MGraph::parseDelete ( carto::AttributedObject * ao)
protectedvirtual

◆ removeEdgesToVoid()

virtual void sigraph::MGraph::removeEdgesToVoid ( )
virtual

Enlève les relations avec le label 'brain'.

◆ removeRareEdges()

virtual unsigned sigraph::MGraph::removeRareEdges ( float freqmin)
virtual

Enlève les relations peu fréquentes (max.

{\tt num} occurences dans l'attribut "{\tt occurence_count}")

Returns
nombre de relations éliminées

◆ removeUnusedModels()

virtual void sigraph::MGraph::removeUnusedModels ( bool removeFiles = false,
const std::string & prefix = "" )
virtual

Elimine les noeuds et relations non-utilisés (de domaine vide)

◆ removeWeights()

virtual void sigraph::MGraph::removeWeights ( )
virtual

Enlève les poids des modèles des noeuds.

◆ setWeights()

virtual void sigraph::MGraph::setWeights ( double factor = 1.)
virtual

Fixe les poids des modèles des noeuds.


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