ITK  6.0.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
22
23namespace itk
24{
63template <typename TInputImage, typename TMembershipFunction>
64class ITK_TEMPLATE_EXPORT ImageModelEstimatorBase : public LightProcessObject
65{
66public:
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
135
138 void
140
141protected:
143 ~ImageModelEstimatorBase() override = default;
144 void
145 PrintSelf(std::ostream & os, Indent indent) const override;
146
147 void
148 GenerateData() override;
149
150private:
151 unsigned int m_NumberOfModels{ 0 };
152
154 MembershipFunctionPointerVector m_MembershipFunctions{};
155
157 InputImagePointer m_InputImage{};
158
160 virtual void
162}; // class ImageModelEstimator
163} // namespace itk
164
165#ifndef ITK_MANUAL_INSTANTIATION
166# include "itkImageModelEstimatorBase.hxx"
167#endif
168
169#endif
Base class for model estimation from images used for classification.
virtual void EstimateModels()=0
void PrintSelf(std::ostream &os, Indent indent) const override
typename TMembershipFunction::Pointer MembershipFunctionPointer
unsigned int AddMembershipFunction(MembershipFunctionPointer function)
void GenerateData() override
const MembershipFunctionPointerVector GetMembershipFunctions() const
std::vector< MembershipFunctionPointer > MembershipFunctionPointerVector
void SetMembershipFunctions(MembershipFunctionPointerVector membershipFunctions)
typename TInputImage::Pointer InputImagePointer
~ImageModelEstimatorBase() override=default
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Base class for most ITK classes.
Definition: itkObject.h:62
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....