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 BloxCoreAtomPixel : public BloxPixel< BloxCoreAtomItem<NDimensions> >
00043 {
00044 public:
00045
00047 typedef BloxCoreAtomPixel<NDimensions> Self;
00048
00050 typedef BloxCoreAtomItem<NDimensions> CoreAtomItemType;
00051
00053 typedef BloxBoundaryPointItem<NDimensions> BPItemType;
00054
00056 typedef Point<double, NDimensions> PositionType;
00057
00059 typedef CovariantVector<double, NDimensions> GradientType;
00060
00062 typedef vnl_vector_fixed<double, NDimensions> VectorType;
00063
00065 typedef vnl_vector_fixed<double, NDimensions> EigenvalueType;
00066
00068 typedef vnl_matrix_fixed<double, NDimensions, NDimensions> EigenvectorType;
00069
00071 typedef vnl_matrix_fixed<double, NDimensions, NDimensions> MatrixType;
00072
00074 double CalcMeanCoreAtomDiameter();
00075
00077 bool DoCoreAtomEigenanalysis();
00078
00080 void DoVotedEigenanalysis();
00081
00083 double GetMeanCoreAtomDiameter() {return m_MeanCoreAtomDiameter;}
00084 double GetMeanCoreAtomIntensity() {return m_MeanCoreAtomIntensity;}
00085 EigenvalueType GetEigenvalues() {return m_Eigenvalues;}
00086 EigenvalueType GetVotedEigenvalues() {return m_VotedEigenvalues;}
00087 EigenvectorType GetEigenvectors() {return m_Eigenvectors;}
00088 EigenvectorType GetVotedEigenvectors() {return m_VotedEigenvectors;}
00089 PositionType GetLocationSums() {return m_LocationSums;}
00090 double GetWeightSum() {return m_WeightSum;}
00091
00093 MatrixType* GetRawCMatrixPointer() {return &m_RawCMatrix;}
00094
00096 void CollectVote(MatrixType* pMatrix, double strength, double count);
00097
00099 void NormalizeVotedCMatrix();
00100
00102 void CalcWeightedCoreAtomLocation(double weight_factor, Self * votingPixel);
00103
00105 void CalcMeanCoreAtomIntensity();
00106
00108 PositionType GetVotedLocation();
00109
00110 BloxCoreAtomPixel();
00111 ~BloxCoreAtomPixel();
00112
00113 private:
00114
00116 double m_MeanCoreAtomDiameter;
00117
00119 MatrixType m_RawCMatrix;
00120
00124 EigenvalueType m_Eigenvalues;
00125
00128 EigenvectorType m_Eigenvectors;
00129
00131 MatrixType m_VotedCMatrix;
00132
00134 EigenvalueType m_VotedEigenvalues;
00135
00137 EigenvectorType m_VotedEigenvectors;
00138
00141 double m_ConstituencySize;
00142
00144 PositionType m_LocationSums;
00145
00147 PositionType m_VotedLocation;
00148
00150 double m_WeightSum;
00151
00153 double m_MeanCoreAtomIntensity;
00154 };
00155
00156
00157 }
00158
00159 #ifndef ITK_MANUAL_INSTANTIATION
00160 #include "itkBloxCoreAtomPixel.txx"
00161 #endif
00162
00163 #endif