MeVisLabToolboxReference
ml::Graph Class Reference

Defines the basic Graph class which holds sets of nodes, edges and roots to model tubular structures with graph-like topologies such as vascular systems. More...

#include <mlGraph.h>

Inheritance diagram for ml::Graph:
ml::Base

List of all members.

Public Types

enum  { node, edge }
 Global graph item-type enumeration. More...
enum  ActionType {
  NoAction = 0, LabelGraph, EditGraph, ModifyRoots,
  ModifyNodesEdges, NewGraph, NumActionTypes
}
 Graph modification modes. Ordered from minor to mayor modifications. More...
typedef std::map< MLint,
VesselNode * > 
NodeMap
 Internal node storage.
typedef boost::function
< VesselNode *(const
NodeMap::value_type &) > 
NodeAccess
 Helper function returning the VesselNode from a key/value pair of a NodeMap.
typedef boost::function< const
VesselNode *(const
NodeMap::value_type &) > 
ConstNodeAccess
 Helper function returning the VesselNode as const from a key/value pair of a NodeMap.
typedef
boost::transform_iterator
< NodeAccess,
NodeMap::iterator > 
NodeIterator
 Iterator used to traverse nodes in a node map (returns data elements of the map instead of tuples).
typedef
boost::transform_iterator
< ConstNodeAccess,
NodeMap::const_iterator > 
ConstNodeIterator
 Iterator used to traverse const nodes in a node map (returns data elements of the map instead of tuples).
typedef std::map< MLint,
VesselEdge * > 
EdgeMap
 Internal edge storage.
typedef boost::function
< VesselEdge *(const
EdgeMap::value_type &) > 
EdgeAccess
 Helper function returning the VesselEdge from a key/value pair of a EdgeMap.
typedef boost::function< const
VesselEdge *(const
EdgeMap::value_type &) > 
ConstEdgeAccess
 Helper function returning the VesselEdge as const from a key/value pair of a EdgeMap.
typedef
boost::transform_iterator
< EdgeAccess,
EdgeMap::iterator > 
EdgeIterator
 Iterator used to traverse edges in a edge map (returns data elements of the map instead of tuples).
typedef
boost::transform_iterator
< ConstEdgeAccess,
EdgeMap::const_iterator > 
ConstEdgeIterator
 Iterator used to traverse const edges in a edge map (returns data elements of the map instead of tuples).

Public Member Functions

int getNumCluster () const
bool getFlag () const
void setFlag (bool bFlag)
void closeSkeletonGaps ()
 Closes gaps in the skeletons between the first or last skeleton of a VesselEdge and the closest node.
MLint splitEdge (MLint edgeID, size_t skeletonIndex)
 Splits edge with id edgeID at skeleton index skeletonIndex and returns the ID of the additionally created edge.
bool mergeEdges (VesselEdge *parent, VesselEdge *child)
void clampToImage ()
Initialization
 Graph ()
 Default constructor.
 Graph (const Graph &g, bool reorder=false)
 Default copy constructor.
 Graph (const Graph &g, const VesselNode *root, bool reorder=false)
 Construct graph from tree in g.
 Graph (const Graph &g, const std::vector< const VesselNode * > &roots, bool reorder=false)
 Construct graph from trees in g.
 Graph (Graph &g, int clusterId, bool reorder=false)
 Construct graph from subgraph of g, defined by clusterId in g.
virtual GraphdeepCopy () const
 Implement generic deepCopy functionality using copy constructor.
virtual ~Graph ()
 Destructor.
Creating Elements
VesselEdgecreateEdge (VesselNode *predNode, VesselNode *succNode, MLint useId=-1)
 Create a VesselEdge with unique id, add it to the Graph and Nodes and return a pointer to it.
VesselEdgecreateEdge (MLint predNodeId, MLint succNodeId, MLint useId=-1)
 Create a VesselEdge with unique id, add it to the Graph and Nodes identified by the respective IDs and return a pointer to it.
VesselNodecreateNode (const Vector3 &pos=Vector3(0), MLint useId=-1)
 Create a VesselNode with unique id, add it to the Graph and return a pointer to it.
VesselNodecreateNode (const ImageVector &pos, MLint useId=-1)
 Create a VesselNode with unique id, add it to the Graph and return a pointer to it.
void insertRoot (VesselNode *node)
 Insert a node to the list of root nodes.
Copying Elements
void addGraph (const Graph &g)
 Add an entire graph to the current graph.
void addGraph (const Graph &g, std::map< const VesselNode *, VesselNode * > &nodeMapping, std::map< const VesselEdge *, VesselEdge * > &edgeMapping, std::map< const VesselNode *, VesselNode * > &rootMapping)
 Add an entire graph to this graph.
void addSubtrees (const std::vector< const VesselNode * > &roots)
 Add subtrees rooted at nodes roots to this graph.
void copyParts (const std::vector< const VesselNode * > &nodes, const std::vector< const VesselEdge * > &edges, const std::vector< const VesselNode * > &roots)
 Copy a collection of nodes, edges and roots from a different graph to this graph.
void copyParts (const std::vector< const VesselNode * > &nodes, const std::vector< const VesselEdge * > &edges, const std::vector< const VesselNode * > &roots, std::map< const VesselNode *, VesselNode * > &nodeMapping, std::map< const VesselEdge *, VesselEdge * > &edgeMapping, std::map< const VesselNode *, VesselNode * > &rootMapping)
 Copy a collection of nodes, edges and roots from a different graph to this graph.
Removing Elements
bool removeEdge (VesselEdge *edge, bool removeEmptyNodes=true)
 Remove an edge from the graph.
bool removeNode (VesselNode *node)
 Remove a node from the graph.
void removeRoot (VesselNode *r)
 Remove a root from the graph.
void clearRoots ()
 Remove all roots that have been defined.
void clearGraph ()
 Remove all elements from the graph.
Accessing Elements
NodeIterator beginNode ()
 Provide iterator access to the begin of the node map.
NodeIterator endNode ()
 Provide iterator access to the end of the node map.
ConstNodeIterator beginNode () const
 Provide const iterator access to the begin of the node map.
ConstNodeIterator endNode () const
 Provide const iterator access to the end of the node map.
EdgeIterator beginEdge ()
 Provide iterator access to the begin of the edge map.
EdgeIterator endEdge ()
 Provide iterator access to the end of the edge map.
ConstEdgeIterator beginEdge () const
 Provide const iterator access to the begin of the edge map.
ConstEdgeIterator endEdge () const
 Provide const iterator access to the end of the edge map.
NodeIterator beginRoot ()
 Provide iterator access to the begin of the root map.
NodeIterator endRoot ()
 Provide iterator access to the end of the root map.
ConstNodeIterator beginRoot () const
 Provide const iterator access to the begin of the root map.
ConstNodeIterator endRoot () const
 Provide const iterator access to the end of the root map.
size_t numNodes () const
 Returns the number nodes in this graph.
size_t numEdges () const
 Returns the number edges in this graph.
size_t numRoots () const
 Returns the number roots in this graph.
const VesselNodegetIdNode (MLint id) const
 Get node with id id;.
VesselNodegetIdNode (MLint id)
 Get node with id id;.
const VesselEdgegetIdEdge (MLint id) const
 Get edge with id id.
VesselEdgegetIdEdge (MLint id)
 Get edge with id id.
const VesselNodegetNode (Vector3 pos) const
 Get the node with minimal distance to . Uses method distance() of node classes.
VesselNodegetNode (Vector3 pos)
 Get the node with minimal distance to . Uses method distance() of node classes.
const VesselEdgegetEdge (Vector3 pos) const
 Get the edge with minimal distance to . Uses method distance() of edge classes.
VesselEdgegetEdge (Vector3 pos)
 Get the edge with minimal distance to . Uses method distance() of edge classes.
const VesselNodegetRoot (Vector3 pos) const
 Get the root node with minimal distance to .
VesselNodegetRoot (Vector3 pos)
 Get the root node with minimal distance to .
const VesselNodegetNode (size_t index) const
 Get node via index position.
VesselNodegetNode (size_t index)
 Get node via index position.
const VesselEdgegetEdge (size_t index) const
 Get edge via index position.
VesselEdgegetEdge (size_t index)
 Get edge via index position.
const VesselNodegetRoot (size_t index) const
 Get root via index position.
VesselNodegetRoot (size_t index)
 Get root via index position.
size_t getIndex (const VesselNode *node) const
 Return the index of VesselNode node in the nodeMap or numNodes() if node was not found.
size_t getIndex (const VesselEdge *edge) const
 Return the index of VesselEdge edge in the edgeMap or numEdges() if edge was not found.
Properties
PropertyManager::Pointer getNodePropertyManager ()
 Get access to the GraphPropertyManager for nodes.
PropertyManager::ConstPointer getNodePropertyManager () const
PropertyManager::Pointer getEdgePropertyManager ()
 Get access to the GraphPropertyManager for edges.
PropertyManager::ConstPointer getEdgePropertyManager () const
PropertyManager::Pointer getSkeletonPropertyManager ()
 Get access to the GraphPropertyManager for skeletons.
PropertyManager::ConstPointer getSkeletonPropertyManager () const
World/Voxel Coordinates
void transform (const Matrix4 &m)
void setToWorldMatrix (const Matrix4 *m)
 Set the conversion matrix for conversions from voxel to world coordinate.
void setToWorldMatrix (const Matrix4 &m)
 Set the conversion matrix for conversions from voxel to world coordinate.
const Matrix4getToWorldMatrix () const
 Get the conversion matrix for conversions from voxel to world coordinate.
void getToWorldMatrix (float *mat) const
 Get the conversion matrix for conversions from voxel to world coordinate.
Matrix4 getToVoxelMatrix () const
 Get the conversion matrix for conversions from voxel to world coordinate.
void setToWorld (void)
 Define all element coordinates to be in world coordinates (no conversion takes place).
void setToVoxel (void)
 Define all element coordinates to be in voxels coordinates (no conversion takes place).
bool isWorld () const
 Return whether element coordinates are given in voxel or world coordinates.
void worldVoxelConvert ()
 Convert all graph coordinates from the current coordinate system to the opposite.
void convertToVoxel (void)
 Convert all coordinates to voxel coordinates.
void convertToWorld (void)
 Convert all coordinates to world coordinates.
void setImgExt (ImageVector v)
ImageVector getImgExt () const
int extX () const
int extY () const
int extZ () const
void setVoxelExt (Vector3 v)
Vector3 getVoxelExt () const
Persistence
virtual void addStateToTree (TreeNode *parent) const
 Overload base-methods: Attaches the object state as children of the given parent node.
 ML_SET_ADDSTATE_VERSION (3)
 Set current addStateToTree() version number:
virtual void readStateFromTree (TreeNode *parent)
 Reads the object state from the children of the given parent node.
int getVersion (void)
 Get graph's version.
void setCurrentVersion (void)
 Set graph's version to persistent version number.
void setVersion (int version)
 Set version.
Assignment
Graphoperator= (const Graph &g)
 Clear current graph and build new one with props of g.
GraphnewGraph (bool bXml=true) const
Basic graph analysis
int separateGraph ()
 Separate graph into clusters of connected edges.
bool directGraph (float FloodThresh)
 Build a rooted, directed graph.
void stripCycles ()
 Strip cyclic edges from the graph First the graph is directed.
void setRootIdToAllChildren ()
 Descends recursively from all roots to the leaves in the trees and sets the rootId of the according root to all child items (edges and nodes).
void purifyGraph ()
 Removes orphan nodes and unsets false cyclic edges (edges with a leaf node that are marked as cyclic).
Geometry
SubImageBoxd getBoundingBox () const
 Calculate graph's bounding box from edge-bounding-boxes.

Static Public Member Functions

static GraphskeletonGraphFromBase (Base *a_base)

Static Public Attributes

static graph settings
static bool hasVesselVoxels
 If true, method Graph::readStateFromTree() restores Vessel Voxels from stored base object.

Static Protected Member Functions

template<typename ResultType , typename ParameterType >
static ResultType getSecond (const ParameterType &p)

Protected Attributes

bool _bFlag
 Flag for diverse usage.
bool _isWorld
 Is the graph in world coordinates? Default is true.
Matrix4 _toWorldMatrix
 Matrix transform to get from voxel to world coordinates.
ImageVector _imgExt
 Extension of the image the graph is compiled from.
Vector3 _voxelExt
 Extension of a voxel of the image the graph is compiled from.
std::map< MLint, VesselNode * > _nodes
 Maps of graph items.
std::map< MLint, VesselEdge * > _edges
std::map< MLint, VesselNode * > _roots
int _numCluster
 Number of non-connected edge-clusters.

Friends

class GraphAnalyser
class SaveTreeData
class LoadTreeData

Communication

void setAction (ActionType action, std::string sender)
ActionType getActionValue (void) const
void setActionValue (ActionType action)
void setActionCallBack (GraphAction *cbObj)

graph labeling (skeleton labels)

static double getMinSkeletonLabel (void)
 min/max values of skeleton labels
static double getMaxSkeletonLabel (void)

Detailed Description

Defines the basic Graph class which holds sets of nodes, edges and roots to model tubular structures with graph-like topologies such as vascular systems.

Class Graph is a container of edge and node objects. Edges and nodes may be connected to each other to build up a graph. There may exist several unconnected sub-clusters of connected nodes and edges within the same graph. Edges are not directed a priory. One or more nodes of the graph can be defined as root nodes that are stored by reference as root objects GraphRoot in a separate container of object Graph. Method directGraph( floodThreshold ) is one way to direct the graph according to the currently defined root nodes and edge weights. The directed graph may be called then a forest, i.e. within the Graph object several trees exist, each defined by a root node and directed nodes/edges attached to it.

Important: nodes that are stored in a Graph object may belong logicaly to several trees. For example one node object may be shared by two trees that are connected by this node. Hierarchically the trees are separated when traversing the graph from roots to leaves following the edge directions.

Definition at line 59 of file mlGraph.h.


Member Typedef Documentation

typedef boost::function< const VesselEdge* (const EdgeMap::value_type &) > ml::Graph::ConstEdgeAccess

Helper function returning the VesselEdge as const from a key/value pair of a EdgeMap.

Definition at line 208 of file mlGraph.h.

typedef boost::transform_iterator<ConstEdgeAccess, EdgeMap::const_iterator> ml::Graph::ConstEdgeIterator

Iterator used to traverse const edges in a edge map (returns data elements of the map instead of tuples).

Definition at line 212 of file mlGraph.h.

typedef boost::function< const VesselNode* (const NodeMap::value_type &) > ml::Graph::ConstNodeAccess

Helper function returning the VesselNode as const from a key/value pair of a NodeMap.

Definition at line 197 of file mlGraph.h.

typedef boost::transform_iterator<ConstNodeAccess, NodeMap::const_iterator> ml::Graph::ConstNodeIterator

Iterator used to traverse const nodes in a node map (returns data elements of the map instead of tuples).

Definition at line 201 of file mlGraph.h.

typedef boost::function< VesselEdge* (const EdgeMap::value_type &) > ml::Graph::EdgeAccess

Helper function returning the VesselEdge from a key/value pair of a EdgeMap.

Definition at line 206 of file mlGraph.h.

typedef boost::transform_iterator<EdgeAccess, EdgeMap::iterator> ml::Graph::EdgeIterator

Iterator used to traverse edges in a edge map (returns data elements of the map instead of tuples).

Definition at line 210 of file mlGraph.h.

typedef std::map<MLint, VesselEdge*> ml::Graph::EdgeMap

Internal edge storage.

Definition at line 204 of file mlGraph.h.

typedef boost::function< VesselNode* (const NodeMap::value_type &) > ml::Graph::NodeAccess

Helper function returning the VesselNode from a key/value pair of a NodeMap.

Definition at line 195 of file mlGraph.h.

typedef boost::transform_iterator<NodeAccess, NodeMap::iterator> ml::Graph::NodeIterator

Iterator used to traverse nodes in a node map (returns data elements of the map instead of tuples).

Definition at line 199 of file mlGraph.h.

typedef std::map<MLint, VesselNode*> ml::Graph::NodeMap

Internal node storage.

Definition at line 193 of file mlGraph.h.


Member Enumeration Documentation

anonymous enum

Global graph item-type enumeration.

Sometimes used to distinguish different object lookup modes, e.g. when picking elements based on world coordinates.

Enumerator:
node 
edge 

Definition at line 69 of file mlGraph.h.

Graph modification modes. Ordered from minor to mayor modifications.

Enumerator:
NoAction 
LabelGraph 
EditGraph 
ModifyRoots 
ModifyNodesEdges 
NewGraph 
NumActionTypes 

Definition at line 72 of file mlGraph.h.


Constructor & Destructor Documentation

ml::Graph::Graph ( )

Default constructor.

ml::Graph::Graph ( const Graph g,
bool  reorder = false 
)

Default copy constructor.

ml::Graph::Graph ( const Graph g,
const VesselNode root,
bool  reorder = false 
)

Construct graph from tree in g.

ml::Graph::Graph ( const Graph g,
const std::vector< const VesselNode * > &  roots,
bool  reorder = false 
)

Construct graph from trees in g.

ml::Graph::Graph ( Graph g,
int  clusterId,
bool  reorder = false 
)

Construct graph from subgraph of g, defined by clusterId in g.

virtual ml::Graph::~Graph ( ) [virtual]

Destructor.


Member Function Documentation

void ml::Graph::addGraph ( const Graph g) [inline]

Add an entire graph to the current graph.

Definition at line 144 of file mlGraph.h.

void ml::Graph::addGraph ( const Graph g,
std::map< const VesselNode *, VesselNode * > &  nodeMapping,
std::map< const VesselEdge *, VesselEdge * > &  edgeMapping,
std::map< const VesselNode *, VesselNode * > &  rootMapping 
)

Add an entire graph to this graph.

If an elements ID is already in use in this graph, a new one will be generated for the copy. The node/edge/rootMappings will contain mappings from old to new IDs upon return.

virtual void ml::Graph::addStateToTree ( TreeNode parent) const [virtual]

Overload base-methods: Attaches the object state as children of the given parent node.

Reimplemented from ml::Base.

void ml::Graph::addSubtrees ( const std::vector< const VesselNode * > &  roots)

Add subtrees rooted at nodes roots to this graph.

EdgeIterator ml::Graph::beginEdge ( ) [inline]

Provide iterator access to the begin of the edge map.

Definition at line 230 of file mlGraph.h.

ConstEdgeIterator ml::Graph::beginEdge ( ) const [inline]

Provide const iterator access to the begin of the edge map.

Definition at line 235 of file mlGraph.h.

NodeIterator ml::Graph::beginNode ( ) [inline]

Provide iterator access to the begin of the node map.

Definition at line 220 of file mlGraph.h.

ConstNodeIterator ml::Graph::beginNode ( ) const [inline]

Provide const iterator access to the begin of the node map.

Definition at line 225 of file mlGraph.h.

NodeIterator ml::Graph::beginRoot ( ) [inline]

Provide iterator access to the begin of the root map.

Definition at line 240 of file mlGraph.h.

ConstNodeIterator ml::Graph::beginRoot ( ) const [inline]

Provide const iterator access to the begin of the root map.

Definition at line 245 of file mlGraph.h.

void ml::Graph::clampToImage ( )
void ml::Graph::clearGraph ( )

Remove all elements from the graph.

void ml::Graph::clearRoots ( )

Remove all roots that have been defined.

void ml::Graph::closeSkeletonGaps ( )

Closes gaps in the skeletons between the first or last skeleton of a VesselEdge and the closest node.

Changes eventually the Graph.

void ml::Graph::convertToVoxel ( void  )

Convert all coordinates to voxel coordinates.

Warning: The conversion will be applied even if the coordinates are voxel coordinates already!

void ml::Graph::convertToWorld ( void  )

Convert all coordinates to world coordinates.

Warning: The conversion will be applied even if the coordinates are wiorld coordinates already!

void ml::Graph::copyParts ( const std::vector< const VesselNode * > &  nodes,
const std::vector< const VesselEdge * > &  edges,
const std::vector< const VesselNode * > &  roots 
) [inline]

Copy a collection of nodes, edges and roots from a different graph to this graph.

If an elements ID is already in use, a new ID will be generated for the copy.

Definition at line 161 of file mlGraph.h.

void ml::Graph::copyParts ( const std::vector< const VesselNode * > &  nodes,
const std::vector< const VesselEdge * > &  edges,
const std::vector< const VesselNode * > &  roots,
std::map< const VesselNode *, VesselNode * > &  nodeMapping,
std::map< const VesselEdge *, VesselEdge * > &  edgeMapping,
std::map< const VesselNode *, VesselNode * > &  rootMapping 
)

Copy a collection of nodes, edges and roots from a different graph to this graph.

If an elements ID is already in use, a new ID will be generated for the copy. The node/edge/rootMappings will contain mappings from old to new IDs upon return.

VesselEdge* ml::Graph::createEdge ( VesselNode predNode,
VesselNode succNode,
MLint  useId = -1 
)

Create a VesselEdge with unique id, add it to the Graph and Nodes and return a pointer to it.

VesselEdge* ml::Graph::createEdge ( MLint  predNodeId,
MLint  succNodeId,
MLint  useId = -1 
)

Create a VesselEdge with unique id, add it to the Graph and Nodes identified by the respective IDs and return a pointer to it.

VesselNode* ml::Graph::createNode ( const Vector3 pos = Vector3(0),
MLint  useId = -1 
)

Create a VesselNode with unique id, add it to the Graph and return a pointer to it.

VesselNode* ml::Graph::createNode ( const ImageVector pos,
MLint  useId = -1 
) [inline]

Create a VesselNode with unique id, add it to the Graph and return a pointer to it.

Definition at line 130 of file mlGraph.h.

References createNode().

Referenced by createNode().

virtual Graph* ml::Graph::deepCopy ( ) const [inline, virtual]

Implement generic deepCopy functionality using copy constructor.

Reimplemented from ml::Base.

Definition at line 102 of file mlGraph.h.

bool ml::Graph::directGraph ( float  FloodThresh)

Build a rooted, directed graph.

  • take root nodes from the _roots vector
  • attach edges to the roots in order of their weight( VesselNode::weight , VesselEdge::weight)
  • weight may be set to average minimal radius for an VesselEdge or minimal radius for an VesselNode, for example

WARNING: Graph::directGraph() works for edge and node weights set only. By default all node and edge weights in a graph are set equal to 1.0. To get reasonable flooding results for edge direction, weights has to be set first according to some hierarchy dependent property, e.g. the average minimal distance of an edge. Example:

GraphAnalyser analyzeGraph(this); analyzeGraph.measureAvMinDistance(); for (Graph::EdgeIterator iE = this->beginEdge(); iE != this->endEdge(); ++iE){ dynamic_cast<VesselEdge*>(*iE)->weight = dynamic_cast<VesselEdge*>(*iE)->getAverageMinDistance(); } for (Graph::NodeIterator iN = this->beginNode(); iN != this->endNode(); ++iN){ dynamic_cast<VesselNode*>(*iN)->weight = dynamic_cast<VesselNode*>(*iN)->getMinDistance(); }

EdgeIterator ml::Graph::endEdge ( ) [inline]

Provide iterator access to the end of the edge map.

Definition at line 232 of file mlGraph.h.

ConstEdgeIterator ml::Graph::endEdge ( ) const [inline]

Provide const iterator access to the end of the edge map.

Definition at line 237 of file mlGraph.h.

NodeIterator ml::Graph::endNode ( ) [inline]

Provide iterator access to the end of the node map.

Definition at line 222 of file mlGraph.h.

ConstNodeIterator ml::Graph::endNode ( ) const [inline]

Provide const iterator access to the end of the node map.

Definition at line 227 of file mlGraph.h.

NodeIterator ml::Graph::endRoot ( ) [inline]

Provide iterator access to the end of the root map.

Definition at line 242 of file mlGraph.h.

ConstNodeIterator ml::Graph::endRoot ( ) const [inline]

Provide const iterator access to the end of the root map.

Definition at line 247 of file mlGraph.h.

int ml::Graph::extX ( ) const [inline]

Definition at line 356 of file mlGraph.h.

int ml::Graph::extY ( ) const [inline]

Definition at line 357 of file mlGraph.h.

int ml::Graph::extZ ( ) const [inline]

Definition at line 358 of file mlGraph.h.

ActionType ml::Graph::getActionValue ( void  ) const
SubImageBoxd ml::Graph::getBoundingBox ( ) const

Calculate graph's bounding box from edge-bounding-boxes.

VesselEdge* ml::Graph::getEdge ( size_t  index)

Get edge via index position.

Deprecated:
WARNING: This method is deprecated and slow! Please adapt your code to not use it.
const VesselEdge* ml::Graph::getEdge ( Vector3  pos) const

Get the edge with minimal distance to . Uses method distance() of edge classes.

VesselEdge* ml::Graph::getEdge ( Vector3  pos)

Get the edge with minimal distance to . Uses method distance() of edge classes.

const VesselEdge* ml::Graph::getEdge ( size_t  index) const

Get edge via index position.

Deprecated:
WARNING: This method is deprecated and slow! Please adapt your code to not use it.
PropertyManager::Pointer ml::Graph::getEdgePropertyManager ( ) [inline]

Get access to the GraphPropertyManager for edges.

Definition at line 313 of file mlGraph.h.

PropertyManager::ConstPointer ml::Graph::getEdgePropertyManager ( ) const [inline]

Definition at line 314 of file mlGraph.h.

bool ml::Graph::getFlag ( ) const [inline]

Definition at line 366 of file mlGraph.h.

const VesselEdge* ml::Graph::getIdEdge ( MLint  id) const

Get edge with id id.

VesselEdge* ml::Graph::getIdEdge ( MLint  id)

Get edge with id id.

const VesselNode* ml::Graph::getIdNode ( MLint  id) const

Get node with id id;.

VesselNode* ml::Graph::getIdNode ( MLint  id)

Get node with id id;.

ImageVector ml::Graph::getImgExt ( ) const [inline]

Definition at line 355 of file mlGraph.h.

size_t ml::Graph::getIndex ( const VesselNode node) const

Return the index of VesselNode node in the nodeMap or numNodes() if node was not found.

size_t ml::Graph::getIndex ( const VesselEdge edge) const

Return the index of VesselEdge edge in the edgeMap or numEdges() if edge was not found.

static double ml::Graph::getMaxSkeletonLabel ( void  ) [inline, static]

Definition at line 481 of file mlGraph.h.

static double ml::Graph::getMinSkeletonLabel ( void  ) [inline, static]

min/max values of skeleton labels

Definition at line 480 of file mlGraph.h.

const VesselNode* ml::Graph::getNode ( Vector3  pos) const

Get the node with minimal distance to . Uses method distance() of node classes.

VesselNode* ml::Graph::getNode ( Vector3  pos)

Get the node with minimal distance to . Uses method distance() of node classes.

const VesselNode* ml::Graph::getNode ( size_t  index) const

Get node via index position.

Deprecated:
WARNING: This method is deprecated and slow! Please adapt your code to not use it.
VesselNode* ml::Graph::getNode ( size_t  index)

Get node via index position.

Deprecated:
WARNING: This method is deprecated and slow! Please adapt your code to not use it.
PropertyManager::Pointer ml::Graph::getNodePropertyManager ( ) [inline]

Get access to the GraphPropertyManager for nodes.

Definition at line 309 of file mlGraph.h.

PropertyManager::ConstPointer ml::Graph::getNodePropertyManager ( ) const [inline]

Definition at line 310 of file mlGraph.h.

int ml::Graph::getNumCluster ( ) const [inline]

Definition at line 364 of file mlGraph.h.

const VesselNode* ml::Graph::getRoot ( Vector3  pos) const

Get the root node with minimal distance to .

VesselNode* ml::Graph::getRoot ( Vector3  pos)

Get the root node with minimal distance to .

const VesselNode* ml::Graph::getRoot ( size_t  index) const

Get root via index position.

Deprecated:
WARNING: This method is deprecated and slow! Please adapt your code to not use it.
VesselNode* ml::Graph::getRoot ( size_t  index)

Get root via index position.

Deprecated:
WARNING: This method is deprecated and slow! Please adapt your code to not use it.
template<typename ResultType , typename ParameterType >
static ResultType ml::Graph::getSecond ( const ParameterType &  p) [inline, static, protected]

Definition at line 490 of file mlGraph.h.

PropertyManager::ConstPointer ml::Graph::getSkeletonPropertyManager ( ) const [inline]

Definition at line 318 of file mlGraph.h.

PropertyManager::Pointer ml::Graph::getSkeletonPropertyManager ( ) [inline]

Get access to the GraphPropertyManager for skeletons.

Definition at line 317 of file mlGraph.h.

Matrix4 ml::Graph::getToVoxelMatrix ( ) const

Get the conversion matrix for conversions from voxel to world coordinate.

const Matrix4* ml::Graph::getToWorldMatrix ( ) const

Get the conversion matrix for conversions from voxel to world coordinate.

void ml::Graph::getToWorldMatrix ( float *  mat) const

Get the conversion matrix for conversions from voxel to world coordinate.

int ml::Graph::getVersion ( void  ) [inline]

Get graph's version.

differs from value getAddStateVersion() if graph is restored from older state and not set by setVersion().

Definition at line 395 of file mlGraph.h.

Vector3 ml::Graph::getVoxelExt ( ) const [inline]

Definition at line 361 of file mlGraph.h.

void ml::Graph::insertRoot ( VesselNode node)

Insert a node to the list of root nodes.

bool ml::Graph::isWorld ( ) const [inline]

Return whether element coordinates are given in voxel or world coordinates.

Definition at line 343 of file mlGraph.h.

bool ml::Graph::mergeEdges ( VesselEdge parent,
VesselEdge child 
)
ml::Graph::ML_SET_ADDSTATE_VERSION ( )

Set current addStateToTree() version number:

Graph* ml::Graph::newGraph ( bool  bXml = true) const
size_t ml::Graph::numEdges ( ) const [inline]

Returns the number edges in this graph.

Definition at line 252 of file mlGraph.h.

size_t ml::Graph::numNodes ( ) const [inline]

Returns the number nodes in this graph.

Definition at line 250 of file mlGraph.h.

size_t ml::Graph::numRoots ( ) const [inline]

Returns the number roots in this graph.

Definition at line 254 of file mlGraph.h.

Graph& ml::Graph::operator= ( const Graph g)

Clear current graph and build new one with props of g.

void ml::Graph::purifyGraph ( )

Removes orphan nodes and unsets false cyclic edges (edges with a leaf node that are marked as cyclic).

Also, all the nodes' and edges' ids are set anew. Remove roots that have no succeeding edges, i.e. all edges are attached to other root nodes

virtual void ml::Graph::readStateFromTree ( TreeNode parent) [virtual]

Reads the object state from the children of the given parent node.

Reimplemented from ml::Base.

bool ml::Graph::removeEdge ( VesselEdge edge,
bool  removeEmptyNodes = true 
)

Remove an edge from the graph.

bool ml::Graph::removeNode ( VesselNode node)

Remove a node from the graph.

void ml::Graph::removeRoot ( VesselNode r)

Remove a root from the graph.

int ml::Graph::separateGraph ( )

Separate graph into clusters of connected edges.

Edges belonging to the same cluster are labeled with ascending cluster-label.

void ml::Graph::setAction ( ActionType  action,
std::string  sender 
)
void ml::Graph::setActionCallBack ( GraphAction cbObj)
void ml::Graph::setActionValue ( ActionType  action)
void ml::Graph::setCurrentVersion ( void  ) [inline]

Set graph's version to persistent version number.

Definition at line 397 of file mlGraph.h.

void ml::Graph::setFlag ( bool  bFlag) [inline]

Definition at line 367 of file mlGraph.h.

void ml::Graph::setImgExt ( ImageVector  v) [inline]

Definition at line 354 of file mlGraph.h.

void ml::Graph::setRootIdToAllChildren ( )

Descends recursively from all roots to the leaves in the trees and sets the rootId of the according root to all child items (edges and nodes).

void ml::Graph::setToVoxel ( void  ) [inline]

Define all element coordinates to be in voxels coordinates (no conversion takes place).

Definition at line 341 of file mlGraph.h.

void ml::Graph::setToWorld ( void  ) [inline]

Define all element coordinates to be in world coordinates (no conversion takes place).

Definition at line 339 of file mlGraph.h.

void ml::Graph::setToWorldMatrix ( const Matrix4 m)

Set the conversion matrix for conversions from voxel to world coordinate.

void ml::Graph::setToWorldMatrix ( const Matrix4 m)

Set the conversion matrix for conversions from voxel to world coordinate.

void ml::Graph::setVersion ( int  version) [inline]

Set version.

Definition at line 399 of file mlGraph.h.

void ml::Graph::setVoxelExt ( Vector3  v) [inline]

Definition at line 360 of file mlGraph.h.

static Graph* ml::Graph::skeletonGraphFromBase ( Base a_base) [static]
MLint ml::Graph::splitEdge ( MLint  edgeID,
size_t  skeletonIndex 
)

Splits edge with id edgeID at skeleton index skeletonIndex and returns the ID of the additionally created edge.

If the edge could not be split (e.g. edgeID not found, no vessel edge or not enough skeletons), -1 is returned.

void ml::Graph::stripCycles ( )

Strip cyclic edges from the graph First the graph is directed.

Than, all cyclic edges are removed to build a graph without cycles.

void ml::Graph::transform ( const Matrix4 m)
void ml::Graph::worldVoxelConvert ( )

Convert all graph coordinates from the current coordinate system to the opposite.


Friends And Related Function Documentation

friend class GraphAnalyser [friend]

Definition at line 62 of file mlGraph.h.

friend class LoadTreeData [friend]

Definition at line 64 of file mlGraph.h.

friend class SaveTreeData [friend]

Definition at line 63 of file mlGraph.h.


Member Data Documentation

bool ml::Graph::_bFlag [protected]

Flag for diverse usage.

Definition at line 493 of file mlGraph.h.

std::map<MLint, VesselEdge*> ml::Graph::_edges [protected]

Definition at line 506 of file mlGraph.h.

Extension of the image the graph is compiled from.

Definition at line 500 of file mlGraph.h.

bool ml::Graph::_isWorld [protected]

Is the graph in world coordinates? Default is true.

Definition at line 496 of file mlGraph.h.

std::map<MLint, VesselNode*> ml::Graph::_nodes [protected]

Maps of graph items.

Definition at line 505 of file mlGraph.h.

int ml::Graph::_numCluster [protected]

Number of non-connected edge-clusters.

Default is -1 (not analysed this feature yet). Is determined by method separateGraph() .

Definition at line 511 of file mlGraph.h.

std::map<MLint, VesselNode*> ml::Graph::_roots [protected]

Definition at line 507 of file mlGraph.h.

Matrix transform to get from voxel to world coordinates.

Definition at line 498 of file mlGraph.h.

Extension of a voxel of the image the graph is compiled from.

Definition at line 502 of file mlGraph.h.

If true, method Graph::readStateFromTree() restores Vessel Voxels from stored base object.

default is true.

Definition at line 114 of file mlGraph.h.


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