MeVisLab Toolbox Reference
mlGraph.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_GRAPH_H
14#define ML_GRAPH_H
15
21// Include dll-specific settings.
22#include "mlVesselGraphSystem.h"
23
24#include "VesselGraphTypes.h"
25
26// ThirdParty/System includes
28#include <boost/iterator/transform_iterator.hpp>
29#include <boost/shared_ptr.hpp>
30#include <boost/function.hpp>
31#include <map>
33
34// MLVesselGraph includes
36
37// Be sure that all your modules are part of the ml. So collisions
38// with names in system files or other libraries are minimized.
40
41// Forward-declarations
42class GraphAction;
43class VesselEdge;
44class VesselNode;
45
46
63class VESSELGRAPH_EXPORT Graph : public Base
64{
65
66friend class GraphAnalyser;
67friend class SaveTreeData;
68friend class LoadTreeData;
69public:
70
73 enum {node,edge};
74
75 //----------------------------------------------------------
78 //----------------------------------------------------------
81
83 Graph( const Graph& g, bool reorder=false );
84
86 Graph( const Graph& g, const VesselNode* root, bool reorder=false );
87
89 Graph( const Graph& g, const std::vector<const VesselNode*> &roots, bool reorder=false );
90
92 Graph( Graph& g, int clusterId, bool reorder=false);
93
95#ifdef VESSELGRAPH_USE_MPIF
96 Graph* deepCopy() const { return new Graph(*this); };
97#else
98 Graph* deepCopy() const override { return new Graph(*this); };
99#endif
100
102 ~Graph() override;
104
105 //---------------------------------------------------------
108 //---------------------------------------------------------
109
114
116 VesselNode* createNode(const Vector3& pos=Vector3(0), MLint useId=-1);
118 VesselNode* createNode(const ImageVector& pos, MLint useId=-1) { return this->createNode(Vector3(static_cast<MLdouble>(pos.x), static_cast<MLdouble>(pos.y), static_cast<MLdouble>(pos.z)), useId); };
119
122
124
125
126 //---------------------------------------------------------
129 //---------------------------------------------------------
130
132 void addGraph(const Graph& g) {
133 std::map<const VesselNode*, VesselNode*> nodeMapping;
134 std::map<const VesselEdge*, VesselEdge*> edgeMapping;
135 std::map<const VesselNode*, VesselNode*> rootMapping;
136 this->addGraph(g, nodeMapping, edgeMapping, rootMapping);
137 }
138
142 void addGraph(const Graph& g, std::map<const VesselNode*, VesselNode*>& nodeMapping, std::map<const VesselEdge*, VesselEdge*>& edgeMapping, std::map<const VesselNode*, VesselNode*>& rootMapping);
143
145 void addSubtrees(const std::vector<const VesselNode*>& roots);
146
149 void copyParts(const std::vector<const VesselNode*>& nodes, const std::vector<const VesselEdge*>& edges, const std::vector<const VesselNode*>& roots) {
150 std::map<const VesselNode*, VesselNode*> nodeMapping;
151 std::map<const VesselEdge*, VesselEdge*> edgeMapping;
152 std::map<const VesselNode*, VesselNode*> rootMapping;
153 this->copyParts(nodes, edges, roots, nodeMapping, edgeMapping, rootMapping);
154 }
155
159 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);
160
162
163 //--------------------------------------------------------
166 //--------------------------------------------------------
168 bool removeEdge(VesselEdge* edge, bool removeEmptyNodes=true);
178
179
181 typedef std::map<MLint, VesselNode*> NodeMap;
183 typedef boost::function< VesselNode* (const NodeMap::value_type &) > NodeAccess;
185 typedef boost::function< const VesselNode* (const NodeMap::value_type &) > ConstNodeAccess;
187 typedef boost::transform_iterator<NodeAccess, NodeMap::iterator> NodeIterator;
189 typedef boost::transform_iterator<ConstNodeAccess, NodeMap::const_iterator> ConstNodeIterator;
190
192 typedef std::map<MLint, VesselEdge*> EdgeMap;
194 typedef boost::function< VesselEdge* (const EdgeMap::value_type &) > EdgeAccess;
196 typedef boost::function< const VesselEdge* (const EdgeMap::value_type &) > ConstEdgeAccess;
198 typedef boost::transform_iterator<EdgeAccess, EdgeMap::iterator> EdgeIterator;
200 typedef boost::transform_iterator<ConstEdgeAccess, EdgeMap::const_iterator> ConstEdgeIterator;
201
202 //---------------------------------------------------------
205 //--------------------------------------------------------
206
208 NodeIterator beginNode() { return boost::make_transform_iterator( _nodes.begin(), &getSecond< VesselNode*, NodeMap::value_type > ); }
210 NodeIterator endNode () { return boost::make_transform_iterator( _nodes.end(), &getSecond< VesselNode*, NodeMap::value_type > ); }
211
213 ConstNodeIterator beginNode() const { return boost::make_transform_iterator( _nodes.begin(), &getSecond< const VesselNode*, NodeMap::value_type > ); }
215 ConstNodeIterator endNode () const { return boost::make_transform_iterator( _nodes.end(), &getSecond< const VesselNode*, NodeMap::value_type > ); }
216
218 EdgeIterator beginEdge() { return boost::make_transform_iterator( _edges.begin(), &getSecond< VesselEdge*, EdgeMap::value_type > ); }
220 EdgeIterator endEdge () { return boost::make_transform_iterator( _edges.end(), &getSecond< VesselEdge*, EdgeMap::value_type > ); }
221
223 ConstEdgeIterator beginEdge() const { return boost::make_transform_iterator( _edges.begin(), &getSecond< const VesselEdge*, EdgeMap::value_type > ); }
225 ConstEdgeIterator endEdge () const { return boost::make_transform_iterator( _edges.end(), &getSecond< const VesselEdge*, EdgeMap::value_type > ); }
226
228 NodeIterator beginRoot() { return boost::make_transform_iterator( _roots.begin(), &getSecond< VesselNode*, NodeMap::value_type > ); }
230 NodeIterator endRoot () { return boost::make_transform_iterator( _roots.end(), &getSecond< VesselNode*, NodeMap::value_type > ); }
231
233 ConstNodeIterator beginRoot() const { return boost::make_transform_iterator( _roots.begin(), &getSecond< const VesselNode*, NodeMap::value_type > ); }
235 ConstNodeIterator endRoot () const { return boost::make_transform_iterator( _roots.end(), &getSecond< const VesselNode*, NodeMap::value_type > ); }
236
238 size_t numNodes() const {return _nodes.size();};
240 size_t numEdges() const {return _edges.size();};
242 size_t numRoots() const {return _roots.size();};
243
245 const VesselNode* getIdNode(MLint id) const;
249 const VesselEdge* getIdEdge(MLint id) const;
252
254 const VesselNode* getNode(Vector3 pos) const;
256 VesselNode* getNode(Vector3 pos);
258 const VesselEdge* getEdge(Vector3 pos) const;
260 VesselEdge* getEdge(Vector3 pos);
262 const VesselNode* getRoot(Vector3 pos) const;
264 VesselNode* getRoot(Vector3 pos);
265
268 const VesselNode* getNode(size_t index) const;
271 VesselNode* getNode(size_t index);
272
275 const VesselEdge* getEdge(size_t index) const;
278 VesselEdge* getEdge(size_t index);
279
282 const VesselNode* getRoot(size_t index) const;
285 VesselNode* getRoot(size_t index);
286
288 size_t getIndex(const VesselNode* node) const;
290 size_t getIndex(const VesselEdge* edge) const;
292
293
297 PropertyManager::Pointer getNodePropertyManager() { return _nodePropertyManager; }
298 PropertyManager::ConstPointer getNodePropertyManager() const { return _nodePropertyManager; }
299
301 PropertyManager::Pointer getEdgePropertyManager() { return _edgePropertyManager; }
302 PropertyManager::ConstPointer getEdgePropertyManager() const { return _edgePropertyManager; }
303
305 PropertyManager::Pointer getSkeletonPropertyManager() { return _skeletonPropertyManager; }
306 PropertyManager::ConstPointer getSkeletonPropertyManager() const { return _skeletonPropertyManager; }
308
309 //---------------------------------------------------------
312 //---------------------------------------------------------
313 void transform(const Matrix4& m);
314
316 void setToWorldMatrix(const Matrix4 *m);
318 void setToWorldMatrix(const Matrix4 &m);
320 const Matrix4 *getToWorldMatrix() const;
322 void getToWorldMatrix(float *mat) const;
324 Matrix4 getToVoxelMatrix() const;
325
327 void setToWorld(void) {_isWorld=true;}
329 void setToVoxel(void) {_isWorld=false;}
331 bool isWorld() const {return _isWorld;}
336 void convertToVoxel(void);
339 void convertToWorld(void);
340
342 void setImgExt(ImageVector v) {_imgExt = v;}
343 ImageVector getImgExt() const {return _imgExt;}
344 MLint extX() const {return _imgExt.x;}
345 MLint extY() const {return _imgExt.y;}
346 MLint extZ() const {return _imgExt.z;}
347
348 void setVoxelExt(Vector3 v) {_voxelExt = v;}
349 Vector3 getVoxelExt() const {return _voxelExt;}
351
357
358 //--------------------------------------------------------
361 //--------------------------------------------------------
363 Graph &operator = (const Graph& g);
365 Graph *newGraph(bool unusedDeprecated=true) const;
367
368 //---------------------------------------------------------
371 //---------------------------------------------------------
375
397
405
406 //------------------------------------------------------
409 //------------------------------------------------------
411 SubImageBoxd getBoundingBox() const;
413
414protected:
415 template <typename ResultType, typename ParameterType>
416 static ResultType getSecond(const ParameterType& p) { return p.second; }
417
423 ImageVector _imgExt;
425 Vector3 _voxelExt;
426
428 std::map<MLint, VesselNode*> _nodes;
429 std::map<MLint, VesselEdge*> _edges;
430 std::map<MLint, VesselNode*> _roots;
431
432private:
433 PropertyManager::Pointer _nodePropertyManager;
434 PropertyManager::Pointer _edgePropertyManager;
435 PropertyManager::Pointer _skeletonPropertyManager;
436
437 MLint nextNodeId() { return _nodes.empty() ? 1 : _nodes.rbegin()->first + 1; };
438 MLint nextEdgeId() { return _edges.empty() ? 1 : _edges.rbegin()->first + 1; };
439 MLint nextRootId() { return _roots.empty() ? 1 : _roots.rbegin()->first + 1; };
440
443 void reorderItems();
444
445public:
446
449 NoAction =0, // Not changed.
450 LabelGraph, // Skeleton label values changed.
451 EditGraph, // Skeleton label colors changed.
452 ModifyRoots, // Roots modified: graph is redirected
453 ModifyNodesEdges, // Remove/Insert edges, insert nodes
454 NewGraph, // Everything new
455 NumActionTypes //
456 };
457
458 int getNumCluster() const { return _numCluster; }
459
460 bool getFlag() const { return _bFlag;}
461 void setFlag(bool bFlag) { _bFlag = bFlag;}
462
466
468
469 //-------------------------------------------------------
472 //-------------------------------------------------------
475 void addStateToTree(TreeNode* parent) const override;
479 void readStateFromTree(TreeNode* parent) override;
480
483 int getVersion( void ) { return _version; }
485 void setCurrentVersion( void ) { _version = getAddStateVersion(); }
487 void setVersion( int version ) { _version = version; }
488
489#ifndef GRAPH_NO_BINARY_PERSISTENCE
490 bool getUseBinaryPersistence() { return _useBinaryPersistence; }
496 void useBinaryPersistence(bool use) { _useBinaryPersistence = use; }
499 std::string toBinaryData() const;
501 void fromBinaryData(const std::string &data);
502#endif // GRAPH_NO_BINARY_PERSISTENCE
504
508
515 //------------------------------------------------------
518 //------------------------------------------------------
519 void setAction( ActionType action, std::string sender );
524
525 //-----------------------------------------------------------
529 static double getMinSkeletonLabel( void ) { return MIN_SKELETON_LABEL; }
530 static double getMaxSkeletonLabel( void ) { return MAX_SKELETON_LABEL; }
532
533protected:
535 bool _bFlag;
536
540
541
542 //------------------------------------------------------
545 //------------------------------------------------------
549
553
554 //-----------------------------------------------------------
558 static double MIN_SKELETON_LABEL;
559 static double MAX_SKELETON_LABEL;
561
562 bool _isContainedInImageExtent(const Vector3& pos, const Matrix4& toVoxelMatrix);
563
564private:
567 int _version;
568#ifndef GRAPH_NO_BINARY_PERSISTENCE
569 bool _useBinaryPersistence;
570#endif // GRAPH_NO_BINARY_PERSISTENCE
571
573};
574
576
577
578#endif
Defines the GraphAction class.
— Class GraphAnalyser
Defines the basic Graph class which holds sets of nodes, edges and roots to model tubular structures ...
Definition mlGraph.h:64
const VesselNode * getRoot(size_t index) const
Get root via index position.
bool getFlag() const
Definition mlGraph.h:460
Graph(const Graph &g, const std::vector< const VesselNode * > &roots, bool reorder=false)
Construct graph from trees in g.
void closeSkeletonGaps()
Closes gaps in the skeletons between the first or last skeleton of a VesselEdge and the closest node.
const VesselNode * getNode(size_t index) const
Get node via index position.
ConstNodeIterator beginNode() const
Provide const iterator access to the begin of the node map.
Definition mlGraph.h:213
size_t numEdges() const
Returns the number edges in this graph.
Definition mlGraph.h:240
VesselNode * getNode(Vector3 pos)
Get the node with minimal distance to \cpos. Uses method distance() of node classes.
VesselEdge * getIdEdge(MLint id)
Get edge with id id.
bool mergeEdges(VesselEdge *parent, VesselEdge *child)
void fromBinaryData(const std::string &data)
Reconstructs the graph using the binary data.
std::map< MLint, VesselNode * > _roots
Definition mlGraph.h:430
VesselNode * getRoot(Vector3 pos)
Get the root node with minimal distance to \cpos.
void worldVoxelConvert()
Convert all graph coordinates from the current coordinate system to the opposite.
bool isWorld() const
Return whether element coordinates are given in voxel or world coordinates.
Definition mlGraph.h:331
ActionType getActionValue(void) const
void purifyGraph()
Removes orphan nodes and unsets false cyclic edges (edges with a leaf node that are marked as cyclic)...
MLint splitEdge(MLint edgeID, size_t skeletonIndex)
Splits edge with id edgeID at skeleton index skeletonIndex and returns the ID of the additionally cre...
void setToWorldMatrix(const Matrix4 *m)
Set the conversion matrix for conversions from voxel to world coordinate.
Graph * deepCopy() const override
Implement generic deepCopy functionality using copy constructor.
Definition mlGraph.h:98
const VesselNode * getIdNode(MLint id) const
Get node with id id;.
void addGraph(const Graph &g)
Add an entire graph to the current graph.
Definition mlGraph.h:132
Graph(Graph &g, int clusterId, bool reorder=false)
Construct graph from subgraph of g, defined by clusterId in g.
VesselEdge * getEdge(size_t index)
Get edge via index position.
Matrix4 _toWorldMatrix
Matrix transform to get from voxel to world coordinates.
Definition mlGraph.h:421
void setVersion(int version)
Set version.
Definition mlGraph.h:487
std::map< MLint, VesselNode * > _nodes
Maps of graph items.
Definition mlGraph.h:428
void setAction(ActionType action, std::string sender)
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).
Definition mlGraph.h:187
ActionType _action
Definition mlGraph.h:546
PropertyManager::ConstPointer getEdgePropertyManager() const
Definition mlGraph.h:302
void removeOrphanNodes()
Remove nodes with no edges attached.
void getToWorldMatrix(float *mat) const
Get the conversion matrix for conversions from voxel to world coordinate.
PropertyManager::Pointer getEdgePropertyManager()
Get access to the GraphPropertyManager for edges.
Definition mlGraph.h:301
void clearRoots()
Remove all roots that have been defined.
void setActionCallBack(GraphAction *cbObj)
void insertRoot(VesselNode *node)
Insert a node to the list of root nodes.
PropertyManager::ConstPointer getSkeletonPropertyManager() const
Definition mlGraph.h:306
Graph(const Graph &g, bool reorder=false)
Default copy constructor.
bool _isWorld
Is the graph in world coordinates? Default is true.
Definition mlGraph.h:419
int getVersion(void)
Get graph's version.
Definition mlGraph.h:483
ImageVector _imgExt
Extension of the image the graph is compiled from.
Definition mlGraph.h:423
int getNumCluster() const
Definition mlGraph.h:458
void stripCycles()
Strip cyclic edges from the 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.
NodeIterator beginNode()
Provide iterator access to the begin of the node map.
Definition mlGraph.h:208
void setVoxelExt(Vector3 v)
Definition mlGraph.h:348
NodeIterator beginRoot()
Provide iterator access to the begin of the root map.
Definition mlGraph.h:228
void transform(const Matrix4 &m)
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 an...
Graph(const Graph &g, const VesselNode *root, bool reorder=false)
Construct graph from tree in g.
void setImgExt(ImageVector v)
Definition mlGraph.h:342
size_t getIndex(const VesselEdge *edge) const
Return the index of VesselEdge edge in the edgeMap or numEdges() if edge was not found.
Vector3 _voxelExt
Extension of a voxel of the image the graph is compiled from.
Definition mlGraph.h:425
VesselNode * getNode(size_t index)
Get node via index position.
Vector3 getVoxelExt() const
Definition mlGraph.h:349
static double MIN_SKELETON_LABEL
Definition mlGraph.h:558
std::map< MLint, VesselEdge * > EdgeMap
Internal edge storage.
Definition mlGraph.h:192
EdgeIterator beginEdge()
Provide iterator access to the begin of the edge map.
Definition mlGraph.h:218
MLint extZ() const
Definition mlGraph.h:346
void clampToImage()
NodeIterator endNode()
Provide iterator access to the end of the node map.
Definition mlGraph.h:210
ImageVector getImgExt() const
Definition mlGraph.h:343
void setToWorld(void)
Define all element coordinates to be in world coordinates (no conversion takes place).
Definition mlGraph.h:327
SubImageBoxd getBoundingBox() const
Calculate graph's bounding box from edge-bounding-boxes.
ML_SET_ADDSTATE_VERSION(3)
Set current addStateToTree() version number:
ConstEdgeIterator endEdge() const
Provide const iterator access to the end of the edge map.
Definition mlGraph.h:225
bool directGraph(double FloodThresh)
Build a rooted, directed graph.
void setCurrentVersion(void)
Set graph's version to persistent version number.
Definition mlGraph.h:485
ConstEdgeIterator beginEdge() const
Provide const iterator access to the begin of the edge map.
Definition mlGraph.h:223
static double getMinSkeletonLabel(void)
Definition mlGraph.h:529
int separateGraph()
Separate graph into clusters of connected edges.
bool removeNode(VesselNode *node)
Remove a node from the graph.
void setRootIdToAllChildren()
Descends recursively from all roots to the leaves in the trees and sets the rootId of the according r...
bool _isContainedInImageExtent(const Vector3 &pos, const Matrix4 &toVoxelMatrix)
MLint extX() const
Definition mlGraph.h:344
MLint extY() const
Definition mlGraph.h:345
void convertToWorld(void)
Convert all coordinates to world coordinates.
NodeIterator endRoot()
Provide iterator access to the end of the root map.
Definition mlGraph.h:230
GraphAction * _actionCBObject
Definition mlGraph.h:547
void removeRoot(VesselNode *r)
Remove a root from the graph.
const VesselEdge * getIdEdge(MLint id) const
Get edge with id id.
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.
const VesselNode * getRoot(Vector3 pos) const
Get the root node with minimal distance to \cpos.
ActionType
Graph modification modes. Ordered from minor to mayor modifications.
Definition mlGraph.h:448
@ EditGraph
Definition mlGraph.h:451
@ ModifyRoots
Definition mlGraph.h:452
@ LabelGraph
Definition mlGraph.h:450
@ ModifyNodesEdges
Definition mlGraph.h:453
@ NewGraph
Definition mlGraph.h:454
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.
~Graph() override
Destructor.
const Matrix4 * getToWorldMatrix() const
Get the conversion matrix for conversions from voxel to world coordinate.
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 tupl...
Definition mlGraph.h:200
static double getMaxSkeletonLabel(void)
Definition mlGraph.h:530
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
bool getUseBinaryPersistence()
Definition mlGraph.h:490
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.
Definition mlGraph.h:118
void addSubtrees(const std::vector< const VesselNode * > &roots)
Add subtrees rooted at nodes roots to this graph.
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 n...
void setFlag(bool bFlag)
Definition mlGraph.h:461
void setToVoxel(void)
Define all element coordinates to be in voxels coordinates (no conversion takes place).
Definition mlGraph.h:329
PropertyManager::Pointer getNodePropertyManager()
Definition mlGraph.h:297
VesselNode * getRoot(size_t index)
Get root via index position.
ConstNodeIterator beginRoot() const
Provide const iterator access to the begin of the root map.
Definition mlGraph.h:233
void useBinaryPersistence(bool use)
Set whether to use binary persistence instead of textual representation (text being the default).
Definition mlGraph.h:496
size_t numNodes() const
Returns the number nodes in this graph.
Definition mlGraph.h:238
Matrix4 getToVoxelMatrix() const
Get the conversion matrix for conversions from world to voxel coordinate.
const VesselEdge * getEdge(size_t index) const
Get edge via index position.
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.
Definition mlGraph.h:149
bool removeEdge(VesselEdge *edge, bool removeEmptyNodes=true)
Remove an edge from the graph.
size_t getIndex(const VesselNode *node) const
Return the index of VesselNode node in the nodeMap or numNodes() if node was not found.
void convertToVoxel(void)
Convert all coordinates to voxel coordinates.
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 tupl...
Definition mlGraph.h:189
void clearGraph()
Remove all elements from the graph.
const VesselNode * getNode(Vector3 pos) const
Get the node with minimal distance to \cpos. Uses method distance() of node classes.
void setToWorldMatrix(const Matrix4 &m)
Set the conversion matrix for conversions from voxel to world coordinate.
int _numCluster
Number of non-connected edge-clusters.
Definition mlGraph.h:539
ConstNodeIterator endNode() const
Provide const iterator access to the end of the node map.
Definition mlGraph.h:215
std::string toBinaryData() const
Returns string containing binary representation of all data necessary to reconstruct the graph.
static double MAX_SKELETON_LABEL
Definition mlGraph.h:559
static ResultType getSecond(const ParameterType &p)
Definition mlGraph.h:416
Graph()
Default constructor.
VesselNode * getIdNode(MLint id)
Get node with id id;.
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.
std::map< MLint, VesselEdge * > _edges
Definition mlGraph.h:429
const VesselEdge * getEdge(Vector3 pos) const
Get the edge with minimal distance to \cpos. Uses method distance() of edge classes.
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).
Definition mlGraph.h:198
std::map< MLint, VesselNode * > NodeMap
Internal node storage.
Definition mlGraph.h:181
EdgeIterator endEdge()
Provide iterator access to the end of the edge map.
Definition mlGraph.h:220
size_t numRoots() const
Returns the number roots in this graph.
Definition mlGraph.h:242
void setActionValue(ActionType action)
VesselEdge * getEdge(Vector3 pos)
Get the edge with minimal distance to \cpos. Uses method distance() of edge classes.
void addStateToTree(TreeNode *parent) const override
Overload base-methods: Attaches the object state as children of the given parent node.
Graph * newGraph(bool unusedDeprecated=true) const
Allocate new graph with same properties as this (slowly).
ConstNodeIterator endRoot() const
Provide const iterator access to the end of the root map.
Definition mlGraph.h:235
PropertyManager::ConstPointer getNodePropertyManager() const
Definition mlGraph.h:298
PropertyManager::Pointer getSkeletonPropertyManager()
Get access to the GraphPropertyManager for skeletons.
Definition mlGraph.h:305
bool _bFlag
Flag for diverse usage.
Definition mlGraph.h:535
boost::intrusive_ptr< const type > ConstPointer
boost::intrusive_ptr< type > Pointer
Class VesselEdge.
VesselNode is derived from GraphNode, hence it can be stored as node item in a class Graph object.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
double MLdouble
Definition mlTypeDefs.h:217
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
#define VESSELGRAPH_BEGIN_NAMESPACE