MeVisLabToolboxReference
|
#include <mlGraphAnalyser.h>
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 | |
VesselNode * | 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. | |
short | sampleConnectedCluster () |
identify connected subgraph return value is number of identified cluster | |
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 143 of file mlGraphAnalyser.h.
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.
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.
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 | ) |
void ml::GraphAnalyser::measureST_Volume | ( | bool | bIgnoreOrientation = false | ) |
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
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 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
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 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
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 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.
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 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.
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 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
bIgnoreOrientation | state 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 |
||
) |
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 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)