OTB  10.0.0
Orfeo Toolbox
otbSummingFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
4  * Copyright (C) 2016-2019 IRSTEA
5  *
6  * This file is part of Orfeo Toolbox
7  *
8  * https://www.orfeo-toolbox.org/
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 #ifndef __SummingFilter_H
23 #define __SummingFilter_H
24 
25 #include "itkImageToImageFilter.h"
26 #include "itkImageRegionIterator.h"
27 namespace otb
28 {
39 template <class TInputImage, class TOutputImage>
40 class ITK_EXPORT SummingFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 public:
45  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
46  typedef itk::SmartPointer<Self> Pointer;
47  typedef itk::SmartPointer<const Self> ConstPointer;
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(SummingFilter, ImageToImageFilter);
54 
56  typedef TInputImage InputImageType;
57  typedef typename InputImageType::RegionType InputImageRegionType;
58  typedef typename InputImageType::PixelType InputImagePixelType;
59  typedef typename InputImageType::PointType InputImagePointType;
60  typedef typename InputImageType::IndexType InputImageIndexType;
61  typedef typename InputImageType::SizeType InputImageSizeType;
62  typedef typename InputImageType::SpacingType InputImageSpacingType;
63  typedef typename InputImageType::InternalPixelType InputImageInternalPixelType;
64 
66  typedef TOutputImage OutputImageType;
67  typedef typename OutputImageType::Pointer OutputImagePointer;
68  typedef typename OutputImageType::RegionType OutputImageRegionType;
69  typedef typename OutputImageType::IndexType OutputImageIndexType;
70  typedef typename OutputImageType::PointType OutputImagePointType;
71  typedef typename OutputImageType::SizeType OutputImageSizeType;
72  typedef typename OutputImageType::SpacingType OutputImageSpacingType;
73  typedef typename OutputImageType::PixelType OutputImagePixelType;
74  typedef typename OutputImageType::InternalPixelType OutputImageInternalPixelType;
75 
77  typedef itk::ImageRegionIterator<OutputImageType> OutputIteratorType;
78  typedef itk::ImageRegionConstIterator<InputImageType> InputIteratorType;
79 
80 protected:
82  {
83  this->DynamicMultiThreadingOn();
84  }
85 
86  virtual ~SummingFilter()
87  {
88  }
89 
102  virtual void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread);
103 
104  virtual void GenerateOutputInformation(void);
105 
106 private:
107  SummingFilter(const Self&); // purposely not implemented
108  void operator=(const Self&); // purposely not implemented
109 
110 }; // end of class
111 }
112 
113 #ifndef OTB_MANUAL_INSTANTIATION
114 #include "otbSummingFilter.hxx"
115 #endif
116 
117 #endif
Computes the sum of the input images pixels.
InputImageType::PointType InputImagePointType
TOutputImage OutputImageType
itk::SmartPointer< const Self > ConstPointer
InputImageType::RegionType InputImageRegionType
OutputImageType::PointType OutputImagePointType
itk::SmartPointer< Self > Pointer
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
TInputImage InputImageType
OutputImageType::RegionType OutputImageRegionType
void operator=(const Self &)
InputImageType::SpacingType InputImageSpacingType
InputImageType::InternalPixelType InputImageInternalPixelType
itk::ImageRegionConstIterator< InputImageType > InputIteratorType
SummingFilter Self
InputImageType::PixelType InputImagePixelType
OutputImageType::InternalPixelType OutputImageInternalPixelType
itk::ImageRegionIterator< OutputImageType > OutputIteratorType
InputImageType::IndexType InputImageIndexType
OutputImageType::SpacingType OutputImageSpacingType
SummingFilter(const Self &)
InputImageType::SizeType InputImageSizeType
OutputImageType::PixelType OutputImagePixelType
OutputImageType::Pointer OutputImagePointer
OutputImageType::SizeType OutputImageSizeType
OutputImageType::IndexType OutputImageIndexType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.