ITK  4.6.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< typename TInputImage,
63  typename 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 
102  membershipFunctions)
103  {
104  m_MembershipFunctions = membershipFunctions;
105  }
106 
109  {
110  return m_MembershipFunctions;
111  }
112 
115  {
116  return static_cast< unsigned int >( m_MembershipFunctions.size() );
117  }
118 
121  {
122  m_MembershipFunctions.resize(0);
123  }
124 
126  unsigned int AddMembershipFunction(MembershipFunctionPointer function);
127 
130  void Update();
131 
132 protected:
135  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
136 
137  virtual void GenerateData() ITK_OVERRIDE;
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
TMembershipFunction::Pointer MembershipFunctionPointer
const MembershipFunctionPointerVector GetMembershipFunctions() const
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
SmartPointer< const Self > ConstPointer
Base class for model estimation from images used for classification.
virtual void EstimateModels()=0
void SetMembershipFunctions(MembershipFunctionPointerVector membershipFunctions)
std::vector< MembershipFunctionPointer > MembershipFunctionPointerVector
virtual void GenerateData() ITK_OVERRIDE
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
unsigned int AddMembershipFunction(MembershipFunctionPointer function)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
MembershipFunctionPointerVector m_MembershipFunctions