ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkDistanceToCentroidMembershipFunction_h 00019 #define __itkDistanceToCentroidMembershipFunction_h 00020 00021 #include "itkMembershipFunctionBase.h" 00022 #include "itkDistanceMetric.h" 00023 00024 namespace itk 00025 { 00026 namespace Statistics 00027 { 00044 template< class TVector > 00045 class ITK_EXPORT DistanceToCentroidMembershipFunction: 00046 public MembershipFunctionBase< TVector > 00047 { 00048 public: 00050 typedef DistanceToCentroidMembershipFunction Self; 00051 typedef MembershipFunctionBase< TVector > Superclass; 00052 typedef SmartPointer< Self > Pointer; 00053 typedef SmartPointer< const Self > ConstPointer; 00054 00056 itkTypeMacro(DistanceToCentroidMembershipFunction, 00057 MembershipFunctionBase); 00058 itkNewMacro(Self); 00060 00062 typedef typename Superclass::Pointer MembershipFunctionPointer; 00063 00065 typedef TVector MeasurementVectorType; 00066 00068 typedef typename Superclass::MeasurementVectorSizeType 00069 MeasurementVectorSizeType; 00070 00072 virtual void SetMeasurementVectorSize(MeasurementVectorSizeType); 00073 00075 typedef DistanceMetric< MeasurementVectorType > DistanceMetricType; 00076 typedef typename DistanceMetricType::Pointer DistanceMetricPointer; 00077 typedef typename DistanceMetricType::OriginType CentroidType; 00078 00080 itkSetObjectMacro(DistanceMetric, DistanceMetricType); 00081 00083 itkGetConstObjectMacro(DistanceMetric, DistanceMetricType); 00084 00088 itkGetObjectMacro(DistanceMetric, DistanceMetricType); 00089 00091 void SetCentroid(const CentroidType & centroid); 00092 00094 const CentroidType & GetCentroid() const; 00095 00099 double Evaluate(const MeasurementVectorType & measurement) const; 00100 00101 protected: 00102 DistanceToCentroidMembershipFunction(void); 00103 virtual ~DistanceToCentroidMembershipFunction(void) {} 00104 void PrintSelf(std::ostream & os, Indent indent) const; 00105 00107 virtual typename LightObject::Pointer InternalClone() const; 00108 00109 private: 00110 DistanceToCentroidMembershipFunction(const Self &); //purposely not implemented 00111 void operator=(const Self &); //purposely not implemented 00112 00113 DistanceMetricPointer m_DistanceMetric; 00114 }; 00115 } // end of namespace Statistics 00116 } // end namespace itk 00117 00118 #ifndef ITK_MANUAL_INSTANTIATION 00119 #include "itkDistanceToCentroidMembershipFunction.hxx" 00120 #endif 00121 00122 #endif 00123