ITK  5.4.0
Insight Toolkit
itkMeanImageFilter.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 itkMeanImageFilter_h
19#define itkMeanImageFilter_h
20
21#include "itkBoxImageFilter.h"
22#include "itkImage.h"
23#include "itkNumericTraits.h"
25
26#include <vector>
27
28namespace itk
29{
51template <typename TInputImage, typename TOutputImage>
52class ITK_TEMPLATE_EXPORT MeanImageFilter : public BoxImageFilter<TInputImage, TOutputImage>
53{
54public:
55 ITK_DISALLOW_COPY_AND_MOVE(MeanImageFilter);
56
58 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
59 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
60
62 using InputImageType = TInputImage;
63 using OutputImageType = TOutputImage;
64
70
72 itkNewMacro(Self);
73
75 itkOverrideGetNameOfClassMacro(MeanImageFilter);
76
78 using InputPixelType = typename InputImageType::PixelType;
79 using OutputPixelType = typename OutputImageType::PixelType;
81
84
86
87#ifdef ITK_USE_CONCEPT_CHECKING
88 // Begin concept checking
90 // End concept checking
91#endif
92
93protected:
95 ~MeanImageFilter() override = default;
96
107 void
108 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
109
110private:
111 template <typename TPixelAccessPolicy, typename TPixelType>
112 static void
113 GenerateDataInSubregion(const TInputImage & inputImage,
114 TOutputImage & outputImage,
115 const ImageRegion<InputImageDimension> & imageRegion,
116 const std::vector<Offset<InputImageDimension>> & neighborhoodOffsets,
117 const TPixelType *);
118
119 template <typename TPixelAccessPolicy, typename TValue>
120 static void
121 GenerateDataInSubregion(const TInputImage & inputImage,
122 TOutputImage & outputImage,
123 const ImageRegion<InputImageDimension> & imageRegion,
124 const std::vector<Offset<InputImageDimension>> & neighborhoodOffsets,
126};
127} // end namespace itk
128
129#ifndef ITK_MANUAL_INSTANTIATION
130# include "itkMeanImageFilter.hxx"
131#endif
132
133#endif
A base class for all the filters working on a box neighborhood.
typename TInputImage::PixelType InputPixelType
typename TOutputImage::PixelType OutputPixelType
An image region represents a structured region of data.
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::RegionType InputImageRegionType
Applies an averaging filter to an image.
static void GenerateDataInSubregion(const TInputImage &inputImage, TOutputImage &outputImage, const ImageRegion< InputImageDimension > &imageRegion, const std::vector< Offset< InputImageDimension > > &neighborhoodOffsets, const VariableLengthVector< TValue > *)
typename InputImageType::SizeType InputSizeType
~MeanImageFilter() override=default
typename NumericTraits< InputPixelType >::RealType InputRealType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
static void GenerateDataInSubregion(const TInputImage &inputImage, TOutputImage &outputImage, const ImageRegion< InputImageDimension > &imageRegion, const std::vector< Offset< InputImageDimension > > &neighborhoodOffsets, const TPixelType *)
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...
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition: itkOffset.h:70