ITK  6.0.0
Insight Toolkit
itkBayesianClassifierImageFilter.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 itkBayesianClassifierImageFilter_h
19#define itkBayesianClassifierImageFilter_h
20
21#include "itkVectorImage.h"
25
26namespace itk
27{
80template <typename TInputVectorImage,
81 typename TLabelsType = unsigned char,
82 typename TPosteriorsPrecisionType = double,
83 typename TPriorsPrecisionType = double>
84class ITK_TEMPLATE_EXPORT BayesianClassifierImageFilter
85 : public ImageToImageFilter<TInputVectorImage, Image<TLabelsType, TInputVectorImage::ImageDimension>>
86{
87public:
88 ITK_DISALLOW_COPY_AND_MOVE(BayesianClassifierImageFilter);
89
93
96
98 itkNewMacro(Self);
99
101 itkOverrideGetNameOfClassMacro(BayesianClassifierImageFilter);
102
104 using typename Superclass::InputImageType;
105
107 static constexpr unsigned int Dimension = InputImageType::ImageDimension;
108
113
117
119 using InputPixelType = typename InputImageType::PixelType;
121
130
134 using MembershipImageType = TInputVectorImage;
135 using MembershipPixelType = typename MembershipImageType::PixelType;
138
147
151
152 using typename Superclass::DataObjectPointer;
153
156
159
161
164 void
166 itkGetConstMacro(SmoothingFilter, SmoothingFilterPointer);
170 virtual void
172
174 itkSetMacro(NumberOfSmoothingIterations, unsigned int);
175 itkGetConstMacro(NumberOfSmoothingIterations, unsigned int);
180 using Superclass::MakeOutput;
183
184#ifdef ITK_USE_CONCEPT_CHECKING
185 // Begin concept checking
186 itkConceptMacro(UnsignedIntConvertibleToLabelsCheck, (Concept::Convertible<unsigned int, TLabelsType>));
193 InputPriorsPosteriorsMultiplyOperatorCheck,
195 // End concept checking
196#endif
197
198protected:
200 ~BayesianClassifierImageFilter() override = default;
201 void
202 PrintSelf(std::ostream & os, Indent indent) const override;
203
204 void
205 GenerateData() override;
206
207 void
209
213 virtual void
215
217 virtual void
219
221 virtual void
223
227
228private:
229 bool m_UserProvidedPriors{ false };
230
231 bool m_UserProvidedSmoothingFilter{ false };
232
233 SmoothingFilterPointer m_SmoothingFilter{};
234
235 unsigned int m_NumberOfSmoothingIterations{ 0 };
236};
237} // end namespace itk
238
239#ifndef ITK_MANUAL_INSTANTIATION
240# include "itkBayesianClassifierImageFilter.hxx"
241#endif
242
243#endif
Performs Bayesian Classification on an image.
~BayesianClassifierImageFilter() override=default
typename PosteriorsImageType::Pointer PosteriorsImagePointer
virtual void NormalizeAndSmoothPosteriors()
typename SmoothingFilterType::Pointer SmoothingFilterPointer
typename OutputImageType::Pointer OutputImagePointer
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
typename PriorsImageType::PixelType PriorsPixelType
typename PriorsImageType::Pointer PriorsImagePointer
typename PosteriorsImageType::PixelType PosteriorsPixelType
typename MembershipImageType::Pointer MembershipImagePointer
PosteriorsImageType * GetPosteriorImage()
typename InputImageType::RegionType ImageRegionType
virtual void SetPriors(const PriorsImageType *)
typename InputImageType::PixelType InputPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
void SetSmoothingFilter(SmoothingFilterType *)
typename MembershipImageType::PixelType MembershipPixelType
void GenerateOutputInformation() override
typename InputImageType::ConstPointer InputImagePointer
typename OutputImageType::PixelType OutputPixelType
A multi-dimensional iterator templated over image type that walks a region of pixels.
A multi-dimensional iterator templated over image type that walks a region of pixels.
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition: itkImage.h:89
TPixel PixelType
Definition: itkImage.h:108
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
A decision rule that returns the class label with the largest discriminant score.
Templated n-dimensional vector image class.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....