ITK  4.13.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 >
64 class ITK_TEMPLATE_EXPORT ImageModelEstimatorBase:public LightProcessObject
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:
134  ~ImageModelEstimatorBase() ITK_OVERRIDE;
135  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
136 
137  virtual void GenerateData() ITK_OVERRIDE;
138 
139 private:
140 
141  ITK_DISALLOW_COPY_AND_ASSIGN(ImageModelEstimatorBase);
142 
143  unsigned int m_NumberOfModels;
144 
146  MembershipFunctionPointerVector m_MembershipFunctions;
147 
149  InputImagePointer m_InputImage;
150 
152  virtual void EstimateModels() = 0;
153 }; // class ImageModelEstimator
154 } // namespace itk
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 #include "itkImageModelEstimatorBase.hxx"
158 #endif
159 
160 #endif
TMembershipFunction::Pointer MembershipFunctionPointer
const MembershipFunctionPointerVector GetMembershipFunctions() const
SmartPointer< const Self > ConstPointer
Base class for model estimation from images used for classification.
void SetMembershipFunctions(MembershipFunctionPointerVector membershipFunctions)
std::vector< MembershipFunctionPointer > MembershipFunctionPointerVector
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Control indentation during Print() invocation.
Definition: itkIndent.h:49