ITK  6.0.0
Insight Toolkit
itkBayesianClassifierInitializationImageFilter.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 itkBayesianClassifierInitializationImageFilter_h
19 #define itkBayesianClassifierInitializationImageFilter_h
20 
21 #include "itkVectorImage.h"
22 #include "itkVectorContainer.h"
23 #include "itkImageToImageFilter.h"
24 #include "itkImageRegionIterator.h"
26 
27 namespace itk
28 {
76 template <typename TInputImage, typename TProbabilityPrecisionType = float>
78  : public ImageToImageFilter<TInputImage, VectorImage<TProbabilityPrecisionType, TInputImage::ImageDimension>>
79 {
80 public:
81  ITK_DISALLOW_COPY_AND_MOVE(BayesianClassifierInitializationImageFilter);
82 
85  using InputImageType = TInputImage;
86  using ProbabilityPrecisionType = TProbabilityPrecisionType;
87 
89  static constexpr unsigned int Dimension = InputImageType::ImageDimension;
90 
95 
97  itkNewMacro(Self);
98 
100  itkOverrideGetNameOfClassMacro(BayesianClassifierInitializationImageFilter);
101 
104 
106  using InputPixelType = typename InputImageType::PixelType;
108 
116 
119 
123 
127 
133  virtual void
134  SetMembershipFunctions(MembershipFunctionContainerType * membershipFunction);
135  itkGetModifiableObjectMacro(MembershipFunctionContainer, MembershipFunctionContainerType);
139  itkSetMacro(NumberOfClasses, unsigned int);
140  itkGetConstMacro(NumberOfClasses, unsigned int);
143  void
144  GenerateOutputInformation() override;
145 
146 #ifdef ITK_USE_CONCEPT_CHECKING
147  // Begin concept checking
148  itkConceptMacro(InputMultiplyOperatorCheck, (Concept::MultiplyOperator<InputPixelType>));
149  itkConceptMacro(DoubleConvertibleToProbabilityCheck, (Concept::Convertible<double, TProbabilityPrecisionType>));
150  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
151  itkConceptMacro(ProbabilityHasNumericTraitsCheck, (Concept::HasNumericTraits<TProbabilityPrecisionType>));
153  // End concept checking
154 #endif
155 
156 protected:
158  ~BayesianClassifierInitializationImageFilter() override = default;
159  void
160  PrintSelf(std::ostream & os, Indent indent) const override;
161 
167  virtual void
168  InitializeMembershipFunctions();
169 
172  void
173  GenerateData() override;
174 
175 private:
176  bool m_UserSuppliesMembershipFunctions{ false };
177  unsigned int m_NumberOfClasses{ 0 };
178 
179  typename MembershipFunctionContainerType::Pointer m_MembershipFunctionContainer{};
180 };
181 } // end namespace itk
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 # include "itkBayesianClassifierInitializationImageFilter.hxx"
185 #endif
186 
187 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::detail::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:51
itk::BayesianClassifierInitializationImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkBayesianClassifierInitializationImageFilter.h:106
itk::VectorImage
Templated n-dimensional vector image class.
Definition: itkImageAlgorithm.h:29
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::Statistics::MembershipFunctionBase
MembershipFunctionBase defines common interfaces for membership functions.
Definition: itkMembershipFunctionBase.h:58
itk::SmartPointer< Self >
itkImageRegionIterator.h
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BayesianClassifierInitializationImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkBayesianClassifierInitializationImageFilter.h:107
itk::BayesianClassifierInitializationImageFilter::MembershipImagePointer
typename MembershipImageType::Pointer MembershipImagePointer
Definition: itkBayesianClassifierInitializationImageFilter.h:114
itkVectorImage.h
itk::ImageRegionIterator
A multi-dimensional iterator templated over image type that walks a region of pixels.
Definition: itkImageRegionIterator.h:80
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::BayesianClassifierInitializationImageFilter::InputImageType
TInputImage InputImageType
Definition: itkBayesianClassifierInitializationImageFilter.h:85
itkImageToImageFilter.h
itk::BayesianClassifierInitializationImageFilter::ProbabilityPrecisionType
TProbabilityPrecisionType ProbabilityPrecisionType
Definition: itkBayesianClassifierInitializationImageFilter.h:86
itk::VariableLengthVector
Represents an array whose length can be defined at run-time.
Definition: itkConstantBoundaryCondition.h:28
itkMembershipFunctionBase.h
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:421
itk::BayesianClassifierInitializationImageFilter
This filter is intended to be used as a helper class to initialize the BayesianClassifierImageFilter.
Definition: itkBayesianClassifierInitializationImageFilter.h:77
itkVectorContainer.h
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:360
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::ImageRegionConstIterator
A multi-dimensional iterator templated over image type that walks a region of pixels.
Definition: itkImageRegionConstIterator.h:109
itk::BayesianClassifierInitializationImageFilter::MembershipFunctionPointer
typename MembershipFunctionType::Pointer MembershipFunctionPointer
Definition: itkBayesianClassifierInitializationImageFilter.h:122
itk::BayesianClassifierInitializationImageFilter::MembershipFunctionContainerPointer
typename MembershipFunctionContainerType::Pointer MembershipFunctionContainerPointer
Definition: itkBayesianClassifierInitializationImageFilter.h:126
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::BayesianClassifierInitializationImageFilter::MembershipPixelType
typename MembershipImageType::PixelType MembershipPixelType
Definition: itkBayesianClassifierInitializationImageFilter.h:113