MeVisLab Toolbox Reference
GraphAnalyser Class Reference

— Class GraphAnalyser More...

#include <mlGraphAnalyser.h>

Public Member Functions

void sumupST_DrainVolume (bool bIgnoreOrientation=false)
 cumulate DrainVolumes given at the leafs
 
bool calcDistanceMatrix (MatrixTemplate< double > &dm, std::vector< int > &vId, int nMaxNodes)
 Calculate Distance Matrix for rooted Graph, taking hierarchy into account: dm(n1, n2) := minimal distance between n1 and a conjoint parent node of n1 and n2 nMaxNodes: maximal Number of notes taken into account Nodes are cumulated in order of descending hierarchy to get a equably resolution dm: Matrix to store result, size is matched automatically.
 
bool calcNodeClassifikator (CDoubleArray *pArAssoc, std::vector< int > *pvId, int nMaxNodes)
 stack Node classificators in (*pArAssoc) (n1,n1): classificators based on single Node n1 respect to global tree structure [0]: relative X position [1]: relative Y position [2]: relative Z position [3]: 0/1 left resp.
 
bool calcNodeBaseFromPosition (const Vector3 &vPosition, const std::vector< int > &vId, std::vector< CIdxFloat > *pvResult)
 Calculate representation of spatial position in node coordinates.
 
bool calcPositionFromNodeBase (std::vector< CIdxFloat > vBase, Vector3 *pvResult)
 Calculate spatial vector position form relative node coordinates.
 
double calcSpannedVolume (const std::vector< int > &vId)
 Calculate Volume of minimal cube including all supplied nodes.
 
short sampleConnectedCluster ()
 identify connected subgraph return value is number of identified cluster
 
void tansferLabels (Skeleton::LABELTYPE NType, float fThresh=0.1f)
 transfer Vessel-Edge labels to Skeleton
 
void tansferLabelsInverse (void)
 transfer skeleton labels to vessel edge label (take label of most frequent skeleton)
 
void scanSkeletonLabelMinMax (float *min, float *max)
 evaluate min/max value of skeleton labels
 
void collectLeafs (VesselNode *pRoot, std::vector< VesselNode * > &pLeafs)
 Collect all leafs which are children of node pRoot and append them to pLeafs.
 
Initialization
 GraphAnalyser (Graph *pGraph)
 constructor: provide pointer pGraph for easy access to Graph object
 
evaluation of Graph geometry
void measureLength ()
 Get the euclidean length of all graph edges and set edge 'Length' property in the Graph.
 
void measureVolume ()
 Get the euclidean volume of all graph edges and set edge 'Volume' property in the Graph.
 
void measureST_Volume (bool bIgnoreOrientation=false)
 Get the euclidean volume of all graph edges connected with given root, nodes cumulate them according to orientation and set edge 'ST_Volume' property in the Graph.
 
float measureAvMinDistance ()
 Get the average minimal distance over all skeletons of an edge and set edge 'averageMinDistance' property in the Graph.
 
void measureSkeletonArea (int nAvLength=5)
 measure floating average of SkeletonArea and set area property
 
Vector3 measureBarycenter ()
 Get barycenter position of all the Graph.
 
void measureST_Barycenter (bool bIgnoreOrientation=false)
 Get the euclidean volume of all graph edges connected with given root, nodes cumulate them according to orientation and set edge 'ST_Barycenter' property in the Graph.
 
void sumupST_Value (VesselNode::NodeGetFkt getFkt, VesselNode::NodeSetFkt setFkt, bool bIgnoreOrientation=false)
 
void measureMaxPathValue (VesselNode *pRootNode, VesselEdge::EdgeGetFkt edgeGetFkt, VesselNode::NodeGetFkt nodeGetFkt, VesselNode::NodeSetFkt nodeSetFkt)
 For each node calculate the maximum sum of edge values in a single path below this node. CAUTION: Works with directed, acyclic graphs only!
 
void searchMaxSubTrees (std::vector< VesselEdge * >::iterator iBegin, std::vector< VesselEdge * >::iterator iEnd, int nNum, std::vector< VesselEdge * > *pvMaxEdges, float *pfActValue, float *pfActSum)
 calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges
 
void searchMaxSubTrees (std::vector< VesselEdge * > vStartEdges, unsigned int nNum, std::vector< VesselEdge * > *pvMaxEdges, float *pfActValue, float *pfActSum)
 calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges
 
void searchMaxSubTrees (std::vector< VesselEdge * > vStartEdges, int nPos, unsigned int nNum, std::vector< VesselEdge * > *pvMaxEdges, float *pfActValue, float *pfActSum)
 calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges
 
void searchSubTreeSeparation (VesselNode *pRoot, const Vector3 &separationDirection, std::vector< VesselEdge * > &vClassifiedEdges)
 
void searchST_MajorBifurcation (VesselEdge *pStartEdge, float fMinorLimit, std::vector< VesselEdge * > *pvEdges, bool bClear=true)
 search for first major bifurcation following main edge starting with pStartEdge, use label property to differentiate major and minor branches.
 
void searchST_MajorBifurcation (VesselEdge *pStartEdge, float fMinorLimitStart, float fMinorLimitStep, int nMinorLimitNumber, std::vector< VesselEdge * > *pvEdges, bool bClear=true)
 search for first major bifurcation following main edge starting with pStartEdge, use label property to differentiate major and minor branches.
 

evaluation of Graph structure

VesselNodesuggestRoot (float fSignificanceLevel=0.7f, int nPreferedDirection=0)
 Search for root-node: look for leaf with thick edge seated remote from the barycenter of the Graph.
 
const VesselNodegetParent (const VesselNode *pN1, const VesselNode *pN2) const
 get pointer to common parent if exists or NULL
 
const VesselNodegetParent (const VesselEdge *pE1, const VesselEdge *pE2) const
 
VesselNodegetParent (VesselNode *pN1, VesselNode *pN2)
 
VesselNodegetParent (VesselEdge *pE1, VesselEdge *pE2)
 

Detailed Description

— Class GraphAnalyser

class for user-friendly hosting of implemented methods to analyze graph structure:

  • measure euclidean length of all edges and set edge 'Length' property

Definition at line 148 of file mlGraphAnalyser.h.

Constructor & Destructor Documentation

◆ GraphAnalyser()

GraphAnalyser::GraphAnalyser ( Graph * pGraph)
inlineexplicit

constructor: provide pointer pGraph for easy access to Graph object

Definition at line 157 of file mlGraphAnalyser.h.

Member Function Documentation

◆ calcDistanceMatrix()

bool GraphAnalyser::calcDistanceMatrix ( MatrixTemplate< double > & dm,
std::vector< int > & vId,
int nMaxNodes )

Calculate Distance Matrix for rooted Graph, taking hierarchy into account: dm(n1, n2) := minimal distance between n1 and a conjoint parent node of n1 and n2 nMaxNodes: maximal Number of notes taken into account Nodes are cumulated in order of descending hierarchy to get a equably resolution dm: Matrix to store result, size is matched automatically.

◆ calcNodeBaseFromPosition()

bool GraphAnalyser::calcNodeBaseFromPosition ( const Vector3 & vPosition,
const std::vector< int > & vId,
std::vector< CIdxFloat > * pvResult )

Calculate representation of spatial position in node coordinates.

Coordinates are given by nadir and distance of the given point respective to the plane, defined by the tree nearest nodes.

◆ calcNodeClassifikator()

bool GraphAnalyser::calcNodeClassifikator ( CDoubleArray * pArAssoc,
std::vector< int > * pvId,
int nMaxNodes )

stack Node classificators in (*pArAssoc) (n1,n1): classificators based on single Node n1 respect to global tree structure [0]: relative X position [1]: relative Y position [2]: relative Z position [3]: 0/1 left resp.

right lung

(n1,n2): second order classificators based on association of two nodes n1 and n2 (n2 < n1) [0]: grade of node n1 being parent node [1]: grade of node n1 being parent node [2]: no conjoint path of n1 and n2 -> attribute 'parent node meaningless' [3]: euclidean distance of n1 and n2

At the moment the values used are not pure fuzzy classificator: they did not describe the peculiarity of a specific attribute like 'belong to upper left region' in the range 0..1. The aim is to reach second order classificator for the association matrix of two graphs based on relative similarity of the two graphs not biased by specifications of the single graph only.

◆ calcPositionFromNodeBase()

bool GraphAnalyser::calcPositionFromNodeBase ( std::vector< CIdxFloat > vBase,
Vector3 * pvResult )

Calculate spatial vector position form relative node coordinates.

The coordinates are interpreted in terms of plane coordinates and nadir distance with respect to three nodes supplied by index-nr.

◆ calcSpannedVolume()

double GraphAnalyser::calcSpannedVolume ( const std::vector< int > & vId)

Calculate Volume of minimal cube including all supplied nodes.

◆ collectLeafs()

void GraphAnalyser::collectLeafs ( VesselNode * pRoot,
std::vector< VesselNode * > & pLeafs )

Collect all leafs which are children of node pRoot and append them to pLeafs.

◆ getParent() [1/4]

const VesselNode * GraphAnalyser::getParent ( const VesselEdge * pE1,
const VesselEdge * pE2 ) const

◆ getParent() [2/4]

const VesselNode * GraphAnalyser::getParent ( const VesselNode * pN1,
const VesselNode * pN2 ) const

get pointer to common parent if exists or NULL

◆ getParent() [3/4]

VesselNode * GraphAnalyser::getParent ( VesselEdge * pE1,
VesselEdge * pE2 )

◆ getParent() [4/4]

VesselNode * GraphAnalyser::getParent ( VesselNode * pN1,
VesselNode * pN2 )

◆ measureAvMinDistance()

float GraphAnalyser::measureAvMinDistance ( )

Get the average minimal distance over all skeletons of an edge and set edge 'averageMinDistance' property in the Graph.

Return global maximum of distances.

◆ measureBarycenter()

Vector3 GraphAnalyser::measureBarycenter ( )

Get barycenter position of all the Graph.

◆ measureLength()

void GraphAnalyser::measureLength ( )

Get the euclidean length of all graph edges and set edge 'Length' property in the Graph.

◆ measureMaxPathValue()

void GraphAnalyser::measureMaxPathValue ( VesselNode * pRootNode,
VesselEdge::EdgeGetFkt edgeGetFkt,
VesselNode::NodeGetFkt nodeGetFkt,
VesselNode::NodeSetFkt nodeSetFkt )

For each node calculate the maximum sum of edge values in a single path below this node. CAUTION: Works with directed, acyclic graphs only!

◆ measureSkeletonArea()

void GraphAnalyser::measureSkeletonArea ( int nAvLength = 5)

measure floating average of SkeletonArea and set area property

◆ measureST_Barycenter()

void GraphAnalyser::measureST_Barycenter ( bool bIgnoreOrientation = false)

Get the euclidean volume of all graph edges connected with given root, nodes cumulate them according to orientation and set edge 'ST_Barycenter' property in the Graph.

Parameters
bIgnoreOrientationstate weather to use defined orientation of directed Graph or scan tree independent

◆ measureST_Volume()

void GraphAnalyser::measureST_Volume ( bool bIgnoreOrientation = false)

Get the euclidean volume of all graph edges connected with given root, nodes cumulate them according to orientation and set edge 'ST_Volume' property in the Graph.

Parameters
bIgnoreOrientationstate weather to use defined orientation of directed Graph or scan tree independent

◆ measureVolume()

void GraphAnalyser::measureVolume ( )

Get the euclidean volume of all graph edges and set edge 'Volume' property in the Graph.

◆ sampleConnectedCluster()

short GraphAnalyser::sampleConnectedCluster ( )

identify connected subgraph return value is number of identified cluster

◆ scanSkeletonLabelMinMax()

void GraphAnalyser::scanSkeletonLabelMinMax ( float * min,
float * max )

evaluate min/max value of skeleton labels

◆ searchMaxSubTrees() [1/3]

void GraphAnalyser::searchMaxSubTrees ( std::vector< VesselEdge * > vStartEdges,
int nPos,
unsigned int nNum,
std::vector< VesselEdge * > * pvMaxEdges,
float * pfActValue,
float * pfActSum )
inline

calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges

Parameters
vStartEdgesbase Edges to start search with
nPosposition of start edge
nNumnumber of subtress to be selected
pvMaxEdgesset of Edges representing max subtrees
pfActValueminimal feature value of currently selected subtrees
pfActSumtotal feature sum of currently selected subtrees

Definition at line 229 of file mlGraphAnalyser.h.

References mlrange_cast().

◆ searchMaxSubTrees() [2/3]

void GraphAnalyser::searchMaxSubTrees ( std::vector< VesselEdge * > vStartEdges,
unsigned int nNum,
std::vector< VesselEdge * > * pvMaxEdges,
float * pfActValue,
float * pfActSum )
inline

calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges

Parameters
vStartEdgesbase Edges to start search with
nNumnumber of subtress to be selected
pvMaxEdgesset of Edges representing max subtrees
pfActValueminimal feature value of currently selected subtrees
pfActSumtotal feature sum of currently selected subtrees

Definition at line 217 of file mlGraphAnalyser.h.

References mlrange_cast().

◆ searchMaxSubTrees() [3/3]

void GraphAnalyser::searchMaxSubTrees ( std::vector< VesselEdge * >::iterator iBegin,
std::vector< VesselEdge * >::iterator iEnd,
int nNum,
std::vector< VesselEdge * > * pvMaxEdges,
float * pfActValue,
float * pfActSum )

calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges

Parameters
nNumnumber of subtress to be selected
pvMaxEdgesset of Edges representing max subtrees
pfActValueminimal feature value of currently selected subtrees
pfActSumtotal feature sum of currently selected subtrees

◆ searchST_MajorBifurcation() [1/2]

void GraphAnalyser::searchST_MajorBifurcation ( VesselEdge * pStartEdge,
float fMinorLimit,
std::vector< VesselEdge * > * pvEdges,
bool bClear = true )

search for first major bifurcation following main edge starting with pStartEdge, use label property to differentiate major and minor branches.

The graph must be directed.

Parameters
pStartEdgeedge to start with
fMinorLimitrelative feature limit characterizing minor branches
pvEdgesresulting branches of first major bifurcation
bClearclear old entries in result edge vector

◆ searchST_MajorBifurcation() [2/2]

void GraphAnalyser::searchST_MajorBifurcation ( VesselEdge * pStartEdge,
float fMinorLimitStart,
float fMinorLimitStep,
int nMinorLimitNumber,
std::vector< VesselEdge * > * pvEdges,
bool bClear = true )

search for first major bifurcation following main edge starting with pStartEdge, use label property to differentiate major and minor branches.

Starting from fMinorLimitStart the major/minor limit is stepwise reduced until a bifurcation is found. The graph must be directed.

Parameters
pStartEdgeedge to start with
fMinorLimitStartstart value of relative feature limit characterizing minor branches
fMinorLimitStepvalue for stepwise reduction of the relative featur limit
nMinorLimitNumbernumber of trails
pvEdgesresulting branches of first major bifurcation
bClearclear old entries in result edge vector

◆ searchSubTreeSeparation()

void GraphAnalyser::searchSubTreeSeparation ( VesselNode * pRoot,
const Vector3 & separationDirection,
std::vector< VesselEdge * > & vClassifiedEdges )

◆ suggestRoot()

VesselNode * GraphAnalyser::suggestRoot ( float fSignificanceLevel = 0.7f,
int nPreferedDirection = 0 )

Search for root-node: look for leaf with thick edge seated remote from the barycenter of the Graph.

◆ sumupST_DrainVolume()

void GraphAnalyser::sumupST_DrainVolume ( bool bIgnoreOrientation = false)
inline

cumulate DrainVolumes given at the leafs

Parameters
bIgnoreOrientationstate weather to use defined orientation of directed Graph or scan tree independent

Definition at line 300 of file mlGraphAnalyser.h.

References mlrange_cast().

◆ sumupST_Value()

void GraphAnalyser::sumupST_Value ( VesselNode::NodeGetFkt getFkt,
VesselNode::NodeSetFkt setFkt,
bool bIgnoreOrientation = false )
Parameters
getFktobject bound function pointer to get Node parameter
setFktobject bound function pointer to set Node parameter
bIgnoreOrientationstate weather to use defined orientation of directed Graph or scan tree independent

◆ tansferLabels()

void GraphAnalyser::tansferLabels ( Skeleton::LABELTYPE NType,
float fThresh = 0.1f )

transfer Vessel-Edge labels to Skeleton

◆ tansferLabelsInverse()

void GraphAnalyser::tansferLabelsInverse ( void )

transfer skeleton labels to vessel edge label (take label of most frequent skeleton)


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