OTB
9.0.0
Orfeo Toolbox
|
#include <otbStreamingImageVirtualWriter.h>
Public Types | |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef InputImageType::PixelType | InputImagePixelType |
typedef InputImageType::Pointer | InputImagePointer |
typedef InputImageType::RegionType | InputImageRegionType |
typedef TInputImage | InputImageType |
typedef itk::SmartPointer< Self > | Pointer |
typedef StreamingImageVirtualWriter | Self |
typedef StreamingManagerType::Pointer | StreamingManagerPointerType |
typedef StreamingManager< InputImageType > | StreamingManagerType |
typedef itk::ImageToImageFilter< TInputImage, TInputImage > | Superclass |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
const bool & | GetAbortGenerateData () const override |
virtual const char * | GetNameOfClass () const |
StreamingManagerType * | GetStreamingManager (void) |
void | SetAutomaticAdaptativeStreaming (unsigned int availableRAM=0, double bias=1.0) |
void | SetAutomaticStrippedStreaming (unsigned int availableRAM=0, double bias=1.0) |
void | SetAutomaticTiledStreaming (unsigned int availableRAM=0, double bias=1.0) |
void | SetNumberOfDivisionsStrippedStreaming (unsigned int nbDivisions) |
void | SetNumberOfDivisionsTiledStreaming (unsigned int nbDivisions) |
void | SetNumberOfLinesStrippedStreaming (unsigned int nbLinesPerStrip) |
void | SetStreamingManager (StreamingManagerType *streamingManager) |
void | SetTileDimensionTiledStreaming (unsigned int tileDimension) |
void | Update () override |
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | InputImageDimension = InputImageType::ImageDimension |
Protected Member Functions | |
void | GenerateInputRequestedRegion (void) override |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
StreamingImageVirtualWriter () | |
~StreamingImageVirtualWriter () override | |
Private Member Functions | |
void | ObserveSourceFilterProgress (itk::Object *object, const itk::EventObject &event) |
void | operator= (const StreamingImageVirtualWriter &)=delete |
StreamingImageVirtualWriter (const StreamingImageVirtualWriter &)=delete | |
void | UpdateFilterProgress () |
Private Attributes | |
unsigned int | m_CurrentDivision |
float | m_DivisionProgress |
bool | m_IsObserving |
itk::SimpleFastMutexLock | m_Lock |
unsigned int | m_NumberOfDivisions |
unsigned long | m_ObserverID |
StreamingManagerPointerType | m_StreamingManager |
void | SetAbortGenerateData (const bool val) override |
void | GenerateData (void) override |
This class acts like a StreamingImageFileWriter, but without actually writing data to the disk.
This allows streaming the whole image through persistent filters such as PersitentStatisticsImageFilter in order to get the global statistics of an image.
This filter is not intended to be used with classic ImageToImageFilter, though it will not generate any error.
The computation of divisions can be done following different strategies by setting the StreamingManager attributes with SetStreamingManager. A set of behaviors are available with the following methods :
It is used in the PersistentFilterStreamingDecorator helper class to propose an easy way to stream an image through a persistent filter.
Definition at line 60 of file otbStreamingImageVirtualWriter.h.
typedef itk::SmartPointer<const Self> otb::StreamingImageVirtualWriter< TInputImage >::ConstPointer |
Definition at line 67 of file otbStreamingImageVirtualWriter.h.
typedef InputImageType::PixelType otb::StreamingImageVirtualWriter< TInputImage >::InputImagePixelType |
Definition at line 79 of file otbStreamingImageVirtualWriter.h.
typedef InputImageType::Pointer otb::StreamingImageVirtualWriter< TInputImage >::InputImagePointer |
Definition at line 77 of file otbStreamingImageVirtualWriter.h.
typedef InputImageType::RegionType otb::StreamingImageVirtualWriter< TInputImage >::InputImageRegionType |
Definition at line 78 of file otbStreamingImageVirtualWriter.h.
typedef TInputImage otb::StreamingImageVirtualWriter< TInputImage >::InputImageType |
Some typedefs for the input and output.
Definition at line 73 of file otbStreamingImageVirtualWriter.h.
typedef itk::SmartPointer<Self> otb::StreamingImageVirtualWriter< TInputImage >::Pointer |
Definition at line 66 of file otbStreamingImageVirtualWriter.h.
typedef StreamingImageVirtualWriter otb::StreamingImageVirtualWriter< TInputImage >::Self |
Standard class typedefs.
Definition at line 64 of file otbStreamingImageVirtualWriter.h.
typedef StreamingManagerType::Pointer otb::StreamingImageVirtualWriter< TInputImage >::StreamingManagerPointerType |
Definition at line 83 of file otbStreamingImageVirtualWriter.h.
typedef StreamingManager<InputImageType> otb::StreamingImageVirtualWriter< TInputImage >::StreamingManagerType |
Streaming manager base class pointer
Definition at line 82 of file otbStreamingImageVirtualWriter.h.
typedef itk::ImageToImageFilter<TInputImage, TInputImage> otb::StreamingImageVirtualWriter< TInputImage >::Superclass |
Definition at line 65 of file otbStreamingImageVirtualWriter.h.
|
protected |
Definition at line 41 of file otbStreamingImageVirtualWriter.hxx.
References otb::StreamingImageVirtualWriter< TInputImage >::SetAutomaticAdaptativeStreaming().
|
overrideprotected |
Definition at line 50 of file otbStreamingImageVirtualWriter.hxx.
|
privatedelete |
virtual::itk::LightObject::Pointer otb::StreamingImageVirtualWriter< TInputImage >::CreateAnother | ( | void | ) | const |
|
overrideprotected |
Prepare all the outputs. This may deallocate previous bulk data.
Tell all Observers that the filter is starting
Grab the input
Determine of number of pieces to divide the input. This will be the minimum of what the user specified via SetNumberOfDivisionsStrippedStreaming() and what the Splitter thinks is a reasonable value.
Register to the ProgressEvent of the source filter
Loop over the number of pieces, execute the upstream pipeline on each piece, and copy the results into the output image.
If we ended due to aborting, push the progress up to 1.0 (since it probably didn't end there)
Now we have to mark the data as up to data.
Release any inputs if marked for release
Definition at line 156 of file otbStreamingImageVirtualWriter.hxx.
References otb::Logger::Instance(), and otbLogMacro.
|
overrideprotected |
Definition at line 140 of file otbStreamingImageVirtualWriter.hxx.
|
override |
This override doesn't return a const ref on the actual boolean
Definition at line 277 of file otbStreamingImageVirtualWriter.hxx.
References otb::Utils::FalseConstant, and otb::Utils::TrueConstant.
|
virtual |
Run-time type information (and related methods).
|
inline |
Return the StreamingManager object responsible for dividing the region to write
Definition at line 90 of file otbStreamingImageVirtualWriter.h.
|
static |
Method for creation through the object factory.
|
inlineprivate |
Definition at line 165 of file otbStreamingImageVirtualWriter.h.
|
privatedelete |
|
overrideprotected |
Definition at line 55 of file otbStreamingImageVirtualWriter.hxx.
|
override |
Prepare all the outputs. This may deallocate previous bulk data.
Tell all Observers that the filter is starting
Grab the input
Determine of number of pieces to divide the input. This will be the minimum of what the user specified via SetNumberOfDivisionsStrippedStreaming() and what the Splitter thinks is a reasonable value.
Register to the ProgressEvent of the source filter
Loop over the number of pieces, execute the upstream pipeline on each piece, and copy the results into the output image.
If we ended due to aborting, push the progress up to 1.0 (since it probably didn't end there)
Now we have to mark the data as up to data.
Release any inputs if marked for release
Definition at line 288 of file otbStreamingImageVirtualWriter.hxx.
void otb::StreamingImageVirtualWriter< TInputImage >::SetAutomaticAdaptativeStreaming | ( | unsigned int | availableRAM = 0 , |
double | bias = 1.0 |
||
) |
Set the streaming mode to 'adaptative' and configure the number of MB available. The actual number of divisions is computed automatically by estimating the memory consumption of the pipeline. Tiles will try to match the input file tile scheme. Setting the availableRAM parameter to 0 means that the available RAM is set from the CMake configuration option
Definition at line 121 of file otbStreamingImageVirtualWriter.hxx.
Referenced by otb::StreamingImageVirtualWriter< TInputImage >::StreamingImageVirtualWriter().
void otb::StreamingImageVirtualWriter< TInputImage >::SetAutomaticStrippedStreaming | ( | unsigned int | availableRAM = 0 , |
double | bias = 1.0 |
||
) |
Set the streaming mode to 'stripped' and configure the number of MB available. The actual number of divisions is computed automatically by estimating the memory consumption of the pipeline. Setting the availableRAM parameter to 0 means that the available RAM is set from the CMake configuration option
Definition at line 91 of file otbStreamingImageVirtualWriter.hxx.
void otb::StreamingImageVirtualWriter< TInputImage >::SetAutomaticTiledStreaming | ( | unsigned int | availableRAM = 0 , |
double | bias = 1.0 |
||
) |
Set the streaming mode to 'tiled' and configure the number of MB available. The actual number of divisions is computed automatically by estimating the memory consumption of the pipeline. Tiles will be square. Setting the availableRAM parameter to 0 means that the available RAM is set from the CMake configuration option
Definition at line 111 of file otbStreamingImageVirtualWriter.hxx.
void otb::StreamingImageVirtualWriter< TInputImage >::SetNumberOfDivisionsStrippedStreaming | ( | unsigned int | nbDivisions | ) |
Set the streaming mode to 'stripped' and configure the number of strips which will be used to stream the image
Definition at line 61 of file otbStreamingImageVirtualWriter.hxx.
void otb::StreamingImageVirtualWriter< TInputImage >::SetNumberOfDivisionsTiledStreaming | ( | unsigned int | nbDivisions | ) |
Set the streaming mode to 'tiled' and configure the number of tiles which will be used to stream the image
Definition at line 71 of file otbStreamingImageVirtualWriter.hxx.
void otb::StreamingImageVirtualWriter< TInputImage >::SetNumberOfLinesStrippedStreaming | ( | unsigned int | nbLinesPerStrip | ) |
Set the streaming mode to 'stripped' and configure the number of strips which will be used to stream the image
Definition at line 81 of file otbStreamingImageVirtualWriter.hxx.
|
inline |
Set a user-specific implementation of StreamingManager used to divide the largest possible region in several divisions
Definition at line 97 of file otbStreamingImageVirtualWriter.h.
void otb::StreamingImageVirtualWriter< TInputImage >::SetTileDimensionTiledStreaming | ( | unsigned int | tileDimension | ) |
Set the streaming mode to 'tiled' and configure the dimension of the tiles in pixels for each dimension (square tiles will be generated)
Definition at line 101 of file otbStreamingImageVirtualWriter.hxx.
|
override |
Override Update() from ProcessObject This filter does not produce an output
Definition at line 131 of file otbStreamingImageVirtualWriter.hxx.
|
inlineprivate |
Definition at line 181 of file otbStreamingImageVirtualWriter.h.
|
static |
Dimension of input image.
Definition at line 86 of file otbStreamingImageVirtualWriter.h.
|
private |
Definition at line 187 of file otbStreamingImageVirtualWriter.h.
|
private |
Definition at line 188 of file otbStreamingImageVirtualWriter.h.
|
private |
Definition at line 192 of file otbStreamingImageVirtualWriter.h.
|
private |
Lock to ensure thread-safety (added for the AbortGenerateData flag)
Definition at line 196 of file otbStreamingImageVirtualWriter.h.
|
private |
Definition at line 186 of file otbStreamingImageVirtualWriter.h.
|
private |
Definition at line 193 of file otbStreamingImageVirtualWriter.h.
|
private |
Definition at line 190 of file otbStreamingImageVirtualWriter.h.