ITK  4.6.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< typename TImageType,
93  typename 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);
134 
135  void SetOffset(const OffsetType offset);
136 
138  itkSetMacro(NumberOfBinsPerAxis, unsigned int);
139  itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
141 
144  void SetPixelValueMinMax(PixelType min, PixelType max);
145 
146  itkGetConstMacro(Min, PixelType);
147  itkGetConstMacro(Max, PixelType);
148 
151  itkSetMacro(Normalize, bool);
152  itkGetConstMacro(Normalize, bool);
153  itkBooleanMacro(Normalize);
155 
157  using Superclass::SetInput;
158  void SetInput(const ImageType *image);
159 
160  const ImageType * GetInput() const;
161 
163  void SetMaskImage(const ImageType *image);
164 
165  const ImageType * GetMaskImage() const;
166 
168  const HistogramType * GetOutput() const;
169 
172  itkSetMacro(InsidePixelValue, PixelType);
173  itkGetConstMacro(InsidePixelValue, PixelType);
175 
176 protected:
179  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
180 
181  virtual void FillHistogram(RadiusType radius, RegionType region);
182 
183  virtual void FillHistogramWithMask(RadiusType radius, RegionType region, const ImageType *maskImage);
184 
187 
191 
193  virtual void GenerateData() ITK_OVERRIDE;
194 
195 private:
196  ScalarImageToCooccurrenceMatrixFilter(const Self &); //purposely not
197  // implemented
198  void operator=(const Self &); //purposely not
199 
200  // implemented
201 
202  void NormalizeHistogram(void);
203 
207 
208  unsigned int m_NumberOfBinsPerAxis;
212 
214 };
215 } // end of namespace Statistics
216 } // end of namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkScalarImageToCooccurrenceMatrixFilter.hxx"
220 #endif
221 
222 #endif
This class computes a co-occurence matrix (histogram) from a given image and a mask image if provided...
Light weight base class for most itk classes.
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
virtual void FillHistogramWithMask(RadiusType radius, RegionType region, const ImageType *maskImage)
virtual void FillHistogram(RadiusType radius, RegionType region)
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Superclass::MeasurementVectorType MeasurementVectorType
Definition: itkHistogram.h:101
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE
void SetPixelValueMinMax(PixelType min, PixelType max)