ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkImageClassifierBase.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 itkImageClassifierBase_h
19 #define itkImageClassifierBase_h
20 
21 #include "itkClassifierBase.h"
22 #include "itkMacro.h"
23 #include "itkImageRegionIterator.h"
24 
25 namespace itk
26 {
69 template< typename TInputImage,
70  typename TClassifiedImage >
71 class ITK_TEMPLATE_EXPORT ImageClassifierBase:
72  public ClassifierBase< TInputImage >
73 {
74 public:
80 
82  itkNewMacro(Self);
83 
86 
88  typedef TInputImage InputImageType;
89  typedef typename TInputImage::Pointer InputImagePointer;
90  typedef typename TInputImage::ConstPointer InputImageConstPointer;
91 
93  typedef typename TClassifiedImage::Pointer ClassifiedImagePointer;
94 
98  typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
99 
101  typedef typename Superclass::MembershipFunctionType MembershipFunctionType;
102 
103  typedef typename Superclass::MembershipFunctionPointer
105 
106  typedef typename Superclass::MembershipFunctionPointerVector
108 
110  typedef typename Superclass::DecisionRuleType DecisionRuleType;
111 
113  itkSetConstObjectMacro(InputImage, InputImageType);
114  itkGetConstObjectMacro(InputImage, InputImageType);
116 
118  itkSetMacro(ClassifiedImage, ClassifiedImagePointer);
119 
121  itkGetConstMacro(ClassifiedImage, ClassifiedImagePointer);
122 
125  typedef typename TInputImage::PixelType InputImagePixelType;
126 
129  typedef typename TClassifiedImage::PixelType ClassifiedImagePixelType;
130 
132  typedef
134  typedef
136 
138  std::vector< double >
139  GetPixelMembershipValue(const InputImagePixelType inputImagePixel);
140 
141 protected:
143  ~ImageClassifierBase() ITK_OVERRIDE;
144  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
145 
147  void Allocate();
148 
150  void GenerateData() ITK_OVERRIDE;
151 
152 private:
153  ITK_DISALLOW_COPY_AND_ASSIGN(ImageClassifierBase);
154 
155  typedef typename TInputImage::SizeType InputImageSizeType;
156 
158  ClassifiedImagePointer m_ClassifiedImage;
159 
161  virtual void Classify();
162 }; // class ImageClassifierBase
163 } // namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 #include "itkImageClassifierBase.hxx"
167 #endif
168 
169 #endif
SmartPointer< Self > Pointer
Light weight base class for most itk classes.
TClassifiedImage::Pointer ClassifiedImagePointer
Superclass::MeasurementVectorType MeasurementVectorType
Superclass::MembershipFunctionPointer MembershipFunctionPointer
Base class for the ImageClassifierBase object.
Base class for classifier objects.
SmartPointer< const Self > ConstPointer
TInputImage::SizeType InputImageSizeType
A multi-dimensional iterator templated over image type that walks a region of pixels.
Superclass::DecisionRuleType DecisionRuleType
ImageRegionConstIterator< TInputImage > InputImageConstIterator
TInputImage::PixelType InputImagePixelType
Superclass::MembershipFunctionPointerVector MembershipFunctionPointerVector
TInputImage::ConstPointer InputImageConstPointer
ClassifierBase< TInputImage > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::MembershipFunctionType MembershipFunctionType
ImageRegionIterator< TClassifiedImage > ClassifiedImageIterator
TInputImage::Pointer InputImagePointer
A multi-dimensional iterator templated over image type that walks a region of pixels.
TClassifiedImage::PixelType ClassifiedImagePixelType