ITK  4.4.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< class TInputImage,
70  class TClassifiedImage >
71 class ITK_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:
144  void PrintSelf(std::ostream & os, Indent indent) const;
145 
147  void Allocate();
148 
150  void GenerateData();
151 
152 private:
153  ImageClassifierBase(const Self &); //purposely not implemented
154  void operator=(const Self &); //purposely not implemented
155 
156  typedef typename TInputImage::SizeType InputImageSizeType;
157 
160 
162  virtual void Classify();
163 }; // class ImageClassifierBase
164 } // namespace itk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "itkImageClassifierBase.hxx"
168 #endif
169 
170 #endif
171