ITK  6.0.0
Insight Toolkit
itkScalarImageToRunLengthMatrixFilter.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 itkScalarImageToRunLengthMatrixFilter_h
19#define itkScalarImageToRunLengthMatrixFilter_h
20
21#include "itkImage.h"
22#include "itkHistogram.h"
23#include "itkNumericTraits.h"
24#include "itkVectorContainer.h"
25#include "itkProcessObject.h"
26
27namespace itk
28{
29namespace Statistics
30{
31
105template <typename TImageType, typename THistogramFrequencyContainer = DenseFrequencyContainer2>
106class ITK_TEMPLATE_EXPORT ScalarImageToRunLengthMatrixFilter : public ProcessObject
107{
108public:
114
116 itkOverrideGetNameOfClassMacro(ScalarImageToRunLengthMatrixFilter);
117
119 itkNewMacro(Self);
120
121 using ImageType = TImageType;
124 using PixelType = typename ImageType::PixelType;
128 using OffsetType = typename ImageType::OffsetType;
132
135
140
142 static constexpr unsigned int ImageDimension = TImageType::ImageDimension;
143
145 static constexpr unsigned int DefaultBinsPerAxis = 256;
146
156 itkSetObjectMacro(Offsets, OffsetVector);
157
167 void
168 SetOffset(const OffsetType offset);
169
173 itkGetModifiableObjectMacro(Offsets, OffsetVector);
174
176 itkSetMacro(NumberOfBinsPerAxis, unsigned int);
177
179 itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
180
185 void
187
189 itkGetConstMacro(Min, PixelType);
190
192 itkGetConstMacro(Max, PixelType);
193
198 void
200
204 itkGetConstMacro(MinDistance, RealType);
205
209 itkGetConstMacro(MaxDistance, RealType);
210
212 using Superclass::SetInput;
213 void
214 SetInput(const ImageType * image);
215
217 const ImageType *
218 GetInput() const;
219
221 void
222 SetMaskImage(const ImageType * image);
223
225 const ImageType *
227
229 const HistogramType *
230 GetOutput() const;
231
236 itkSetMacro(InsidePixelValue, PixelType);
237 itkGetConstMacro(InsidePixelValue, PixelType);
240protected:
243 void
244 PrintSelf(std::ostream & os, Indent indent) const override;
245
248
250 using Superclass::MakeOutput;
253
255 void
256 GenerateData() override;
257
265 void
267
268private:
269 unsigned int m_NumberOfBinsPerAxis{};
270 PixelType m_Min{};
271 PixelType m_Max{};
272 RealType m_MinDistance{};
273 RealType m_MaxDistance{};
274 PixelType m_InsidePixelValue{};
275
276 MeasurementVectorType m_LowerBound{};
277 MeasurementVectorType m_UpperBound{};
279};
280} // end of namespace Statistics
281} // end of namespace itk
282
283#ifndef ITK_MANUAL_INSTANTIATION
284# include "itkScalarImageToRunLengthMatrixFilter.hxx"
285#endif
286
287#endif
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:78
This class computes a run length matrix (histogram) from a given image and a mask image if provided....
typename HistogramType::MeasurementVectorType MeasurementVectorType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
void PrintSelf(std::ostream &os, Indent indent) const override
void SetDistanceValueMinMax(RealType min, RealType max)
void SetPixelValueMinMax(PixelType min, PixelType max)
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41