ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkImageModelEstimatorBase.h
Go to the documentation of this file.
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 __itkImageModelEstimatorBase_h
00019 #define __itkImageModelEstimatorBase_h
00020 
00021 #include "itkLightProcessObject.h"
00022 
00023 namespace itk
00024 {
00062 template< class TInputImage,
00063           class TMembershipFunction >
00064 class ITK_EXPORT ImageModelEstimatorBase:public LightProcessObject
00065 {
00066 public:
00068   typedef ImageModelEstimatorBase    Self;
00069   typedef LightProcessObject         Superclass;
00070   typedef SmartPointer< Self >       Pointer;
00071   typedef SmartPointer< const Self > ConstPointer;
00072 
00074   itkTypeMacro(ImageModelEstimatorBase, LightProcessObject);
00075 
00077   itkSetMacro(NumberOfModels, unsigned int);
00078 
00080   itkGetConstReferenceMacro(NumberOfModels, unsigned int);
00081 
00083   typedef typename TMembershipFunction::Pointer MembershipFunctionPointer;
00084 
00085   typedef std::vector< MembershipFunctionPointer >
00086   MembershipFunctionPointerVector;
00087 
00089   typedef          TInputImage          InputImageType;
00090   typedef typename TInputImage::Pointer InputImagePointer;
00091 
00093   //typedef typename TTrainingImage::Pointer TrainingImagePointer;
00094 
00096   itkSetObjectMacro(InputImage, InputImageType);
00097 
00099   itkGetObjectMacro(InputImage, InputImageType);
00100 
00102   void SetMembershipFunctions(MembershipFunctionPointerVector
00103                               membershipFunctions)
00104   {
00105     m_MembershipFunctions = membershipFunctions;
00106   }
00107 
00109   const MembershipFunctionPointerVector GetMembershipFunctions() const
00110   {
00111     return m_MembershipFunctions;
00112   }
00113 
00115   unsigned int GetNumberOfMembershipFunctions()
00116   {
00117     return static_cast< unsigned int >( m_MembershipFunctions.size() );
00118   }
00119 
00121   void DeleteAllMembershipFunctions()
00122   {
00123     m_MembershipFunctions.resize(0);
00124   }
00125 
00127   unsigned int AddMembershipFunction(MembershipFunctionPointer function);
00128 
00131   void Update();
00132 
00133 protected:
00134   ImageModelEstimatorBase();
00135   ~ImageModelEstimatorBase();
00136   void PrintSelf(std::ostream & os, Indent indent) const;
00137 
00138   virtual void GenerateData();
00139 
00140 private:
00141 
00142   ImageModelEstimatorBase(const Self &); //purposely not implemented
00143   void operator=(const Self &);          //purposely not implemented
00144 
00145   unsigned int m_NumberOfModels;
00146 
00148   MembershipFunctionPointerVector m_MembershipFunctions;
00149 
00151   InputImagePointer m_InputImage;
00152 
00154   virtual void EstimateModels() = 0;
00155 }; // class ImageModelEstimator
00156 } // namespace itk
00157 
00158 #ifndef ITK_MANUAL_INSTANTIATION
00159 #include "itkImageModelEstimatorBase.hxx"
00160 #endif
00161 
00162 #endif
00163