forked from InsightSoftwareConsortium/ITK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
itkCorrespondingMedialNodeClique.h
124 lines (92 loc) · 3.94 KB
/
itkCorrespondingMedialNodeClique.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: itkCorrespondingMedialNodeClique.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __itkCorrespondingMedialNodeClique_h
#define __itkCorrespondingMedialNodeClique_h
#include "vnl/vnl_matrix.h"
#include "vnl/vnl_vector.h"
#include "vnl/vnl_vector_fixed.h"
#include "vnl/vnl_matrix_fixed.h"
#include "itkFixedArray.h"
#include "itkBloxCoreAtomPixel.h"
#include <list>
namespace itk
{
/**
* \class CorrespondingMedialNodeClique
* \brief CorrespondingMedialNodeClique is an item stored
* in CorrespondingNodeList. Specifically it is stored in
* corresponding node lists and contain pointers to a
* set of medial nodes (cliques).
*
* */
template <unsigned int VImageDimension, unsigned int VCliqueSize>
class CorrespondingMedialNodeClique
{
public:
/** Medial node typedef. */
typedef BloxCoreAtomPixel<VImageDimension> ItemType;
/** A vector of pointers to medial nodes. */
std::vector<ItemType*> m_ItemPointer;
/** Set the pointer to medial nodes. */
void SetNodePointer(ItemType* itemPointer, unsigned int index)
{m_ItemPointer[index] = itemPointer;}
/** Coordinate of node in clique in physical space. */
typedef FixedArray<vnl_vector_fixed<double, VImageDimension>, VCliqueSize>
CoordinateType;
/** Center mass of node clique in physical space. */
typedef vnl_vector_fixed<double, VCliqueSize> CenterOfMassType;
/** Transform matrix. */
typedef vnl_matrix_fixed<double, VImageDimension+1, VImageDimension+1>
TransformMatrixType;
/** Set and get the coordinates of the nodes in the clique. */
void SetNodeCoordinates(CoordinateType * coordinates)
{m_NodeCoordinates = coordinates;}
CoordinateType * GetNodeCoordinates() {return m_NodeCoordinates;}
/** Set and get the center of mass of the clique. */
void SetCenterOfMass(CenterOfMassType * centerOfMass)
{m_CenterOfMass = centerOfMass;}
CenterOfMassType * GetCenterOfMass() { return m_CenterOfMass;}
/** Set and get the transform matrix. */
void SetTransformMatrix(TransformMatrixType* transformMatrix)
{m_TransformMatrix = transformMatrix;}
TransformMatrixType * GetTransformMatrix() {return m_TransformMatrix;}
/** Set and get the node index. */
void SetNodeIndex(int index, int nodeIndex)
{m_NodeIndex[index] = nodeIndex;}
int GetNodeIndex(int index) {return m_NodeIndex[index];}
/** Set and get the correspondence value. */
void SetCorrespondenceValue(int index, float correspondenceValue)
{m_CorrespondenceValue[index] = correspondenceValue;}
float GetCorrespondenceValue(int index)
{return m_CorrespondenceValue[index];}
CorrespondingMedialNodeClique();
~CorrespondingMedialNodeClique();
private:
/** Coordinate of the nodes of the clique. */
CoordinateType * m_NodeCoordinates;
/** Center of mass of the node clique. */
CenterOfMassType * m_CenterOfMass;
/** Transform matrix. */
TransformMatrixType * m_TransformMatrix;
/** Index of medial nodes in this clique. */
int m_NodeIndex[VCliqueSize];
/** Store the correspondence value. */
float m_CorrespondenceValue[VCliqueSize];
/** Average distance between nodes of clique in physical space. */
double m_AverageDistance;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkCorrespondingMedialNodeClique.txx"
#endif
#endif