Orfeo Toolbox  3.16
otbStreamingImageVirtualWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbStreamingImageVirtualWriter_h
19 #define __otbStreamingImageVirtualWriter_h
20 
21 #include "itkMacro.h"
22 #include "itkImageToImageFilter.h"
23 #include "otbStreamingManager.h"
24 
25 namespace otb
26 {
27 
53 template <class TInputImage >
54 class ITK_EXPORT StreamingImageVirtualWriter : public itk::ImageToImageFilter<TInputImage, TInputImage>
55 {
56 public:
62 
64  itkNewMacro(Self);
65 
68 
70  typedef TInputImage InputImageType;
71  typedef typename InputImageType::Pointer InputImagePointer;
72  typedef typename InputImageType::RegionType InputImageRegionType;
73  typedef typename InputImageType::PixelType InputImagePixelType;
74 
78 
80  itkStaticConstMacro(InputImageDimension, unsigned int,
81  InputImageType::ImageDimension);
82 
85  StreamingManagerType* GetStreamingManager(void)
86  {
87  return m_StreamingManager;
88  }
89 
92  void SetStreamingManager(StreamingManagerType* streamingManager)
93  {
94  m_StreamingManager = streamingManager;
95  }
96 
99  void SetNumberOfDivisionsStrippedStreaming(unsigned int nbDivisions);
100 
103  void SetNumberOfDivisionsTiledStreaming(unsigned int nbDivisions);
104 
107  void SetNumberOfLinesStrippedStreaming(unsigned int nbLinesPerStrip);
108 
114  void SetAutomaticStrippedStreaming(unsigned int availableRAM = 0, double bias = 1.0);
115 
118  void SetTileDimensionTiledStreaming(unsigned int tileDimension);
119 
126  void SetAutomaticTiledStreaming(unsigned int availableRAM = 0, double bias = 1.0);
127 
134  void SetAutomaticAdaptativeStreaming(unsigned int availableRAM = 0, double bias = 1.0);
135 
136 protected:
138 
139  virtual ~StreamingImageVirtualWriter();
140 
141  void PrintSelf(std::ostream& os, itk::Indent indent) const;
142 
143  virtual void GenerateData(void);
144 
145  virtual void GenerateInputRequestedRegion(void);
146 
147 private:
148  StreamingImageVirtualWriter(const StreamingImageVirtualWriter &); //purposely not implemented
149  void operator =(const StreamingImageVirtualWriter&); //purposely not implemented
150 
151  void ObserveSourceFilterProgress(itk::Object* object, const itk::EventObject & event )
152  {
153  if (typeid(event) != typeid(itk::ProgressEvent))
154  {
155  return;
156  }
157 
158  itk::ProcessObject* processObject = dynamic_cast<itk::ProcessObject*>(object);
159  if (processObject)
160  {
161  m_DivisionProgress = processObject->GetProgress();
162  }
163 
164  this->UpdateFilterProgress();
165  }
166 
167  void UpdateFilterProgress()
168  {
169  this->UpdateProgress( (m_DivisionProgress + m_CurrentDivision) / m_NumberOfDivisions );
170  }
171 
172  unsigned int m_NumberOfDivisions;
173  unsigned int m_CurrentDivision;
175 
177 
179  unsigned long m_ObserverID;
180 };
181 
182 } // end namespace otb
183 
184 #ifndef OTB_MANUAL_INSTANTIATION
186 #endif
187 
188 #endif

Generated at Sun Feb 3 2013 00:49:01 for Orfeo Toolbox with doxygen 1.8.1.1