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
00110 void CalcWeightedCoreAtomLocation(double weight_factor, Self * votingPixel);
00111
00113 void CalcMeanCoreAtomIntensity();
00114
00116 PositionType GetVotedLocation();
00117
00118 BloxCoreAtomPixel();
00119 ~BloxCoreAtomPixel();
00120
00121 private:
00122
00124 double m_MeanCoreAtomDiameter;
00125
00127 MatrixType m_RawCMatrix;
00128
00132 EigenvalueType m_Eigenvalues;
00133
00136 EigenvectorType m_Eigenvectors;
00137
00139 MatrixType m_VotedCMatrix;
00140
00142 EigenvalueType m_VotedEigenvalues;
00143
00145 EigenvectorType m_VotedEigenvectors;
00146
00149 double m_ConstituencySize;
00150
00152 PositionType m_LocationSums;
00153
00155 PositionType m_VotedLocation;
00156
00158 double m_WeightSum;
00159
00161 double m_MeanCoreAtomIntensity;
00162 };
00163
00164
00165 }
00166
00167
00168 #define ITK_TEMPLATE_BloxCoreAtomPixel(_, EXPORT, x, y) namespace itk { \
00169 _(1(class EXPORT BloxCoreAtomPixel< ITK_TEMPLATE_1 x >)) \
00170 namespace Templates { typedef BloxCoreAtomPixel< ITK_TEMPLATE_1 x > \
00171 BloxCoreAtomPixel##y; } \
00172 }
00173
00174 #if ITK_TEMPLATE_EXPLICIT
00175 # include "Templates/itkBloxCoreAtomPixel+-.h"
00176 #endif
00177
00178 #if ITK_TEMPLATE_TXX
00179 # include "itkBloxCoreAtomPixel.txx"
00180 #endif
00181
00182 #endif
00183