ITK  5.2.0
Insight Toolkit
itkImageModelEstimatorBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
63 template <typename TInputImage, typename TMembershipFunction>
64 class ITK_TEMPLATE_EXPORT ImageModelEstimatorBase : public LightProcessObject
65 {
66 public:
67  ITK_DISALLOW_COPY_AND_MOVE(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 
102  void
104  {
105  m_MembershipFunctions = membershipFunctions;
106  }
107 
109  const MembershipFunctionPointerVector
111  {
112  return m_MembershipFunctions;
113  }
114 
116  unsigned int
118  {
119  return static_cast<unsigned int>(m_MembershipFunctions.size());
120  }
121 
123  void
125  {
126  m_MembershipFunctions.resize(0);
127  }
128 
130  unsigned int
131  AddMembershipFunction(MembershipFunctionPointer function);
132 
135  void
136  Update();
137 
138 protected:
140  ~ImageModelEstimatorBase() override = default;
141  void
142  PrintSelf(std::ostream & os, Indent indent) const override;
143 
144  void
145  GenerateData() override;
146 
147 private:
148  unsigned int m_NumberOfModels{ 0 };
149 
152 
155 
157  virtual void
158  EstimateModels() = 0;
159 }; // class ImageModelEstimator
160 } // namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 # include "itkImageModelEstimatorBase.hxx"
164 #endif
165 
166 #endif
itk::LightProcessObject
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Definition: itkLightProcessObject.h:72
itk::ImageModelEstimatorBase::MembershipFunctionPointerVector
std::vector< MembershipFunctionPointer > MembershipFunctionPointerVector
Definition: itkImageModelEstimatorBase.h:87
itk::ImageModelEstimatorBase::GetNumberOfMembershipFunctions
unsigned int GetNumberOfMembershipFunctions()
Definition: itkImageModelEstimatorBase.h:117
itkLightProcessObject.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageModelEstimatorBase::DeleteAllMembershipFunctions
void DeleteAllMembershipFunctions()
Definition: itkImageModelEstimatorBase.h:124
itk::ImageModelEstimatorBase::InputImageType
TInputImage InputImageType
Definition: itkImageModelEstimatorBase.h:90
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ImageModelEstimatorBase
Base class for model estimation from images used for classification.
Definition: itkImageModelEstimatorBase.h:64
itk::ImageModelEstimatorBase::GetMembershipFunctions
const MembershipFunctionPointerVector GetMembershipFunctions() const
Definition: itkImageModelEstimatorBase.h:110
itk::ImageModelEstimatorBase::InputImagePointer
typename TInputImage::Pointer InputImagePointer
Definition: itkImageModelEstimatorBase.h:91
itk::ImageModelEstimatorBase::MembershipFunctionPointer
typename TMembershipFunction::Pointer MembershipFunctionPointer
Definition: itkImageModelEstimatorBase.h:85
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageModelEstimatorBase::SetMembershipFunctions
void SetMembershipFunctions(MembershipFunctionPointerVector membershipFunctions)
Definition: itkImageModelEstimatorBase.h:103
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::ImageModelEstimatorBase::m_MembershipFunctions
MembershipFunctionPointerVector m_MembershipFunctions
Definition: itkImageModelEstimatorBase.h:151
itk::ImageModelEstimatorBase::m_InputImage
InputImagePointer m_InputImage
Definition: itkImageModelEstimatorBase.h:154