ITK  5.4.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  * https://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 
76  itkOverrideGetNameOfClassMacro(ImageModelEstimatorBase);
77 
79  itkSetMacro(NumberOfModels, unsigned int);
80 
82  itkGetConstReferenceMacro(NumberOfModels, unsigned int);
83 
86 
87  using MembershipFunctionPointerVector = std::vector<MembershipFunctionPointer>;
88 
90  using InputImageType = TInputImage;
92 
94  // using TrainingImagePointer = typename TTrainingImage::Pointer;
95 
97  itkSetObjectMacro(InputImage, InputImageType);
98  itkGetModifiableObjectMacro(InputImage, InputImageType);
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 
133  unsigned int
134  AddMembershipFunction(MembershipFunctionPointer function);
135 
138  void
139  Update();
140 
141 protected:
143  ~ImageModelEstimatorBase() override = default;
144  void
145  PrintSelf(std::ostream & os, Indent indent) const override;
146 
147  void
148  GenerateData() override;
149 
150 private:
151  unsigned int m_NumberOfModels{ 0 };
152 
154  MembershipFunctionPointerVector m_MembershipFunctions{};
155 
157  InputImagePointer m_InputImage{};
158 
160  virtual void
161  EstimateModels() = 0;
162 }; // class ImageModelEstimator
163 } // namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 # include "itkImageModelEstimatorBase.hxx"
167 #endif
168 
169 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
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:55
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:61