OTB  6.1.0
Orfeo Toolbox
otbPersistentImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbPersistentImageFilter_h
22 #define otbPersistentImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 
26 namespace otb
27 {
46 template <class TInputImage, class TOutputImage>
47 class ITK_EXPORT PersistentImageFilter
48  : public itk::ImageToImageFilter<TInputImage, TOutputImage>
49 {
50 public:
56 
58  itkTypeMacro(PersistentImageFilter, ImageToImageFilter);
59 
61  typedef TInputImage InputImageType;
62  typedef TOutputImage OutputImageType;
63 
67  virtual void Reset(void) = 0;
68 
72  virtual void Synthetize(void) = 0;
73 
74 protected:
77 
79  ~PersistentImageFilter() ITK_OVERRIDE {}
80 
82  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE
83  {
84  Superclass::PrintSelf(os, indent);
85  }
86 
87 private:
88  PersistentImageFilter(const Self &); //purposely not implemented
89  void operator =(const Self&); //purposely not implemented
90 };
91 } // End namespace otb
92 
93 #endif
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
itk::SmartPointer< Self > Pointer
This filter is the base class for all filter persisting data through multiple update. For instance, a filter computing global statistics on an image with streaming capabilities will have to keep the temporary results for each streamed piece of the image in order to synthesize the global statistics at the end. This filter is an itk::ImageToImageFilter, providing two additional methods. The first one, Synthetize(), allows the user to synthesize temporary data produced by the multiple updates on different pieces of the image to the global result. The second one, Reset(), allows the user to reset the temporary data for a new input image for instance.