ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkCoocurrenceTextureFeaturesImageFilter.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 itkCoocurrenceTextureFeaturesImageFilter_h
19#define itkCoocurrenceTextureFeaturesImageFilter_h
20
23#include "itkVectorContainer.h"
24
25namespace itk
26{
27namespace Statistics
28{
91
92template <typename TInputImage,
93 typename TOutputImage,
94 typename TMaskImage = Image<unsigned char, TInputImage::ImageDimension>>
95class ITK_TEMPLATE_EXPORT CoocurrenceTextureFeaturesImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
96{
97public:
103
105 itkOverrideGetNameOfClassMacro(CoocurrenceTextureFeaturesImageFilter);
106
108 itkNewMacro(Self);
109
110 using InputImageType = TInputImage;
111 using OutputImageType = TOutputImage;
112 using MaskImageType = TMaskImage;
113
114 using PixelType = typename InputImageType::PixelType;
115 using MaskPixelType = typename MaskImageType::PixelType;
116 using IndexType = typename InputImageType::IndexType;
117 using PointType = typename InputImageType::PointType;
118
119 using OffsetType = typename InputImageType::OffsetType;
123
124 using InputRegionType = typename InputImageType::RegionType;
125 using OutputRegionType = typename OutputImageType::RegionType;
126
128
131
134 itkGetConstMacro(NeighborhoodRadius, NeighborhoodRadiusType);
135
138
141
142
144 static constexpr unsigned int DefaultBinsPerAxis = 256;
145
155 itkSetObjectMacro(Offsets, OffsetVector);
156
166 void
167 SetOffset(const OffsetType offset);
168
172 itkGetModifiableObjectMacro(Offsets, OffsetVector);
173
175 itkSetMacro(NumberOfBinsPerAxis, unsigned int);
176
178 itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
179
181 itkGetConstMacro(HistogramMaximum, PixelType);
182 itkSetMacro(HistogramMaximum, PixelType);
183
185 itkGetConstMacro(HistogramMinimum, PixelType);
186 itkSetMacro(HistogramMinimum, PixelType);
187
192 itkSetMacro(InsidePixelValue, MaskPixelType);
193 itkGetConstMacro(InsidePixelValue, MaskPixelType);
194
197 itkSetMacro(Normalize, bool);
198 itkGetConstMacro(Normalize, bool);
199 itkBooleanMacro(Normalize);
200
201 using OutputPixelType = typename OutputImageType::PixelType;
203
205
206protected:
210 using NeighborIndexType = typename NeighborhoodIteratorType::NeighborIndexType;
211
214
215 bool
216 IsInsideNeighborhood(const OffsetType & iteratedOffset);
217 void
218 ComputeFeatures(const vnl_matrix<unsigned int> & hist,
219 const unsigned int totalNumberOfFreq,
220 typename TOutputImage::PixelType & outputPixel);
221 void
222 ComputeMeansAndVariances(const vnl_matrix<unsigned int> & hist,
223 const unsigned int totalNumberOfFreq,
224 double & pixelMean,
225 double & marginalMean,
226 double & marginalDevSquared,
227 double & pixelVariance);
228 void
229 PrintSelf(std::ostream & os, Indent indent) const override;
230
232 void
234 void
236 void
237 DynamicThreadedGenerateData(const OutputRegionType & outputRegionForThread) override;
238 void
240
241private:
243
251};
252} // end of namespace Statistics
253} // end of namespace itk
254
255#ifndef ITK_MANUAL_INSTANTIATION
256# include "itkCoocurrenceTextureFeaturesImageFilter.hxx"
257#endif
258
259#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
itk::Size< VDimension > RadiusType
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:53
Implements transparent reference counting.
void ComputeFeatures(const vnl_matrix< unsigned int > &hist, const unsigned int totalNumberOfFreq, typename TOutputImage::PixelType &outputPixel)
void DynamicThreadedGenerateData(const OutputRegionType &outputRegionForThread) override
bool IsInsideNeighborhood(const OffsetType &iteratedOffset)
typename NumericTraits< OutputPixelType >::ScalarRealType OutputRealType
itk::Image< HistogramIndexType, TInputImage::ImageDimension > DigitizedImageType
typename itk::ConstNeighborhoodIterator< InputImageType >::RadiusType NeighborhoodRadiusType
typename NeighborhoodIteratorType::NeighborIndexType NeighborIndexType
void PrintSelf(std::ostream &os, Indent indent) const override
void ComputeMeansAndVariances(const vnl_matrix< unsigned int > &hist, const unsigned int totalNumberOfFreq, double &pixelMean, double &marginalMean, double &marginalDevSquared, double &pixelVariance)
typename itk::ConstNeighborhoodIterator< DigitizedImageType > NeighborhoodIteratorType
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
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
#define itkSetMacro(name, type)