MeVisLab Toolbox 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 | |
VesselNode * | 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. | |
const VesselNode * | getParent (const VesselNode *pN1, const VesselNode *pN2) const |
get pointer to common parent if exists or NULL | |
const VesselNode * | getParent (const VesselEdge *pE1, const VesselEdge *pE2) const |
VesselNode * | getParent (VesselNode *pN1, VesselNode *pN2) |
VesselNode * | getParent (VesselEdge *pE1, VesselEdge *pE2) |
— Class GraphAnalyser
class for user-friendly hosting of implemented methods to analyze graph structure:
Definition at line 148 of file mlGraphAnalyser.h.
|
inlineexplicit |
constructor: provide pointer pGraph
for easy access to Graph object
Definition at line 157 of file mlGraphAnalyser.h.
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.
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.
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.
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.
Calculate Volume of minimal cube including all supplied nodes.
void GraphAnalyser::collectLeafs | ( | VesselNode * | pRoot, |
std::vector< VesselNode * > & | pLeafs ) |
Collect all leafs which are children of node pRoot
and append them to pLeafs
.
const VesselNode * GraphAnalyser::getParent | ( | const VesselEdge * | pE1, |
const VesselEdge * | pE2 ) const |
const VesselNode * GraphAnalyser::getParent | ( | const VesselNode * | pN1, |
const VesselNode * | pN2 ) const |
get pointer to common parent if exists or NULL
VesselNode * GraphAnalyser::getParent | ( | VesselEdge * | pE1, |
VesselEdge * | pE2 ) |
VesselNode * GraphAnalyser::getParent | ( | VesselNode * | pN1, |
VesselNode * | pN2 ) |
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.
Vector3 GraphAnalyser::measureBarycenter | ( | ) |
Get barycenter position of all the Graph
.
void GraphAnalyser::measureLength | ( | ) |
Get the euclidean length of all graph edges and set edge 'Length' property in the Graph
.
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!
measure floating average of SkeletonArea and set area property
void GraphAnalyser::measureVolume | ( | ) |
Get the euclidean volume of all graph edges and set edge 'Volume' property in the Graph
.
short GraphAnalyser::sampleConnectedCluster | ( | ) |
identify connected subgraph return value is number of identified cluster
evaluate min/max value of skeleton labels
|
inline |
calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges
vStartEdges | base Edges to start search with |
nPos | position of start edge |
nNum | number of subtress to be selected |
pvMaxEdges | set of Edges representing max subtrees |
pfActValue | minimal feature value of currently selected subtrees |
pfActSum | total feature sum of currently selected subtrees |
Definition at line 229 of file mlGraphAnalyser.h.
References mlrange_cast().
|
inline |
calculate set of edges representing nNum subtrees maximizing selected feature stored in label property of the edges
vStartEdges | base Edges to start search with |
nNum | number of subtress to be selected |
pvMaxEdges | set of Edges representing max subtrees |
pfActValue | minimal feature value of currently selected subtrees |
pfActSum | total feature sum of currently selected subtrees |
Definition at line 217 of file mlGraphAnalyser.h.
References mlrange_cast().
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
nNum | number of subtress to be selected |
pvMaxEdges | set of Edges representing max subtrees |
pfActValue | minimal feature value of currently selected subtrees |
pfActSum | total feature sum of currently selected subtrees |
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.
pStartEdge | edge to start with |
fMinorLimit | relative feature limit characterizing minor branches |
pvEdges | resulting branches of first major bifurcation |
bClear | clear old entries in result edge vector |
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.
pStartEdge | edge to start with |
fMinorLimitStart | start value of relative feature limit characterizing minor branches |
fMinorLimitStep | value for stepwise reduction of the relative featur limit |
nMinorLimitNumber | number of trails |
pvEdges | resulting branches of first major bifurcation |
bClear | clear old entries in result edge vector |
void GraphAnalyser::searchSubTreeSeparation | ( | VesselNode * | pRoot, |
const Vector3 & | separationDirection, | ||
std::vector< VesselEdge * > & | vClassifiedEdges ) |
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.
cumulate DrainVolumes given at the leafs
bIgnoreOrientation | state weather to use defined orientation of directed Graph or scan tree independent |
Definition at line 300 of file mlGraphAnalyser.h.
References mlrange_cast().
void GraphAnalyser::sumupST_Value | ( | VesselNode::NodeGetFkt | getFkt, |
VesselNode::NodeSetFkt | setFkt, | ||
bool | bIgnoreOrientation = false ) |
getFkt | object bound function pointer to get Node parameter |
setFkt | object bound function pointer to set Node parameter |
bIgnoreOrientation | state weather to use defined orientation of directed Graph or scan tree independent |
void GraphAnalyser::tansferLabels | ( | Skeleton::LABELTYPE | NType, |
float | fThresh = 0.1f ) |
transfer Vessel-Edge labels to Skeleton
transfer skeleton labels to vessel edge label (take label of most frequent skeleton)