ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImageClassifierFilter.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 itkImageClassifierFilter_h
19#define itkImageClassifierFilter_h
20
21#include <vector>
22
24#include "itkDecisionRule.h"
27
28namespace itk
29{
30namespace Statistics
31{
47
48template <typename TSample, typename TInputImage, typename TOutputImage>
49class ITK_TEMPLATE_EXPORT ImageClassifierFilter : public ImageToImageFilter<TInputImage, TOutputImage>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(ImageClassifierFilter);
53
59
61 itkOverrideGetNameOfClassMacro(ImageClassifierFilter);
62 itkNewMacro(Self);
64
66 using InputImageType = TInputImage;
67 using OutputImageType = TOutputImage;
68 using InputPixelType = typename TInputImage::PixelType;
69 using OutputPixelType = typename TOutputImage::PixelType;
70
72 using InputImagePointer = typename TInputImage::Pointer;
73 using OutputImagePointer = typename TOutputImage::Pointer;
74
75 using InputSizeType = typename TInputImage::SizeType;
76 using InputIndexType = typename TInputImage::IndexType;
77 using InputImageRegionType = typename TInputImage::RegionType;
78 using OutputSizeType = typename TOutputImage::SizeType;
79 using OutputIndexType = typename TOutputImage::IndexType;
80 using OutputImageRegionType = typename TOutputImage::RegionType;
81
83 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
84 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
85
87 using SampleType = TSample;
88
90 using MeasurementType = typename SampleType::MeasurementType;
91 using MeasurementVectorType = typename SampleType::MeasurementVectorType;
92
96 using MembershipFunctionVectorType = std::vector<MembershipFunctionPointer>;
99
102
105
108 using ClassLabelVectorType = std::vector<ClassLabelType>;
111
115
117 void
118 SetImage(const InputImageType * image);
119
120 const InputImageType *
121 GetImage() const;
122
126 itkSetMacro(NumberOfClasses, unsigned int);
127 itkGetConstMacro(NumberOfClasses, unsigned int);
129
131 itkSetConstObjectMacro(DecisionRule, DecisionRuleType);
132 itkGetConstObjectMacro(DecisionRule, DecisionRuleType);
134
138 void
140
144 void
146
148 void
150
151protected:
153 ~ImageClassifierFilter() override = default;
154 void
155 PrintSelf(std::ostream & os, Indent indent) const override;
156
158 void
159 GenerateData() override;
160
161private:
162 unsigned int m_NumberOfClasses{};
163
166}; // end of class
167} // end of namespace Statistics
168} // end of namespace itk
169
170#ifndef ITK_MANUAL_INSTANTIATION
171# include "itkImageClassifierFilter.hxx"
172#endif
173
174#endif
Array class with size defined at construction time.
Definition itkArray.h:48
Control indentation during Print() invocation.
Definition itkIndent.h:50
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
Base class for decision rules that return a class label based on a set of discriminant scores.
SmartPointer< const Self > ConstPointer
typename MembershipFunctionVectorObjectType::Pointer MembershipFunctionVectorObjectPointer
typename TOutputImage::IndexType OutputIndexType
const InputImageType * GetImage() const
void SetClassLabels(const ClassLabelVectorObjectType *classLabels)
void SetMembershipFunctions(const MembershipFunctionVectorObjectType *membershipFunctions)
void SetImage(const InputImageType *image)
typename TInputImage::RegionType InputImageRegionType
typename MembershipFunctionsWeightsArrayObjectType::Pointer MembershipFunctionsWeightsArrayPointer
std::vector< ClassLabelType > ClassLabelVectorType
typename TInputImage::Pointer InputImagePointer
std::vector< MembershipFunctionPointer > MembershipFunctionVectorType
MembershipFunctionBase< MeasurementVectorType > MembershipFunctionType
typename TOutputImage::PixelType OutputPixelType
typename SampleType::MeasurementType MeasurementType
DecisionRuleType::ConstPointer DecisionRulePointer
SimpleDataObjectDecorator< ClassLabelVectorType > ClassLabelVectorObjectType
typename TOutputImage::SizeType OutputSizeType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
SimpleDataObjectDecorator< MembershipFunctionsWeightsArrayType > MembershipFunctionsWeightsArrayObjectType
typename TInputImage::SizeType InputSizeType
ClassLabelVectorObjectType::Pointer ClassLabelVectorObjectPointer
static constexpr unsigned int OutputImageDimension
typename MembershipFunctionType::ConstPointer MembershipFunctionPointer
static constexpr unsigned int InputImageDimension
typename SampleType::MeasurementVectorType MeasurementVectorType
typename TInputImage::PixelType InputPixelType
typename TOutputImage::RegionType OutputImageRegionType
SimpleDataObjectDecorator< MembershipFunctionVectorType > MembershipFunctionVectorObjectType
void PrintSelf(std::ostream &os, Indent indent) const override
void SetMembershipFunctionsWeightsArray(const MembershipFunctionsWeightsArrayObjectType *weightsArray)
typename TOutputImage::Pointer OutputImagePointer
typename TInputImage::IndexType InputIndexType
MembershipFunctionBase defines common interfaces for membership functions.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition itkIntTypes.h:90