ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkRunLengthTextureFeaturesImageFilter.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 itkRunLengthTextureFeaturesImageFilter_h
19#define itkRunLengthTextureFeaturesImageFilter_h
20
24
25namespace itk
26{
27namespace Statistics
28{
104
105template <typename TInputImage,
106 typename TOutputImage,
107 typename TMaskImage = Image<unsigned char, TInputImage::ImageDimension>>
108class ITK_TEMPLATE_EXPORT RunLengthTextureFeaturesImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
109{
110public:
116
118 itkOverrideGetNameOfClassMacro(RunLengthTextureFeaturesImageFilter);
119
121 itkNewMacro(Self);
122
123 using InputImageType = TInputImage;
124 using OutputImageType = TOutputImage;
125 using MaskImageType = TMaskImage;
126
127 using PixelType = typename InputImageType::PixelType;
128 using MaskPixelType = typename MaskImageType::PixelType;
129 using IndexType = typename InputImageType::IndexType;
130 using PointType = typename InputImageType::PointType;
131
132 using OffsetType = typename InputImageType::OffsetType;
136
137 using InputRegionType = typename InputImageType::RegionType;
138 using OutputRegionType = typename OutputImageType::RegionType;
139
141
144
147 itkGetConstMacro(NeighborhoodRadius, NeighborhoodRadiusType);
148
151
154
155
157 static constexpr unsigned int DefaultBinsPerAxis = 256;
158
168 itkSetObjectMacro(Offsets, OffsetVector);
169
179 void
180 SetOffset(const OffsetType offset);
181
185 itkGetModifiableObjectMacro(Offsets, OffsetVector);
186
188 itkSetMacro(NumberOfBinsPerAxis, unsigned int);
189
191 itkGetConstMacro(NumberOfBinsPerAxis, unsigned int);
192
195 itkGetConstMacro(HistogramValueMinimum, PixelType);
196 itkSetMacro(HistogramValueMinimum, PixelType);
197
200 itkGetConstMacro(HistogramValueMaximum, PixelType);
201 itkSetMacro(HistogramValueMaximum, PixelType);
202
203
208 itkGetConstMacro(HistogramDistanceMinimum, RealType);
209 itkSetMacro(HistogramDistanceMinimum, RealType);
210
215 itkGetConstMacro(HistogramDistanceMaximum, RealType);
216 itkSetMacro(HistogramDistanceMaximum, RealType);
217
222 itkSetMacro(InsidePixelValue, MaskPixelType);
223 itkGetConstMacro(InsidePixelValue, MaskPixelType);
224
225 using OutputPixelType = typename OutputImageType::PixelType;
227
229
230protected:
234 using NeighborIndexType = typename NeighborhoodIteratorType::NeighborIndexType;
235
238
239 void
241 bool
242 IsInsideNeighborhood(const OffsetType & iteratedOffset);
243 void
244 IncreaseHistogram(vnl_matrix<unsigned int> & hist,
245 unsigned int & totalNumberOfRuns,
246 const HistogramIndexType & currentInNeighborhoodPixelIntensity,
247 const OffsetType & offset,
248 const unsigned int & pixelDistance);
249 void
250 ComputeFeatures(vnl_matrix<unsigned int> & hist,
251 const unsigned int & totalNumberOfRuns,
252 typename TOutputImage::PixelType & outputPixel);
253 void
254 PrintSelf(std::ostream & os, Indent indent) const override;
255
257 void
259 void
261 void
262 DynamicThreadedGenerateData(const OutputRegionType & outputRegionForThread) override;
263 void
265
266private:
276 typename TInputImage::SpacingType m_Spacing;
277};
278} // end of namespace Statistics
279} // end of namespace itk
280
281#ifndef ITK_MANUAL_INSTANTIATION
282# include "itkRunLengthTextureFeaturesImageFilter.hxx"
283#endif
284
285#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.
typename NumericTraits< OutputPixelType >::ScalarRealType OutputRealType
bool IsInsideNeighborhood(const OffsetType &iteratedOffset)
typename itk::ConstNeighborhoodIterator< DigitizedImageType > NeighborhoodIteratorType
itk::Image< HistogramIndexType, TInputImage::ImageDimension > DigitizedImageType
void ComputeFeatures(vnl_matrix< unsigned int > &hist, const unsigned int &totalNumberOfRuns, typename TOutputImage::PixelType &outputPixel)
typename itk::ConstNeighborhoodIterator< InputImageType >::RadiusType NeighborhoodRadiusType
typename NeighborhoodIteratorType::NeighborIndexType NeighborIndexType
void PrintSelf(std::ostream &os, Indent indent) const override
void DynamicThreadedGenerateData(const OutputRegionType &outputRegionForThread) override
void IncreaseHistogram(vnl_matrix< unsigned int > &hist, unsigned int &totalNumberOfRuns, const HistogramIndexType &currentInNeighborhoodPixelIntensity, const OffsetType &offset, const unsigned int &pixelDistance)
#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)