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
28{
29namespace Statistics
30{
89
90template <typename TImageType,
91 typename THistogramFrequencyContainer = DenseFrequencyContainer2,
92 typename TMaskImageType = TImageType>
93class ITK_TEMPLATE_EXPORT ScalarImageToCooccurrenceMatrixFilter : public ProcessObject
94{
95public:
96 ITK_DISALLOW_COPY_AND_MOVE(ScalarImageToCooccurrenceMatrixFilter);
97
103
105 itkOverrideGetNameOfClassMacro(ScalarImageToCooccurrenceMatrixFilter);
106
108 itkNewMacro(Self);
109
110 using ImageType = TImageType;
111 using ImagePointer = typename ImageType::Pointer;
112 using ImageConstPointer = typename ImageType::ConstPointer;
113 using PixelType = typename ImageType::PixelType;
114 using RegionType = typename ImageType::RegionType;
115 using RadiusType = typename ImageType::SizeType;
116 using OffsetType = typename ImageType::OffsetType;
120 using MaskImageType = TMaskImageType;
121 using MaskPointer = typename MaskImageType::Pointer;
122 using MaskConstPointer = typename MaskImageType::ConstPointer;
123 using MaskPixelType = typename MaskImageType::PixelType;
124
126
131
132 static constexpr unsigned int DefaultBinsPerAxis = 256;
133
136 itkSetConstObjectMacro(Offsets, OffsetVector);
137 itkGetConstObjectMacro(Offsets, OffsetVector);
139
140 void
141 SetOffset(const OffsetType offset);
142
144 itkSetMacro(NumberOfBinsPerAxis, unsigned int);
145 itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
147
150 void
152
153 itkGetConstMacro(Min, PixelType);
154 itkGetConstMacro(Max, PixelType);
155
158 itkSetMacro(Normalize, bool);
159 itkGetConstMacro(Normalize, bool);
160 itkBooleanMacro(Normalize);
162
165 void
166 SetInput(const ImageType * image);
167
168 const ImageType *
169 GetInput() const;
170
172 void
174
175 const MaskImageType *
177
179 const HistogramType *
180 GetOutput() const;
181
184 itkSetMacro(InsidePixelValue, MaskPixelType);
185 itkGetConstMacro(InsidePixelValue, MaskPixelType);
187
188protected:
191 void
192 PrintSelf(std::ostream & os, Indent indent) const override;
193
194 virtual void
196
197 virtual void
198 FillHistogramWithMask(RadiusType radius, RegionType region, const MaskImageType * maskImage);
199
202
207
209 void
210 GenerateData() override;
211
212private:
213 void
215
219
220 unsigned int m_NumberOfBinsPerAxis{};
224
226};
227} // end of namespace Statistics
228} // end of namespace itk
229
230#ifndef ITK_MANUAL_INSTANTIATION
231# include "itkScalarImageToCooccurrenceMatrixFilter.hxx"
232#endif
233
234#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.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
detail::VectorContainer< std::conditional_t< std::is_void_v< T2 >, SizeValueType, T1 >, std::conditional_t< std::is_void_v< T2 >, T1, T2 > > VectorContainer