ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBayesianClassifierInitializationImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 {
75 template< typename TInputImage, typename TProbabilityPrecisionType = float >
77  public
78  ImageToImageFilter< TInputImage, VectorImage< TProbabilityPrecisionType,
79  TInputImage::ImageDimension > >
80 {
81 public:
82  ITK_DISALLOW_COPY_AND_ASSIGN(BayesianClassifierInitializationImageFilter);
83 
86  using InputImageType = TInputImage;
87  using ProbabilityPrecisionType = TProbabilityPrecisionType;
88 
90  static constexpr unsigned int Dimension = InputImageType ::ImageDimension;
91 
97 
99  itkNewMacro(Self);
100 
103 
106 
108  using InputPixelType = typename InputImageType::PixelType;
110 
119 
122 
126 
128  using MembershipFunctionContainerType = VectorContainer< unsigned int,
131 
137  virtual void SetMembershipFunctions(MembershipFunctionContainerType
138  *densityFunctionContainer);
139  itkGetModifiableObjectMacro(MembershipFunctionContainer, MembershipFunctionContainerType);
141 
143  itkSetMacro(NumberOfClasses, unsigned int);
144  itkGetConstMacro(NumberOfClasses, unsigned int);
146 
147  void GenerateOutputInformation() override;
148 
149 #ifdef ITK_USE_CONCEPT_CHECKING
150  // Begin concept checking
151  itkConceptMacro( InputMultiplyOperatorCheck,
153  itkConceptMacro( DoubleConvertibleToProbabilityCheck,
155  itkConceptMacro( InputHasNumericTraitsCheck,
157  itkConceptMacro( ProbabilityHasNumericTraitsCheck,
159  itkConceptMacro( DoublePlusInputCheck,
161  // End concept checking
162 #endif
163 
164 protected:
166  ~BayesianClassifierInitializationImageFilter() override = default;
167  void PrintSelf(std::ostream & os, Indent indent) const override;
168 
174  virtual void InitializeMembershipFunctions();
175 
178  void GenerateData() override;
179 
180 private:
181  bool m_UserSuppliesMembershipFunctions{false};
182  unsigned int m_NumberOfClasses{0};
183 
185 };
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkBayesianClassifierInitializationImageFilter.hxx"
190 #endif
191 
192 #endif
Light weight base class for most itk classes.
This filter is intended to be used as a helper class to initialize the BayesianClassifierImageFilter...
Templated n-dimensional vector image class.
typename MembershipFunctionContainerType::Pointer MembershipFunctionContainerPointer
Represents an array whose length can be defined at run-time.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
A multi-dimensional iterator templated over image type that walks a region of pixels.
MembershipFunctionBase defines common interfaces for membership functions.
Base class for filters that take an image as input and produce an image as output.
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
A multi-dimensional iterator templated over image type that walks a region of pixels.