ITK  4.2.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);
173 protected:
176  void PrintSelf(std::ostream & os, Indent indent) const;
178 
179  virtual void FillHistogram(RadiusType radius, RegionType region);
180 
181  virtual void FillHistogramWithMask(RadiusType radius, RegionType region, const ImageType *maskImage);
182 
185 
187  using Superclass::MakeOutput;
188  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
189 
191  virtual void GenerateData();
192 
193 private:
194  ScalarImageToCooccurrenceMatrixFilter(const Self &); //purposely not
195  // implemented
196  void operator=(const Self &); //purposely not
197 
198  // implemented
199 
200  void NormalizeHistogram(void);
201 
205 
206  unsigned int m_NumberOfBinsPerAxis;
210 
212 };
213 } // end of namespace Statistics
214 } // end of namespace itk
215 
216 #ifndef ITK_MANUAL_INSTANTIATION
217 #include "itkScalarImageToCooccurrenceMatrixFilter.hxx"
218 #endif
219 
220 #endif
221