ITK  4.4.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  itkGetModifiableObjectMacro(InputImage, InputImageType);
99 
101  void SetMembershipFunctions(MembershipFunctionPointerVector
102  membershipFunctions)
103  {
104  m_MembershipFunctions = membershipFunctions;
105  }
106 
108  const MembershipFunctionPointerVector GetMembershipFunctions() const
109  {
110  return m_MembershipFunctions;
111  }
112 
114  unsigned int GetNumberOfMembershipFunctions()
115  {
116  return static_cast< unsigned int >( m_MembershipFunctions.size() );
117  }
118 
120  void DeleteAllMembershipFunctions()
121  {
122  m_MembershipFunctions.resize(0);
123  }
124 
126  unsigned int AddMembershipFunction(MembershipFunctionPointer function);
127 
130  void Update();
131 
132 protected:
135  void PrintSelf(std::ostream & os, Indent indent) const;
136 
137  virtual void GenerateData();
138 
139 private:
140 
141  ImageModelEstimatorBase(const Self &); //purposely not implemented
142  void operator=(const Self &); //purposely not implemented
143 
144  unsigned int m_NumberOfModels;
145 
148 
151 
153  virtual void EstimateModels() = 0;
154 }; // class ImageModelEstimator
155 } // namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkImageModelEstimatorBase.hxx"
159 #endif
160 
161 #endif
162