ITK  5.0.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:
67  ITK_DISALLOW_COPY_AND_ASSIGN(ImageModelEstimatorBase);
68 
74 
77 
79  itkSetMacro(NumberOfModels, unsigned int);
80 
82  itkGetConstReferenceMacro(NumberOfModels, unsigned int);
83 
85  using MembershipFunctionPointer = typename TMembershipFunction::Pointer;
86 
87  using MembershipFunctionPointerVector = std::vector<MembershipFunctionPointer>;
88 
90  using InputImageType = TInputImage;
91  using InputImagePointer = typename TInputImage::Pointer;
92 
94  //using TrainingImagePointer = typename TTrainingImage::Pointer;
95 
97  itkSetObjectMacro(InputImage, InputImageType);
98  itkGetModifiableObjectMacro(InputImage, InputImageType);
100 
103  membershipFunctions)
104  {
105  m_MembershipFunctions = membershipFunctions;
106  }
107 
110  {
111  return m_MembershipFunctions;
112  }
113 
116  {
117  return static_cast< unsigned int >( m_MembershipFunctions.size() );
118  }
119 
122  {
123  m_MembershipFunctions.resize(0);
124  }
125 
127  unsigned int AddMembershipFunction(MembershipFunctionPointer function);
128 
131  void Update();
132 
133 protected:
135  ~ImageModelEstimatorBase() override = default;
136  void PrintSelf(std::ostream & os, Indent indent) const override;
137 
138  void GenerateData() override;
139 
140 private:
141 
142  unsigned int m_NumberOfModels{0};
143 
146 
149 
151  virtual void EstimateModels() = 0;
152 }; // class ImageModelEstimator
153 } // namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkImageModelEstimatorBase.hxx"
157 #endif
158 
159 #endif
Light weight base class for most itk classes.
const MembershipFunctionPointerVector GetMembershipFunctions() const
std::vector< MembershipFunctionPointer > MembershipFunctionPointerVector
Base class for model estimation from images used for classification.
void SetMembershipFunctions(MembershipFunctionPointerVector membershipFunctions)
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
MembershipFunctionPointerVector m_MembershipFunctions
typename TInputImage::Pointer InputImagePointer
typename TMembershipFunction::Pointer MembershipFunctionPointer
Base class for most ITK classes.
Definition: itkObject.h:60