# Statistics Framework Refactor Membership Functions

Jim Miller
2011-06-11
Refactoring of the Statistics MembershipFunctions classes. Unified the Gaussian and Mahalanobis membership functions traits and API to use the same trait names and data types for the mean and covariance. Major API change is affects the MahalanobisDistanceMembershipFunction. This function no longer uses vnl_vector and vnl_matrix for the mean and covariance types. Rather, for the MeanVectorType, it uses a vector type consistent with the MeasurementVectorType but with an element type that is real. So if the MeasurementVectorType is a Vector<int,3>, the MeanVectorType is a Vector<double,3>. The CovarianceMatrixType was changed from a vnl_matrix to a VariableSizedMatrix to be consistent with the GaussianMembershipFunction. This can affect how user code calls the MahalanobisDistanceMembershipFunction API. Minor API change is the name of the traits used. MeanType was changed to MeanVectorType and CovarianceType was changed to CovarianceMatrixType to be consistent with the toolkit. Finally, MahalanobisDistanceMembershipFunction::SetNumberOfSamples() and MahalanobisDistanceMembershipFunction::GetNumberOfSamples() were not used in any calculations. Methods have been removed. Similarly, the methods to set and get the InverseCovariance were removed to be consistent with the GaussianMembershipFunction.
DensityFunctionType::MeanType mean( 2 ); DensityFunctionType::CovarianceType cov;
DensityFunctionType::MeanVectorType mean( 2 ); DensityFunctionType::CovarianceMatrixType cov;
Ic51f5726ed7106e3799ad9e7f7846c796950fc1d
Examples/Statistics/GaussianMembershipFunction.cxx Modules/Core/ImageFunction/include/itkMahalanobisDistanceThresholdImageFunction.h Modules/Core/ImageFunction/include/itkMahalanobisDistanceThresholdImageFunction.txx Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx Modules/Numerics/Statistics/include/itkDistanceToCentroidMembershipFunction.h Modules/Numerics/Statistics/include/itkDistanceToCentroidMembershipFunction.txx Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.txx Modules/Numerics/Statistics/include/itkGaussianMembershipFunction.h Modules/Numerics/Statistics/include/itkGaussianMembershipFunction.txx Modules/Numerics/Statistics/include/itkGaussianMixtureModelComponent.h Modules/Numerics/Statistics/include/itkGaussianMixtureModelComponent.txx Modules/Numerics/Statistics/include/itkMahalanobisDistanceMembershipFunction.h Modules/Numerics/Statistics/include/itkMahalanobisDistanceMembershipFunction.txx Modules/Numerics/Statistics/include/itkMembershipFunctionBase.h Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx Modules/Segmentation/Classifiers/include/itkBayesianClassifierInitializationImageFilter.txx Modules/Segmentation/Classifiers/include/itkImageGaussianModelEstimator.h Modules/Segmentation/Classifiers/include/itkImageGaussianModelEstimator.txx Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx Modules/Segmentation/LevelSets/include/itkVectorThresholdSegmentationLevelSetFunction.h