00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkBloxCoreAtomPixel_h
00018 #define __itkBloxCoreAtomPixel_h
00019
00020 #include "vnl/vnl_matrix_fixed.h"
00021 #include "vnl/vnl_vector_fixed.h"
00022 #include "vnl/algo/vnl_generalized_eigensystem.h"
00023
00024 #include "itkObject.h"
00025 #include "itkBloxCoreAtomItem.h"
00026 #include "itkBloxBoundaryPointItem.h"
00027 #include "itkPoint.h"
00028 #include "itkCovariantVector.h"
00029 #include "itkBloxPixel.h"
00030
00031 namespace itk
00032 {
00033
00041 template <unsigned int NDimensions>
00042 class ITK_EXPORT BloxCoreAtomPixel : public BloxPixel<
00043 BloxCoreAtomItem<NDimensions> >
00044 {
00045 public:
00046
00048 typedef BloxCoreAtomPixel Self;
00049 typedef BloxPixel< BloxCoreAtomItem<NDimensions> > Superclass;
00050 typedef SmartPointer<Self> Pointer;
00051 typedef SmartPointer<const Self> ConstPointer;
00052
00054 typedef BloxCoreAtomItem<NDimensions> CoreAtomItemType;
00055
00057 typedef BloxBoundaryPointItem<NDimensions> BPItemType;
00058
00060 typedef Point<double, NDimensions> PositionType;
00061
00063 typedef CovariantVector<double, NDimensions> GradientType;
00064
00066 typedef vnl_vector_fixed<double, NDimensions> VectorType;
00067
00069 typedef vnl_vector_fixed<double, NDimensions> EigenvalueType;
00070
00072 typedef vnl_matrix_fixed<double, NDimensions, NDimensions> EigenvectorType;
00073
00075 typedef vnl_matrix_fixed<double, NDimensions, NDimensions> MatrixType;
00076
00078 double CalcMeanCoreAtomDiameter();
00079
00082 bool DoCoreAtomEigenanalysis();
00083
00085 void DoVotedEigenanalysis();
00086
00088 double GetMeanCoreAtomDiameter() {return m_MeanCoreAtomDiameter;}
00089 double GetMeanCoreAtomIntensity() {return m_MeanCoreAtomIntensity;}
00090 EigenvalueType GetEigenvalues() {return m_Eigenvalues;}
00091 EigenvalueType GetVotedEigenvalues() {return m_VotedEigenvalues;}
00092 EigenvectorType GetEigenvectors() {return m_Eigenvectors;}
00093 EigenvectorType GetVotedEigenvectors() {return m_VotedEigenvectors;}
00094 PositionType GetLocationSums() {return m_LocationSums;}
00095 double GetWeightSum() {return m_WeightSum;}
00097
00099 MatrixType* GetRawCMatrixPointer() {return &m_RawCMatrix;}
00100
00102 void CollectVote(MatrixType* pMatrix, double strength, double count);
00103
00105 void NormalizeVotedCMatrix();
00106
00108 void CalcWeightedCoreAtomLocation(double weight_factor, Self * votingPixel);
00109
00111 void CalcMeanCoreAtomIntensity();
00112
00114 PositionType GetVotedLocation();
00115
00116 BloxCoreAtomPixel();
00117 ~BloxCoreAtomPixel();
00118
00119 private:
00120
00122 double m_MeanCoreAtomDiameter;
00123
00125 MatrixType m_RawCMatrix;
00126
00130 EigenvalueType m_Eigenvalues;
00131
00134 EigenvectorType m_Eigenvectors;
00135
00137 MatrixType m_VotedCMatrix;
00138
00140 EigenvalueType m_VotedEigenvalues;
00141
00143 EigenvectorType m_VotedEigenvectors;
00144
00147 double m_ConstituencySize;
00148
00150 PositionType m_LocationSums;
00151
00153 PositionType m_VotedLocation;
00154
00156 double m_WeightSum;
00157
00159 double m_MeanCoreAtomIntensity;
00160 };
00161
00162
00163 }
00164
00165
00166 #define ITK_TEMPLATE_BloxCoreAtomPixel(_, EXPORT, x, y) namespace itk { \
00167 _(1(class EXPORT BloxCoreAtomPixel< ITK_TEMPLATE_1 x >)) \
00168 namespace Templates { typedef BloxCoreAtomPixel< ITK_TEMPLATE_1 x > \
00169 BloxCoreAtomPixel##y; } \
00170 }
00171
00172 #if ITK_TEMPLATE_EXPLICIT
00173 # include "Templates/itkBloxCoreAtomPixel+-.h"
00174 #endif
00175
00176 #if ITK_TEMPLATE_TXX
00177 # include "itkBloxCoreAtomPixel.txx"
00178 #endif
00179
00180 #endif
00181