ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
82 using InputImageRegionType = typename InputImageType::RegionType;
83 using OutputImageRegionType = typename OutputImageType::RegionType;
84
85 using InputSizeType = typename InputImageType::SizeType;
86
88
89protected:
91 ~MeanImageFilter() override = default;
92
103 void
104 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
105
106private:
107 template <typename TPixelAccessPolicy, typename TPixelType>
108 static void
109 GenerateDataInSubregion(const TInputImage & inputImage,
110 TOutputImage & outputImage,
111 const ImageRegion<InputImageDimension> & imageRegion,
112 const std::vector<Offset<InputImageDimension>> & neighborhoodOffsets,
113 const TPixelType *);
114
115 template <typename TPixelAccessPolicy, typename TValue>
116 static void
117 GenerateDataInSubregion(const TInputImage & inputImage,
118 TOutputImage & outputImage,
119 const ImageRegion<InputImageDimension> & imageRegion,
120 const std::vector<Offset<InputImageDimension>> & neighborhoodOffsets,
122};
123} // end namespace itk
124
125#ifndef ITK_MANUAL_INSTANTIATION
126# include "itkMeanImageFilter.hxx"
127#endif
128
129#endif
An image region represents a structured region of data.
static void GenerateDataInSubregion(const TInputImage &inputImage, TOutputImage &outputImage, const ImageRegion< InputImageDimension > &imageRegion, const std::vector< Offset< InputImageDimension > > &neighborhoodOffsets, const VariableLengthVector< TValue > *)
static constexpr unsigned int InputImageDimension
typename InputImageType::SizeType InputSizeType
static constexpr unsigned int OutputImageDimension
typename InputImageType::PixelType InputPixelType
typename OutputImageType::RegionType OutputImageRegionType
SmartPointer< Self > Pointer
typename OutputImageType::PixelType OutputPixelType
~MeanImageFilter() override=default
typename InputImageType::RegionType InputImageRegionType
typename NumericTraits< InputPixelType >::RealType InputRealType
BoxImageFilter< InputImageType, OutputImageType > Superclass
SmartPointer< const Self > ConstPointer
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 *)
Implements transparent reference counting.
#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:67