ITK  5.4.0
Insight Toolkit
itkScalarImageToTextureFeaturesFilter.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 itkScalarImageToTextureFeaturesFilter_h
19 #define itkScalarImageToTextureFeaturesFilter_h
20 
21 #include "itkDataObjectDecorator.h"
22 
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
108 template <typename TImageType,
109  typename THistogramFrequencyContainer = DenseFrequencyContainer2,
110  typename TMaskImageType = TImageType>
111 class ITK_TEMPLATE_EXPORT ScalarImageToTextureFeaturesFilter : public ProcessObject
112 {
113 public:
119 
121  itkOverrideGetNameOfClassMacro(ScalarImageToTextureFeaturesFilter);
122 
124  itkNewMacro(Self);
125 
126  using FrequencyContainerType = THistogramFrequencyContainer;
127  using ImageType = TImageType;
129  using MaskImageType = TMaskImageType;
131  using MaskPixelType = typename MaskImageType::PixelType;
132 
133  using PixelType = typename ImageType::PixelType;
134  using OffsetType = typename ImageType::OffsetType;
138 
141 
144 
145  // More work needs to be done to fix wrapping
146  // using TextureFeatureName = itk::Statistics::TextureFeatureEnum;
147  using TextureFeatureName = uint8_t;
149 
154 
157 
160 
162  GetFeatureMeansOutput() const;
163 
165  GetFeatureStandardDeviationsOutput() const;
166 
169  using Superclass::SetInput;
170  void
171  SetInput(const ImageType *);
172 
173  const ImageType *
174  GetInput() const;
175 
177  itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector);
178  itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector);
182  itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector);
183  itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector);
188  itkSetConstObjectMacro(Offsets, OffsetVector);
189  itkGetConstObjectMacro(Offsets, OffsetVector);
194  void
195  SetNumberOfBinsPerAxis(unsigned int);
196 
199  void
200  SetPixelValueMinMax(PixelType min, PixelType max);
205  void
206  SetMaskImage(const MaskImageType *);
207 
208  const MaskImageType *
209  GetMaskImage() const;
210 
213  void
214  SetInsidePixelValue(MaskPixelType insidePixelValue);
215 
216  itkGetConstMacro(FastCalculations, bool);
217  itkSetMacro(FastCalculations, bool);
218  itkBooleanMacro(FastCalculations);
219 
220 protected:
222  ~ScalarImageToTextureFeaturesFilter() override = default;
223  void
224  PrintSelf(std::ostream & os, Indent indent) const override;
225 
226  void
227  FastCompute();
228 
229  void
230  FullCompute();
231 
233  void
234  GenerateData() override;
235 
238  using Superclass::MakeOutput;
240 
241 private:
242  typename CooccurrenceMatrixFilterType::Pointer m_GLCMGenerator{};
243 
244  typename TextureFeaturesFilterType::Pointer m_GLCMCalculator{};
245 
246  FeatureValueVectorPointer m_FeatureMeans{};
247  FeatureValueVectorPointer m_FeatureStandardDeviations{};
248  FeatureNameVectorConstPointer m_RequestedFeatures{};
250  bool m_FastCalculations{};
251 };
252 } // end of namespace Statistics
253 } // end of namespace itk
254 
255 #ifndef ITK_MANUAL_INSTANTIATION
256 # include "itkScalarImageToTextureFeaturesFilter.hxx"
257 #endif
258 
259 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::Statistics::ScalarImageToTextureFeaturesFilter::FeatureNameVectorPointer
typename FeatureNameVector::Pointer FeatureNameVectorPointer
Definition: itkScalarImageToTextureFeaturesFilter.h:150
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::Statistics::ScalarImageToTextureFeaturesFilter::OffsetVectorPointer
typename OffsetVector::Pointer OffsetVectorPointer
Definition: itkScalarImageToTextureFeaturesFilter.h:136
itk::Statistics::ScalarImageToTextureFeaturesFilter::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkScalarImageToTextureFeaturesFilter.h:128
itk::Statistics::ScalarImageToTextureFeaturesFilter::MaskImageType
TMaskImageType MaskImageType
Definition: itkScalarImageToTextureFeaturesFilter.h:129
itk::Statistics::ScalarImageToTextureFeaturesFilter::TextureFeatureName
uint8_t TextureFeatureName
Definition: itkScalarImageToTextureFeaturesFilter.h:147
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::ScalarImageToTextureFeaturesFilter::MaskPointer
typename MaskImageType::Pointer MaskPointer
Definition: itkScalarImageToTextureFeaturesFilter.h:130
itk::DataObjectDecorator
Decorates any subclass of itkObject with a DataObject API.
Definition: itkDataObjectDecorator.h:66
itk::Statistics::ScalarImageToCooccurrenceMatrixFilter
This class computes a co-occurrence matrix (histogram) from a given image and a mask image if provide...
Definition: itkScalarImageToCooccurrenceMatrixFilter.h:96
itkScalarImageToCooccurrenceMatrixFilter.h
itk::Statistics::Histogram
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::Statistics::HistogramToTextureFeaturesFilter
This class computes texture feature coefficients from a grey level co-occurrence matrix.
Definition: itkHistogramToTextureFeaturesFilter.h:133
itkDataObjectDecorator.h
itk::Statistics::ScalarImageToTextureFeaturesFilter::MaskPixelType
typename MaskImageType::PixelType MaskPixelType
Definition: itkScalarImageToTextureFeaturesFilter.h:131
itk::Statistics::ScalarImageToTextureFeaturesFilter::FeatureNameVectorConstPointer
typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer
Definition: itkScalarImageToTextureFeaturesFilter.h:151
itkHistogramToTextureFeaturesFilter.h
itk::Statistics::ScalarImageToTextureFeaturesFilter::FrequencyContainerType
THistogramFrequencyContainer FrequencyContainerType
Definition: itkScalarImageToTextureFeaturesFilter.h:126
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Statistics::ScalarImageToTextureFeaturesFilter::HistogramType
typename CooccurrenceMatrixFilterType::HistogramType HistogramType
Definition: itkScalarImageToTextureFeaturesFilter.h:142
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::Statistics::ScalarImageToTextureFeaturesFilter::OffsetType
typename ImageType::OffsetType OffsetType
Definition: itkScalarImageToTextureFeaturesFilter.h:134
itk::Statistics::ScalarImageToTextureFeaturesFilter
This class computes texture descriptions from an image.
Definition: itkScalarImageToTextureFeaturesFilter.h:111
itk::Statistics::ScalarImageToTextureFeaturesFilter::FeatureValueVectorPointer
typename FeatureValueVector::Pointer FeatureValueVectorPointer
Definition: itkScalarImageToTextureFeaturesFilter.h:153
itk::Statistics::ScalarImageToTextureFeaturesFilter::OffsetVectorConstPointer
typename OffsetVector::ConstPointer OffsetVectorConstPointer
Definition: itkScalarImageToTextureFeaturesFilter.h:137
itk::Statistics::ScalarImageToTextureFeaturesFilter::ImageType
TImageType ImageType
Definition: itkScalarImageToTextureFeaturesFilter.h:127
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48
itk::Statistics::ScalarImageToTextureFeaturesFilter::PixelType
typename ImageType::PixelType PixelType
Definition: itkScalarImageToTextureFeaturesFilter.h:133