ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkImageModelEstimatorBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkImageModelEstimatorBase_h
19 #define __itkImageModelEstimatorBase_h
20 
21 #include "itkLightProcessObject.h"
22 
23 namespace itk
24 {
62 template< class TInputImage,
63  class TMembershipFunction >
65 {
66 public:
72 
75 
77  itkSetMacro(NumberOfModels, unsigned int);
78 
80  itkGetConstReferenceMacro(NumberOfModels, unsigned int);
81 
83  typedef typename TMembershipFunction::Pointer MembershipFunctionPointer;
84 
85  typedef std::vector< MembershipFunctionPointer >
87 
89  typedef TInputImage InputImageType;
90  typedef typename TInputImage::Pointer InputImagePointer;
91 
93  //typedef typename TTrainingImage::Pointer TrainingImagePointer;
94 
96  itkSetObjectMacro(InputImage, InputImageType);
97 
99  itkGetObjectMacro(InputImage, InputImageType);
100 
102  void SetMembershipFunctions(MembershipFunctionPointerVector
103  membershipFunctions)
104  {
105  m_MembershipFunctions = membershipFunctions;
106  }
107 
109  const MembershipFunctionPointerVector GetMembershipFunctions() const
110  {
111  return m_MembershipFunctions;
112  }
113 
115  unsigned int GetNumberOfMembershipFunctions()
116  {
117  return static_cast< unsigned int >( m_MembershipFunctions.size() );
118  }
119 
121  void DeleteAllMembershipFunctions()
122  {
123  m_MembershipFunctions.resize(0);
124  }
125 
127  unsigned int AddMembershipFunction(MembershipFunctionPointer function);
128 
131  void Update();
132 
133 protected:
136  void PrintSelf(std::ostream & os, Indent indent) const;
137 
138  virtual void GenerateData();
139 
140 private:
141 
142  ImageModelEstimatorBase(const Self &); //purposely not implemented
143  void operator=(const Self &); //purposely not implemented
144 
145  unsigned int m_NumberOfModels;
146 
149 
152 
154  virtual void EstimateModels() = 0;
155 }; // class ImageModelEstimator
156 } // namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkImageModelEstimatorBase.hxx"
160 #endif
161 
162 #endif
163