ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkScalarImageToCooccurrenceMatrixFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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#include "itkProcessObject.h"
26
27namespace itk::Statistics
28{
87
88template <typename TImageType,
89 typename THistogramFrequencyContainer = DenseFrequencyContainer2,
90 typename TMaskImageType = TImageType>
91class ITK_TEMPLATE_EXPORT ScalarImageToCooccurrenceMatrixFilter : public ProcessObject
92{
93public:
94 ITK_DISALLOW_COPY_AND_MOVE(ScalarImageToCooccurrenceMatrixFilter);
95
101
103 itkOverrideGetNameOfClassMacro(ScalarImageToCooccurrenceMatrixFilter);
104
106 itkNewMacro(Self);
107
108 using ImageType = TImageType;
109 using ImagePointer = typename ImageType::Pointer;
110 using ImageConstPointer = typename ImageType::ConstPointer;
111 using PixelType = typename ImageType::PixelType;
112 using RegionType = typename ImageType::RegionType;
113 using RadiusType = typename ImageType::SizeType;
114 using OffsetType = typename ImageType::OffsetType;
118 using MaskImageType = TMaskImageType;
119 using MaskPointer = typename MaskImageType::Pointer;
120 using MaskConstPointer = typename MaskImageType::ConstPointer;
121 using MaskPixelType = typename MaskImageType::PixelType;
122
124
129
130 static constexpr unsigned int DefaultBinsPerAxis = 256;
131
135 itkSetConstObjectMacro(Offsets, OffsetVector);
136 itkGetConstObjectMacro(Offsets, OffsetVector);
138 void
139 SetOffset(const OffsetType offset);
140
143 itkSetMacro(NumberOfBinsPerAxis, unsigned int);
144 itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
148 void
150
151 itkGetConstMacro(Min, PixelType);
152 itkGetConstMacro(Max, PixelType);
153
157 itkSetMacro(Normalize, bool);
158 itkGetConstMacro(Normalize, bool);
159 itkBooleanMacro(Normalize);
163 void
164 SetInput(const ImageType * image);
165
166 const ImageType *
167 GetInput() const;
168
170 void
172
173 const MaskImageType *
175
177 const HistogramType *
178 GetOutput() const;
179
183 itkSetMacro(InsidePixelValue, MaskPixelType);
184 itkGetConstMacro(InsidePixelValue, MaskPixelType);
186protected:
189 void
190 PrintSelf(std::ostream & os, Indent indent) const override;
191
192 virtual void
194
195 virtual void
196 FillHistogramWithMask(RadiusType radius, RegionType region, const MaskImageType * maskImage);
197
200
205
207 void
208 GenerateData() override;
209
210private:
211 void
213
217
218 unsigned int m_NumberOfBinsPerAxis{};
222
224};
225} // namespace itk::Statistics
226
227#ifndef ITK_MANUAL_INSTANTIATION
228# include "itkScalarImageToCooccurrenceMatrixFilter.hxx"
229#endif
230
231#endif
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
Implements transparent reference counting.
This class is a container for frequencies of bins in an histogram.
This class stores measurement vectors in the context of n-dimensional histogram.
virtual void FillHistogram(RadiusType radius, RegionType region)
void SetPixelValueMinMax(PixelType min, PixelType max)
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void FillHistogramWithMask(RadiusType radius, RegionType region, const MaskImageType *maskImage)
Histogram< MeasurementType, THistogramFrequencyContainer > HistogramType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
detail::VectorContainer< std::conditional_t< std::is_void_v< T2 >, SizeValueType, T1 >, std::conditional_t< std::is_void_v< T2 >, T1, T2 > > VectorContainer