MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
AssocGraph.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 ASSOC_GRAPH_H
14#define ASSOC_GRAPH_H
15
16
18
19#include "mlVesselGraphSystem.h"
20#include "mlMatrixTemplate.h"
21
23#include <list>
24#include <vector>
25#include <valarray>
27
29
30
33typedef std::vector<double> CDouble1Vec;
34typedef std::vector<CDouble1Vec> CDouble2Vec;
35typedef std::vector<CDouble2Vec> CDoubleArray;
37
38#define N_XPPOS 0
39#define N_YPPOS 1
40#define N_ZPPOS 2
41#define N_RL 3
42
43#define N_EDGEA 0
44#define N_EDGEB 1
45#define N_EDGENO 2
46#define N_DIST 3
47
48#define DELTA_POS 0.1
49
50//------------------------------------------------------------------------------------------------------
52//------------------------------------------------------------------------------------------------------
55{
56public:
57 int _nP1;
58 int _nP2;
59
62 inline bool operator<(const PointMap& pm) const
63 {
64 if (_nP1 != pm._nP1) {
65 return _nP1 < pm._nP1;
66 }
67 else {
68 return _nP2 < pm._nP2;
69 }
70 }
71 inline bool operator==(const PointMap& pm) const
72 {
73 return ((_nP1 == pm._nP1) && (_nP2 == pm._nP2));
74 }
76};
77
78
79//------------------------------------------------------------------------------------------------------
81//------------------------------------------------------------------------------------------------------
84{
85public:
86 std::valarray<bool> _vPath;
87 double _dLength;
88 int _nIdx;
89
90 void* _pNode;
91
92 PathInfo(void);
93 PathInfo(size_t size);
94};
95
96
97//------------------------------------------------------------------------------------------------------
100//------------------------------------------------------------------------------------------------------
103{
104 size_t _N1;
105 size_t _N2;
106
107public:
108 std::valarray<bool> _w1;
109 std::valarray<bool> _w2;
110 std::list<PointMap> _LMap;
111
115 IsomorphismMap(size_t N1, size_t N2);
116 IsomorphismMap(size_t N1, size_t N2, const PointMap&);
119
123 bool operator==(const IsomorphismMap&) const;
124 bool operator<(const IsomorphismMap&) const;
126
129 bool addPointMap(const PointMap& pm);
131 int n);
133 void clear();
134 void resize(size_t N1, size_t N2);
136};
137
138
139//------------------------------------------------------------------------------------------------------
145//------------------------------------------------------------------------------------------------------
148{
150 std::list<PointMap> _LMapTable;
152 std::list<IsomorphismMap> _LIsoMap;
153
154 size_t _N1;
155 size_t _N2;
156
157
158public:
159 //--------------------------------------------------------------------------------------------
162 typedef std::list<PointMap>::iterator MapIterator;
163 typedef std::list<PointMap>::const_iterator constMapIterator;
164 typedef std::list<IsomorphismMap>::iterator IsoIterator;
165 typedef std::list<IsomorphismMap>::const_iterator constIsoIterator;
167 //--------------------------------------------------------------------------------------------
168
169
170 //--------------------------------------------------------------------------------------------
180 double dSigma,
181 double dScale
182 );
183
194 const CDoubleArray& AClass2,
195 double dSigma,
196 double dScale
197 );
198
201
203 bool calcAutoMaxClique(double* pdAssocLevel, double dStep = 0.1);
204
206 bool expandMap(int nIdx);
207
209 bool expandMap(int nIdx, double dAssocLevel);
211 //--------------------------------------------------------------------------------------------
212
213
214 //--------------------------------------------------------------------------------------------
217 std::string printMapInformation();
218
219 std::list<PointMap>* getPointMap()
220 {
221 return &_LMapTable;
222 }
223 std::list<IsomorphismMap>* getIsoMap()
224 {
225 return &_LIsoMap;
226 }
228 //--------------------------------------------------------------------------------------------
229};
230
231
233
234#endif
AssocGraph class provides a matrix representation of the association graph of two Graph objects.
Definition AssocGraph.h:148
std::string printMapInformation()
print information of map to string
bool calcAssocMatrix(const CDoubleArray &AClass1, const CDoubleArray &AClass2, double dSigma, double dScale)
calculate association graph by concatenation of classificator arrays of the to graphs
std::list< PointMap >::const_iterator constMapIterator
Definition AssocGraph.h:163
std::list< IsomorphismMap > * getIsoMap()
supply pointer to list of isomorphisms
Definition AssocGraph.h:223
bool calcMaxClique(double dAssocLevel)
brute force calculation of maximal clique of the association graph
std::list< IsomorphismMap >::const_iterator constIsoIterator
Definition AssocGraph.h:165
std::list< PointMap > * getPointMap()
supply pointer to list defining the max Clique
Definition AssocGraph.h:219
std::list< PointMap >::iterator MapIterator
Definition AssocGraph.h:162
bool calcAutoMaxClique(double *pdAssocLevel, double dStep=0.1)
simple attempt to calculate the maximal clique with an automatic estimation of the 'optimal' Associat...
bool expandMap(int nIdx, double dAssocLevel)
expand given isomorphism
bool expandMap(int nIdx)
expand given isomorphism
std::list< IsomorphismMap >::iterator IsoIterator
Definition AssocGraph.h:164
bool calcAssocMatrix(const MatrixTemplate< double > &mDist1, const MatrixTemplate< double > &mDist2, double dSigma, double dScale)
IsomorphismMap class handles the information of the isomorphism between two Graph structures in form ...
Definition AssocGraph.h:103
IsomorphismMap(const IsomorphismMap &)
bool operator==(const IsomorphismMap &) const
comparison to induce order for unambiguous lists
std::list< PointMap > _LMap
list of PointMap defining the isomorphism
Definition AssocGraph.h:110
std::valarray< bool > _w1
flag field to identify nodes of Graph 1 used in the isomorphism
Definition AssocGraph.h:108
void removePointMap(const PointMap &pm)
remove PointMap from list
bool operator<(const IsomorphismMap &) const
comparison to induce order for unambiguous lists
bool addPointMap(const PointMap &pm)
add PointMap and check compatibility
IsomorphismMap(size_t N1, size_t N2, const PointMap &)
IsomorphismMap & operator=(const IsomorphismMap &)
assignment operator
void resize(size_t N1, size_t N2)
set new size
bool addPointMapAscending(const PointMap &pm, int n)
add PointMap only, if of greater order then last PointMap in list
std::valarray< bool > _w2
flag field to identify nodes of Graph 2 used in the isomorphism
Definition AssocGraph.h:109
void clear()
clear list
IsomorphismMap(size_t N1, size_t N2)
general Matrix class based on MatrixTemplate<T> to allow fixed size setting with object declaration.
MatricTemplate implements general Matrix class based on valarray of objects with Template class type ...
class to store informations about connection path for use in calculation of distance matrices
Definition AssocGraph.h:84
int _nIdx
path id
Definition AssocGraph.h:88
PathInfo(size_t size)
constructor providing size information
double _dLength
length of path
Definition AssocGraph.h:87
void * _pNode
end node of path
Definition AssocGraph.h:90
PathInfo(void)
default constructor
std::valarray< bool > _vPath
bit-flag to store path information
Definition AssocGraph.h:86
PointMap constitutes a lightweight object for storage of data of two nodes.
Definition AssocGraph.h:55
bool operator==(const PointMap &pm) const
Definition AssocGraph.h:71
bool operator<(const PointMap &pm) const
Definition AssocGraph.h:62
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define VESSELGRAPH_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
std::vector< CDouble1Vec > CDouble2Vec
Definition AssocGraph.h:34
std::vector< double > CDouble1Vec
Definition AssocGraph.h:33
std::vector< CDouble2Vec > CDoubleArray
Definition AssocGraph.h:35