ITK  6.0.0
Insight Toolkit
itkScalarImageToRunLengthFeaturesFilter.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 itkScalarImageToRunLengthFeaturesFilter_h
19 #define itkScalarImageToRunLengthFeaturesFilter_h
20 
21 #include "itkDataObjectDecorator.h"
22 
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
94 template <typename TImageType, typename THistogramFrequencyContainer = DenseFrequencyContainer2>
95 class ITK_TEMPLATE_EXPORT ScalarImageToRunLengthFeaturesFilter : public ProcessObject
96 {
97 public:
103 
105  itkOverrideGetNameOfClassMacro(ScalarImageToRunLengthFeaturesFilter);
106 
108  itkNewMacro(Self);
109 
110  using FrequencyContainerType = THistogramFrequencyContainer;
111  using ImageType = TImageType;
113 
114  using PixelType = typename ImageType::PixelType;
115  using OffsetType = typename ImageType::OffsetType;
119 
121 
123 
125 
126  // More work needs to be done to fix wrapping
127  // using RunLengthFeatureName = itk::Statistics::RunLengthFeatureEnum;
128  using RunLengthFeatureName = uint8_t;
134 
137 
140 
142  GetFeatureMeansOutput() const;
143 
145  GetFeatureStandardDeviationsOutput() const;
146 
149  using Superclass::SetInput;
150  void
151  SetInput(const ImageType *);
152 
153  const ImageType *
154  GetInput() const;
155 
157  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
158  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
162  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
163  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
168  itkSetConstObjectMacro(Offsets, OffsetVector);
169  itkGetConstObjectMacro(Offsets, OffsetVector);
174  void
175  SetNumberOfBinsPerAxis(unsigned int);
176 
179  void
180  SetPixelValueMinMax(PixelType min, PixelType max);
185  void
186  SetDistanceValueMinMax(double min, double max);
191  void
192  SetMaskImage(const ImageType *);
193 
194  const ImageType *
195  GetMaskImage() const;
196 
199  void
200  SetInsidePixelValue(PixelType insidePixelValue);
201 
202  itkGetConstMacro(FastCalculations, bool);
203  itkSetMacro(FastCalculations, bool);
204  itkBooleanMacro(FastCalculations);
205 
206 protected:
208  ~ScalarImageToRunLengthFeaturesFilter() override = default;
209  void
210  PrintSelf(std::ostream & os, Indent indent) const override;
211 
212  void
213  FastCompute();
214 
215  void
216  FullCompute();
217 
219  void
220  GenerateData() override;
221 
224  using Superclass::MakeOutput;
226 
227 private:
228  typename RunLengthMatrixFilterType::Pointer m_RunLengthMatrixGenerator{};
229 
230  FeatureValueVectorPointer m_FeatureMeans{};
231  FeatureValueVectorPointer m_FeatureStandardDeviations{};
232  FeatureNameVectorConstPointer m_RequestedFeatures{};
234  bool m_FastCalculations{};
235 };
236 } // end of namespace Statistics
237 } // end of namespace itk
238 
239 #ifndef ITK_MANUAL_INSTANTIATION
240 # include "itkScalarImageToRunLengthFeaturesFilter.hxx"
241 #endif
242 
243 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Statistics::ScalarImageToRunLengthMatrixFilter
This class computes a run length matrix (histogram) from a given image and a mask image if provided....
Definition: itkScalarImageToRunLengthMatrixFilter.h:106
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::detail::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:51
itkScalarImageToRunLengthMatrixFilter.h
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::RunLengthFeatureName
uint8_t RunLengthFeatureName
Definition: itkScalarImageToRunLengthFeaturesFilter.h:128
itk::Statistics::HistogramToRunLengthFeaturesFilter
This class computes texture feature coefficients from a grey level run-length matrix.
Definition: itkHistogramToRunLengthFeaturesFilter.h:99
itk::Statistics::ScalarImageToRunLengthFeaturesFilter
This class computes run length descriptions from an image.
Definition: itkScalarImageToRunLengthFeaturesFilter.h:95
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::PixelType
typename ImageType::PixelType PixelType
Definition: itkScalarImageToRunLengthFeaturesFilter.h:114
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:194
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::FeatureValueVectorPointer
typename FeatureValueVector::Pointer FeatureValueVectorPointer
Definition: itkScalarImageToRunLengthFeaturesFilter.h:133
itk::DataObjectDecorator
Decorates any subclass of itkObject with a DataObject API.
Definition: itkDataObjectDecorator.h:66
itk::Statistics::Histogram
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkScalarImageToRunLengthFeaturesFilter.h:112
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::OffsetType
typename ImageType::OffsetType OffsetType
Definition: itkScalarImageToRunLengthFeaturesFilter.h:115
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkDataObjectDecorator.h
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::HistogramType
typename RunLengthMatrixFilterType::HistogramType HistogramType
Definition: itkScalarImageToRunLengthFeaturesFilter.h:122
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::ImageType
TImageType ImageType
Definition: itkScalarImageToRunLengthFeaturesFilter.h:111
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::FeatureNameVectorConstPointer
typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer
Definition: itkScalarImageToRunLengthFeaturesFilter.h:131
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::FeatureNameVectorPointer
typename FeatureNameVector::Pointer FeatureNameVectorPointer
Definition: itkScalarImageToRunLengthFeaturesFilter.h:130
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::OffsetVectorConstPointer
typename OffsetVector::ConstPointer OffsetVectorConstPointer
Definition: itkScalarImageToRunLengthFeaturesFilter.h:118
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::FrequencyContainerType
THistogramFrequencyContainer FrequencyContainerType
Definition: itkScalarImageToRunLengthFeaturesFilter.h:110
itk::Statistics::ScalarImageToRunLengthFeaturesFilter::OffsetVectorPointer
typename OffsetVector::Pointer OffsetVectorPointer
Definition: itkScalarImageToRunLengthFeaturesFilter.h:117
itkHistogramToRunLengthFeaturesFilter.h