MeVisLabToolboxReference
|
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 | |
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 Graph * | deepCopy () const |
Implement generic deepCopy functionality using copy constructor. | |
virtual | ~Graph () |
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 . Uses method distance() of node classes. | |
VesselNode * | getNode (Vector3 pos) |
Get the node with minimal distance to . Uses method distance() of node classes. | |
const VesselEdge * | getEdge (Vector3 pos) const |
Get the edge with minimal distance to . Uses method distance() of edge classes. | |
VesselEdge * | getEdge (Vector3 pos) |
Get the edge with minimal distance to . Uses method distance() of edge classes. | |
const VesselNode * | getRoot (Vector3 pos) const |
Get the root node with minimal distance to . | |
VesselNode * | getRoot (Vector3 pos) |
Get the root node with minimal distance to . | |
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 | |
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 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 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 | |
Graph & | operator= (const Graph &g) |
Clear current graph and build new one with props of g. | |
Graph * | newGraph (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 Graph * | skeletonGraphFromBase (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) |
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 &) > ml::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> ml::Graph::ConstEdgeIterator |
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.
typedef boost::transform_iterator<ConstNodeAccess, NodeMap::const_iterator> ml::Graph::ConstNodeIterator |
typedef boost::function< VesselEdge* (const EdgeMap::value_type &) > ml::Graph::EdgeAccess |
Helper function returning the VesselEdge from a key/value pair of a EdgeMap.
typedef boost::transform_iterator<EdgeAccess, EdgeMap::iterator> ml::Graph::EdgeIterator |
typedef std::map<MLint, VesselEdge*> ml::Graph::EdgeMap |
typedef boost::function< VesselNode* (const NodeMap::value_type &) > ml::Graph::NodeAccess |
Helper function returning the VesselNode from a key/value pair of a NodeMap.
typedef boost::transform_iterator<NodeAccess, NodeMap::iterator> ml::Graph::NodeIterator |
typedef std::map<MLint, VesselNode*> ml::Graph::NodeMap |
anonymous enum |
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.
void ml::Graph::addGraph | ( | const Graph & | g | ) | [inline] |
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] |
ConstEdgeIterator ml::Graph::beginEdge | ( | ) | const [inline] |
NodeIterator ml::Graph::beginNode | ( | ) | [inline] |
ConstNodeIterator ml::Graph::beginNode | ( | ) | const [inline] |
NodeIterator ml::Graph::beginRoot | ( | ) | [inline] |
ConstNodeIterator ml::Graph::beginRoot | ( | ) | const [inline] |
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] |
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] |
bool ml::Graph::directGraph | ( | float | FloodThresh | ) |
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*>(*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] |
ConstEdgeIterator ml::Graph::endEdge | ( | ) | const [inline] |
NodeIterator ml::Graph::endNode | ( | ) | [inline] |
ConstNodeIterator ml::Graph::endNode | ( | ) | const [inline] |
NodeIterator ml::Graph::endRoot | ( | ) | [inline] |
ConstNodeIterator ml::Graph::endRoot | ( | ) | const [inline] |
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.
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.
PropertyManager::Pointer ml::Graph::getEdgePropertyManager | ( | ) | [inline] |
PropertyManager::ConstPointer ml::Graph::getEdgePropertyManager | ( | ) | const [inline] |
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] |
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] |
static double ml::Graph::getMinSkeletonLabel | ( | void | ) | [inline, static] |
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.
VesselNode* ml::Graph::getNode | ( | size_t | index | ) |
Get node via index position.
PropertyManager::Pointer ml::Graph::getNodePropertyManager | ( | ) | [inline] |
PropertyManager::ConstPointer ml::Graph::getNodePropertyManager | ( | ) | const [inline] |
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.
VesselNode* ml::Graph::getRoot | ( | size_t | index | ) |
Get root via index position.
static ResultType ml::Graph::getSecond | ( | const ParameterType & | p | ) | [inline, static, protected] |
PropertyManager::ConstPointer ml::Graph::getSkeletonPropertyManager | ( | ) | const [inline] |
PropertyManager::Pointer ml::Graph::getSkeletonPropertyManager | ( | ) | [inline] |
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()
.
void ml::Graph::insertRoot | ( | VesselNode * | node | ) |
Insert a node to the list of root nodes.
bool ml::Graph::isWorld | ( | ) | const [inline] |
bool ml::Graph::mergeEdges | ( | VesselEdge * | parent, |
VesselEdge * | child | ||
) |
ml::Graph::ML_SET_ADDSTATE_VERSION | ( | 3 | ) |
Set current addStateToTree() version number:
Graph* ml::Graph::newGraph | ( | bool | bXml = true | ) | const |
size_t ml::Graph::numEdges | ( | ) | const [inline] |
size_t ml::Graph::numNodes | ( | ) | const [inline] |
size_t ml::Graph::numRoots | ( | ) | const [inline] |
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] |
void ml::Graph::setImgExt | ( | ImageVector | v | ) | [inline] |
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] |
void ml::Graph::setToWorld | ( | void | ) | [inline] |
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] |
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.
friend class GraphAnalyser [friend] |
bool ml::Graph::_bFlag [protected] |
std::map<MLint, VesselEdge*> ml::Graph::_edges [protected] |
ImageVector ml::Graph::_imgExt [protected] |
bool ml::Graph::_isWorld [protected] |
std::map<MLint, VesselNode*> ml::Graph::_nodes [protected] |
int ml::Graph::_numCluster [protected] |
Number of non-connected edge-clusters.
Default is -1 (not analysed this feature yet). Is determined by method separateGraph()
.
std::map<MLint, VesselNode*> ml::Graph::_roots [protected] |
Matrix4 ml::Graph::_toWorldMatrix [protected] |
Vector3 ml::Graph::_voxelExt [protected] |
bool ml::Graph::hasVesselVoxels [static] |
If true, method Graph::readStateFromTree() restores Vessel Voxels from stored base object.
default is true.