ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkScalarImageToCooccurrenceMatrixFilter.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 __itkScalarImageToCooccurrenceMatrixFilter_h
19 #define __itkScalarImageToCooccurrenceMatrixFilter_h
20 
21 #include "itkImage.h"
22 #include "itkHistogram.h"
23 #include "itkVectorContainer.h"
24 #include "itkNumericTraits.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
92 template< class TImageType,
93  class THistogramFrequencyContainer = DenseFrequencyContainer2 >
95 {
96 public:
102 
105 
107  itkNewMacro(Self);
108 
109  typedef TImageType ImageType;
110  typedef typename ImageType::Pointer ImagePointer;
111  typedef typename ImageType::ConstPointer ImageConstPointer;
112  typedef typename ImageType::PixelType PixelType;
113  typedef typename ImageType::RegionType RegionType;
114  typedef typename ImageType::SizeType RadiusType;
115  typedef typename ImageType::OffsetType OffsetType;
119 
121 
126 
127  itkStaticConstMacro(DefaultBinsPerAxis, unsigned int, 256);
128 
131  itkSetConstObjectMacro(Offsets, OffsetVector);
132  itkGetConstObjectMacro(Offsets, OffsetVector);
133  void SetOffset(const OffsetType offset);
135 
137  itkSetMacro(NumberOfBinsPerAxis, unsigned int);
138  itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
140 
143  void SetPixelValueMinMax(PixelType min, PixelType max);
144 
145  itkGetConstMacro(Min, PixelType);
146  itkGetConstMacro(Max, PixelType);
147 
150  itkSetMacro(Normalize, bool);
151  itkGetConstMacro(Normalize, bool);
152  itkBooleanMacro(Normalize);
154 
156  using Superclass::SetInput;
157  void SetInput(const ImageType *image);
158 
159  const ImageType * GetInput() const;
160 
162  void SetMaskImage(const ImageType *image);
163 
164  const ImageType * GetMaskImage() const;
165 
167  const HistogramType * GetOutput() const;
168 
171  itkSetMacro(InsidePixelValue, PixelType);
172  itkGetConstMacro(InsidePixelValue, PixelType);
174 
175 protected:
178  void PrintSelf(std::ostream & os, Indent indent) const;
179 
180  virtual void FillHistogram(RadiusType radius, RegionType region);
181 
182  virtual void FillHistogramWithMask(RadiusType radius, RegionType region, const ImageType *maskImage);
183 
186 
188  using Superclass::MakeOutput;
189  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
190 
192  virtual void GenerateData();
193 
194 private:
195  ScalarImageToCooccurrenceMatrixFilter(const Self &); //purposely not
196  // implemented
197  void operator=(const Self &); //purposely not
198 
199  // implemented
200 
201  void NormalizeHistogram(void);
202 
206 
207  unsigned int m_NumberOfBinsPerAxis;
211 
213 };
214 } // end of namespace Statistics
215 } // end of namespace itk
216 
217 #ifndef ITK_MANUAL_INSTANTIATION
218 #include "itkScalarImageToCooccurrenceMatrixFilter.hxx"
219 #endif
220 
221 #endif
222