MeVisLabToolboxReference
ml::GraphAnalyser Class Reference

#include <mlGraphAnalyser.h>

List of all members.

Public Member Functions

void tansferLabels (Skeleton::LABELTYPE NType, float fThresh=0.1)
 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_DrainVolume (bool bIgnoreOrientation=false)
 cumulate DrainVolumes given at the leafs
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.
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.

evaluation of Graph structure

VesselNodesuggestRoot (float fSignificanceLevel=0.7, int nPreferedDirection=0)
 Search for root-node: look for leaf with thick edge seated remote from the barycenter of the Graph.
short sampleConnectedCluster ()
 identify connected subgraph return value is number of identified cluster
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 euklidian length of all edges and set edge 'Length' property

Definition at line 143 of file mlGraphAnalyser.h.


Constructor & Destructor Documentation

ml::GraphAnalyser::GraphAnalyser ( Graph pGraph) [inline, explicit]

constructor: provide pointer pGraph for easy access to Graph object

Definition at line 152 of file mlGraphAnalyser.h.


Member Function Documentation

bool ml::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.

bool ml::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.

bool ml::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.

bool ml::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.

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

Calculate Volume of minimal cube including all supplied nodes.

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

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

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

get pointer to common parent if exists or NULL

float ml::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.

Vector3 ml::GraphAnalyser::measureBarycenter ( )

Get barycenter position of all the Graph.

void ml::GraphAnalyser::measureLength ( )

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

void ml::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!

void ml::GraphAnalyser::measureSkeletonArea ( int  nAvLength = 5)

measure floating average of SkeletonArea and set area property

void ml::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
void ml::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
void ml::GraphAnalyser::measureVolume ( )

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

short ml::GraphAnalyser::sampleConnectedCluster ( )

identify connected subgraph return value is number of identified cluster

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

evaluate min/max value of skeleton labels

void ml::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
void ml::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 230 of file mlGraphAnalyser.h.

void ml::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 218 of file mlGraphAnalyser.h.

void ml::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
void ml::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
void ml::GraphAnalyser::searchSubTreeSeparation ( VesselNode pRoot,
const Vector3 separationDirection,
std::vector< VesselEdge * > &  vClassifiedEdges 
)
VesselNode* ml::GraphAnalyser::suggestRoot ( float  fSignificanceLevel = 0.7,
int  nPreferedDirection = 0 
)

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

void ml::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 192 of file mlGraphAnalyser.h.

void ml::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
void ml::GraphAnalyser::tansferLabels ( Skeleton::LABELTYPE  NType,
float  fThresh = 0.1 
)

transfer Vessel-Edge labels to Skeleton

void ml::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: