MeVisLab Toolbox 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>
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 | |
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) |
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. | |
void | clampToImage () |
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). | |
void | removeOrphanNodes () |
Remove nodes with no edges attached. | |
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. | |
Graph * | deepCopy () const override |
Implement generic deepCopy functionality using copy constructor. | |
~Graph () override | |
Destructor. | |
Creating Elements | |
VesselEdge * | 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 * | 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 * | 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 * | createNode (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 VesselNode * | getIdNode (MLint id) const |
Get node with id id ;. | |
VesselNode * | getIdNode (MLint id) |
Get node with id id ;. | |
const VesselEdge * | getIdEdge (MLint id) const |
Get edge with id id . | |
VesselEdge * | getIdEdge (MLint id) |
Get edge with id id . | |
const VesselNode * | getNode (Vector3 pos) const |
Get the node with minimal distance to \cpos. Uses method distance() of node classes. | |
VesselNode * | getNode (Vector3 pos) |
Get the node with minimal distance to \cpos. Uses method distance() of node classes. | |
const VesselEdge * | getEdge (Vector3 pos) const |
Get the edge with minimal distance to \cpos. Uses method distance() of edge classes. | |
VesselEdge * | getEdge (Vector3 pos) |
Get the edge with minimal distance to \cpos. Uses method distance() of edge classes. | |
const VesselNode * | getRoot (Vector3 pos) const |
Get the root node with minimal distance to \cpos. | |
VesselNode * | getRoot (Vector3 pos) |
Get the root node with minimal distance to \cpos. | |
const VesselNode * | getNode (size_t index) const |
Get node via index position. | |
VesselNode * | getNode (size_t index) |
Get node via index position. | |
const VesselEdge * | getEdge (size_t index) const |
Get edge via index position. | |
VesselEdge * | getEdge (size_t index) |
Get edge via index position. | |
const VesselNode * | getRoot (size_t index) const |
Get root via index position. | |
VesselNode * | getRoot (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 | |
Get access to the GraphPropertyManager for nodes. | |
PropertyManager::Pointer | getNodePropertyManager () |
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 Matrix4 * | getToWorldMatrix () 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 world to voxel 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 |
MLint | extX () const |
MLint | extY () const |
MLint | extZ () const |
void | setVoxelExt (Vector3 v) |
Vector3 | getVoxelExt () const |
Assignment | |
Graph & | operator= (const Graph &g) |
Clear current graph and build new one with props of g. | |
Graph * | newGraph (bool unusedDeprecated=true) const |
Allocate new graph with same properties as this (slowly). | |
Basic graph analysis | |
int | separateGraph () |
Separate graph into clusters of connected edges. | |
bool | directGraph (double FloodThresh) |
Build a rooted, directed graph. | |
void | stripCycles () |
Strip cyclic edges from the graph. | |
Geometry | |
SubImageBoxd | getBoundingBox () const |
Calculate graph's bounding box from edge-bounding-boxes. | |
Persistence | |
void | addStateToTree (TreeNode *parent) const override |
Overload base-methods: Attaches the object state as children of the given parent node. | |
ML_SET_ADDSTATE_VERSION (3) | |
Set current addStateToTree() version number: | |
void | readStateFromTree (TreeNode *parent) override |
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. | |
bool | getUseBinaryPersistence () |
void | useBinaryPersistence (bool use) |
Set whether to use binary persistence instead of textual representation (text being the default). | |
std::string | toBinaryData () const |
Returns string containing binary representation of all data necessary to reconstruct the graph. | |
void | fromBinaryData (const std::string &data) |
Reconstructs the graph using the binary data. | |
Protected Member Functions | |
void | _setRootIdToChildren (int rootId, VesselNode *node, VesselEdge *predEdge) |
Sets the given root id to the given node and its child edges and calls itself recursively until the node is a leaf node. | |
bool | _isContainedInImageExtent (const Vector3 &pos, const Matrix4 &toVoxelMatrix) |
Static Protected Member Functions | |
template<typename ResultType , typename ParameterType > | |
static ResultType | getSecond (const ParameterType &p) |
Protected Attributes | |
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 |
bool | _bFlag |
Flag for diverse usage. | |
int | _numCluster |
Number of non-connected edge-clusters. | |
Friends | |
class | GraphAnalyser |
class | SaveTreeData |
class | LoadTreeData |
Communication | |
ActionType | _action |
GraphAction * | _actionCBObject |
void | setAction (ActionType action, std::string sender) |
ActionType | getActionValue (void) const |
void | setActionValue (ActionType action) |
void | setActionCallBack (GraphAction *cbObj) |
graph labeling (skeleton labels) | |
min/max values of skeleton labels | |
static double | MIN_SKELETON_LABEL |
static double | MAX_SKELETON_LABEL |
static double | getMinSkeletonLabel (void) |
static double | getMaxSkeletonLabel (void) |
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.
typedef boost::function< const VesselEdge* (const EdgeMap::value_type &) Graph::ConstEdgeAccess) |
Helper function returning the VesselEdge as const from a key/value pair of a EdgeMap.
typedef boost::transform_iterator<ConstEdgeAccess, EdgeMap::const_iterator> Graph::ConstEdgeIterator |
typedef boost::function< const VesselNode* (const NodeMap::value_type &) Graph::ConstNodeAccess) |
Helper function returning the VesselNode as const from a key/value pair of a NodeMap.
typedef boost::transform_iterator<ConstNodeAccess, NodeMap::const_iterator> Graph::ConstNodeIterator |
typedef boost::function< VesselEdge* (const EdgeMap::value_type &) Graph::EdgeAccess) |
Helper function returning the VesselEdge from a key/value pair of a EdgeMap.
typedef boost::transform_iterator<EdgeAccess, EdgeMap::iterator> Graph::EdgeIterator |
typedef std::map<MLint, VesselEdge*> Graph::EdgeMap |
typedef boost::function< VesselNode* (const NodeMap::value_type &) Graph::NodeAccess) |
Helper function returning the VesselNode from a key/value pair of a NodeMap.
typedef boost::transform_iterator<NodeAccess, NodeMap::iterator> Graph::NodeIterator |
typedef std::map<MLint, VesselNode*> Graph::NodeMap |
Graph::Graph | ( | ) |
Default constructor.
Construct graph from tree in g.
Graph::Graph | ( | const Graph & | g, |
const std::vector< const VesselNode * > & | roots, | ||
bool | reorder = false ) |
Construct graph from trees in g.
Construct graph from subgraph of g, defined by clusterId in g.
|
override |
Destructor.
|
protected |
|
protected |
Sets the given root id to the given node and its child edges and calls itself recursively until the node is a leaf node.
Add an entire graph to the current graph.
Definition at line 132 of file mlGraph.h.
References mlrange_cast().
void 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.
|
override |
Overload base-methods: Attaches the object state as children of the given parent node.
void Graph::addSubtrees | ( | const std::vector< const VesselNode * > & | roots | ) |
Add subtrees rooted at nodes roots
to this graph.
|
inline |
Provide iterator access to the begin of the edge map.
Definition at line 218 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide const iterator access to the begin of the edge map.
Definition at line 223 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide iterator access to the begin of the node map.
Definition at line 208 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide const iterator access to the begin of the node map.
Definition at line 213 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide iterator access to the begin of the root map.
Definition at line 228 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide const iterator access to the begin of the root map.
Definition at line 233 of file mlGraph.h.
References mlrange_cast().
void Graph::clampToImage | ( | ) |
void Graph::clearGraph | ( | ) |
Remove all elements from the graph.
void Graph::clearRoots | ( | ) |
Remove all roots that have been defined.
void Graph::closeSkeletonGaps | ( | ) |
Closes gaps in the skeletons between the first or last skeleton of a VesselEdge and the closest node.
Changes eventually the Graph.
Convert all coordinates to voxel coordinates.
Warning: The conversion will be applied even if the coordinates are voxel coordinates already!
Convert all coordinates to world coordinates.
Warning: The conversion will be applied even if the coordinates are world coordinates already!
|
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 149 of file mlGraph.h.
References mlrange_cast().
void 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 * 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.
VesselEdge * 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.
|
inline |
Create a VesselNode with unique id, add it to the Graph and return a pointer to it.
Definition at line 118 of file mlGraph.h.
References createNode(), and mlrange_cast().
Referenced by createNode().
VesselNode * 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.
|
inlineoverride |
Build a rooted, directed graph.
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*>(<em>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(); }
|
inline |
Provide iterator access to the end of the edge map.
Definition at line 220 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide const iterator access to the end of the edge map.
Definition at line 225 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide iterator access to the end of the node map.
Definition at line 210 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide const iterator access to the end of the node map.
Definition at line 215 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide iterator access to the end of the root map.
Definition at line 230 of file mlGraph.h.
References mlrange_cast().
|
inline |
Provide const iterator access to the end of the root map.
Definition at line 235 of file mlGraph.h.
References mlrange_cast().
Reconstructs the graph using the binary data.
ActionType Graph::getActionValue | ( | void | ) | const |
SubImageBoxd Graph::getBoundingBox | ( | ) | const |
Calculate graph's bounding box from edge-bounding-boxes.
VesselEdge * Graph::getEdge | ( | size_t | index | ) |
Get edge via index position.
const VesselEdge * Graph::getEdge | ( | size_t | index | ) | const |
Get edge via index position.
VesselEdge * Graph::getEdge | ( | Vector3 | pos | ) |
Get the edge with minimal distance to \cpos. Uses method distance() of edge classes.
const VesselEdge * Graph::getEdge | ( | Vector3 | pos | ) | const |
Get the edge with minimal distance to \cpos. Uses method distance() of edge classes.
|
inline |
|
inline |
VesselEdge * Graph::getIdEdge | ( | MLint | id | ) |
Get edge with id id
.
const VesselEdge * Graph::getIdEdge | ( | MLint | id | ) | const |
Get edge with id id
.
VesselNode * Graph::getIdNode | ( | MLint | id | ) |
Get node with id id
;.
const VesselNode * Graph::getIdNode | ( | MLint | id | ) | const |
Get node with id id
;.
size_t Graph::getIndex | ( | const VesselEdge * | edge | ) | const |
Return the index of VesselEdge edge
in the edgeMap or numEdges() if edge was not found.
size_t Graph::getIndex | ( | const VesselNode * | node | ) | const |
Return the index of VesselNode node
in the nodeMap or numNodes() if node was not found.
VesselNode * Graph::getNode | ( | size_t | index | ) |
Get node via index position.
const VesselNode * Graph::getNode | ( | size_t | index | ) | const |
Get node via index position.
VesselNode * Graph::getNode | ( | Vector3 | pos | ) |
Get the node with minimal distance to \cpos. Uses method distance() of node classes.
const VesselNode * Graph::getNode | ( | Vector3 | pos | ) | const |
Get the node with minimal distance to \cpos. Uses method distance() of node classes.
|
inline |
|
inline |
VesselNode * Graph::getRoot | ( | size_t | index | ) |
Get root via index position.
const VesselNode * Graph::getRoot | ( | size_t | index | ) | const |
Get root via index position.
VesselNode * Graph::getRoot | ( | Vector3 | pos | ) |
Get the root node with minimal distance to \cpos.
const VesselNode * Graph::getRoot | ( | Vector3 | pos | ) | const |
Get the root node with minimal distance to \cpos.
|
inline |
|
inline |
Matrix4 Graph::getToVoxelMatrix | ( | ) | const |
Get the conversion matrix for conversions from world to voxel coordinate.
const Matrix4 * Graph::getToWorldMatrix | ( | ) | const |
Get the conversion matrix for conversions from voxel to world coordinate.
Get the conversion matrix for conversions from voxel to world coordinate.
Get graph's version.
differs from value getAddStateVersion()
if graph is restored from older state and not set by setVersion()
.
void Graph::insertRoot | ( | VesselNode * | node | ) |
Insert a node to the list of root nodes.
|
inline |
bool Graph::mergeEdges | ( | VesselEdge * | parent, |
VesselEdge * | child ) |
Graph::ML_SET_ADDSTATE_VERSION | ( | 3 | ) |
Set current addStateToTree() version number:
Allocate new graph with same properties as this (slowly).
|
inline |
|
inline |
|
inline |
void 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
|
override |
Reads the object state from the children of the given parent node.
bool Graph::removeEdge | ( | VesselEdge * | edge, |
bool | removeEmptyNodes = true ) |
Remove an edge from the graph.
bool Graph::removeNode | ( | VesselNode * | node | ) |
Remove a node from the graph.
void Graph::removeOrphanNodes | ( | ) |
Remove nodes with no edges attached.
void Graph::removeRoot | ( | VesselNode * | r | ) |
Remove a root from the graph.
int Graph::separateGraph | ( | ) |
Separate graph into clusters of connected edges.
Edges belonging to the same cluster are labeled with ascending cluster-label.
void Graph::setAction | ( | ActionType | action, |
std::string | sender ) |
void Graph::setActionCallBack | ( | GraphAction * | cbObj | ) |
void Graph::setActionValue | ( | ActionType | action | ) |
Set graph's version to persistent version number.
Definition at line 485 of file mlGraph.h.
References mlrange_cast().
Definition at line 461 of file mlGraph.h.
References mlrange_cast().
void 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).
Set the conversion matrix for conversions from voxel to world coordinate.
Set the conversion matrix for conversions from voxel to world coordinate.
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 Graph::stripCycles | ( | ) |
Strip cyclic edges from the graph.
All cyclic edges are removed to build a graph without cycles. This only works correctly if the graph has been directed with directGraph() first.
std::string Graph::toBinaryData | ( | ) | const |
Returns string containing binary representation of all data necessary to reconstruct the graph.
Set whether to use binary persistence instead of textual representation (text being the default).
Definition at line 496 of file mlGraph.h.
References mlrange_cast().
void Graph::worldVoxelConvert | ( | ) |
Convert all graph coordinates from the current coordinate system to the opposite.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Number of non-connected edge-clusters.
Default is -1 (not analyzed this feature yet). Is determined by method separateGraph()
.
|
protected |
|
protected |
|
protected |