OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
otb::MultiImageFileWriter Class Reference

#include <otbMultiImageFileWriter.h>

+ Inheritance diagram for otb::MultiImageFileWriter:
+ Collaboration diagram for otb::MultiImageFileWriter:

Classes

class  Sink
 
class  SinkBase
 

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::ImageBase< 2 > ImageBaseType
 
typedef ImageBaseType::IndexType IndexType
 
typedef ImageBaseType::IndexValueType IndexValueType
 
typedef itk::SmartPointer< SelfPointer
 
typedef ImageBaseType::RegionType RegionType
 
typedef MultiImageFileWriter Self
 
typedef ImageBaseType::SizeType SizeType
 
typedef ImageBaseType::SizeValueType SizeValueType
 
typedef itk::ProcessObject Superclass
 

Public Member Functions

template<class TImage >
void AddInputImage (const TImage *inputPtr, const std::string &fileName)
 
template<class TWriter >
void AddInputWriter (typename TWriter::Pointer writer)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
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 SetTileDimensionTiledStreaming (unsigned int tileDimension)
 
virtual void Update () override
 
virtual void UpdateOutputData (itk::DataObject *) override
 
virtual void UpdateOutputInformation () override
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

virtual void GenerateData (void) override
 
virtual void GenerateInputRequestedRegion () override
 
virtual RegionType GetStreamRegion (int inputIndex)
 
virtual void InitializeStreaming ()
 
 MultiImageFileWriter ()
 
void ObserveSourceFilterProgress (itk::Object *object, const itk::EventObject &event)
 
void operator= (const MultiImageFileWriter &)=delete
 
void ResetAllRequestedRegions (ImageBaseType *imagePtr)
 
void UpdateFilterProgress ()
 
virtual ~MultiImageFileWriter ()
 

Private Types

typedef otb::Image< unsigned char, 2 > FakeOutputType
 
typedef std::vector< std::shared_ptr< SinkBase > > SinkListType
 
typedef StreamingManager< FakeOutputTypeStreamingManagerType
 

Private Attributes

unsigned int m_CurrentDivision
 
float m_DivisionProgress
 
bool m_IsObserving
 
unsigned int m_NumberOfDivisions
 
unsigned long m_ObserverID
 
SinkListType m_SinkList
 
StreamingManagerType::Pointer m_StreamingManager
 
std::vector< RegionTypem_StreamRegionList
 

Detailed Description

Streams a pipeline with multiple outputs. It writes each output to a file. Inputs are connected to the writer using the AddInputImage method. The type of streaming can be chosen. Each output may have a different size. When the user gives a number of lines per strip or a tile size, the value is interpreted on the first input to deduce the number of streams. This number of streams is then used to split the other inputs.

Definition at line 47 of file otbMultiImageFileWriter.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::MultiImageFileWriter::ConstPointer

Definition at line 54 of file otbMultiImageFileWriter.h.

◆ FakeOutputType

typedef otb::Image<unsigned char, 2> otb::MultiImageFileWriter::FakeOutputType
private

Definition at line 196 of file otbMultiImageFileWriter.h.

◆ ImageBaseType

typedef itk::ImageBase<2> otb::MultiImageFileWriter::ImageBaseType

Public typedefs

Definition at line 58 of file otbMultiImageFileWriter.h.

◆ IndexType

typedef ImageBaseType::IndexType otb::MultiImageFileWriter::IndexType

Definition at line 63 of file otbMultiImageFileWriter.h.

◆ IndexValueType

typedef ImageBaseType::IndexValueType otb::MultiImageFileWriter::IndexValueType

Definition at line 64 of file otbMultiImageFileWriter.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::MultiImageFileWriter::Pointer

Definition at line 53 of file otbMultiImageFileWriter.h.

◆ RegionType

typedef ImageBaseType::RegionType otb::MultiImageFileWriter::RegionType

Definition at line 62 of file otbMultiImageFileWriter.h.

◆ Self

Standard class typedefs.

Definition at line 51 of file otbMultiImageFileWriter.h.

◆ SinkListType

typedef std::vector<std::shared_ptr<SinkBase> > otb::MultiImageFileWriter::SinkListType
private

The list of inputs and their associated parameters, built using AddInput

Definition at line 285 of file otbMultiImageFileWriter.h.

◆ SizeType

typedef ImageBaseType::SizeType otb::MultiImageFileWriter::SizeType

Definition at line 65 of file otbMultiImageFileWriter.h.

◆ SizeValueType

typedef ImageBaseType::SizeValueType otb::MultiImageFileWriter::SizeValueType

Definition at line 66 of file otbMultiImageFileWriter.h.

◆ StreamingManagerType

Definition at line 197 of file otbMultiImageFileWriter.h.

◆ Superclass

typedef itk::ProcessObject otb::MultiImageFileWriter::Superclass

Definition at line 52 of file otbMultiImageFileWriter.h.

Constructor & Destructor Documentation

◆ MultiImageFileWriter()

otb::MultiImageFileWriter::MultiImageFileWriter ( )
protected

◆ ~MultiImageFileWriter()

virtual otb::MultiImageFileWriter::~MultiImageFileWriter ( )
inlineprotectedvirtual

Definition at line 148 of file otbMultiImageFileWriter.h.

Member Function Documentation

◆ AddInputImage()

template<class TImage >
void otb::MultiImageFileWriter::AddInputImage ( const TImage *  inputPtr,
const std::string &  fileName 
)

Connect a new input to the multi-writer. Only the input pointer is required. If the filename list is empty, streaming will occur without writing. If the filename list contains more than one element, then the output will be divided into this number of granule files. The resolution factor specifies the ratio between the height of this image and the height of a reference image. The number of lines per strip class parameter will be modified according to this factor, so that images with different resolutions can be streamed together. For example, use 1.0 for a 10m pixels image, 0.5 for a 20m pixels image, and specify the number of lines per strip according to the 10m pixels image. You may specify top and bottom margins that will be removed from the input image, according to its largest possible region.

Definition at line 240 of file otbMultiImageFileWriter.hxx.

References m_SinkList.

◆ AddInputWriter()

template<class TWriter >
void otb::MultiImageFileWriter::AddInputWriter ( typename TWriter::Pointer  writer)

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::MultiImageFileWriter::CreateAnother ( void  ) const

◆ GenerateData()

virtual void otb::MultiImageFileWriter::GenerateData ( void  )
overrideprotectedvirtual

GenerateData calls the Write method for each connected input

◆ GenerateInputRequestedRegion()

virtual void otb::MultiImageFileWriter::GenerateInputRequestedRegion ( )
overrideprotectedvirtual

GenerateInputRequestedRegion can predict approximate input regions based on the requested region of the fake output. Only useful for pipeline memory print estimation

◆ GetNameOfClass()

virtual const char* otb::MultiImageFileWriter::GetNameOfClass ( ) const
virtual

◆ GetStreamRegion()

virtual RegionType otb::MultiImageFileWriter::GetStreamRegion ( int  inputIndex)
protectedvirtual

Returns the current stream region of the given input

◆ InitializeStreaming()

virtual void otb::MultiImageFileWriter::InitializeStreaming ( )
protectedvirtual

Computes the number of divisions

◆ New()

static Pointer otb::MultiImageFileWriter::New ( )
static

◆ ObserveSourceFilterProgress()

void otb::MultiImageFileWriter::ObserveSourceFilterProgress ( itk::Object *  object,
const itk::EventObject &  event 
)
inlineprotected

Definition at line 174 of file otbMultiImageFileWriter.h.

◆ operator=()

void otb::MultiImageFileWriter::operator= ( const MultiImageFileWriter )
protecteddelete

◆ ResetAllRequestedRegions()

void otb::MultiImageFileWriter::ResetAllRequestedRegions ( ImageBaseType imagePtr)
protected

Goes up the pipeline starting at imagePtr, resetting all requested regions to a null region. This may be useful when mixing inputs of different resolutions.

◆ SetAutomaticAdaptativeStreaming()

void otb::MultiImageFileWriter::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

Referenced by AddInputWriter().

◆ SetAutomaticStrippedStreaming()

void otb::MultiImageFileWriter::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. The bias parameter is a multiplier applied on the estimated memory size of the pipeline and can be used to fine tune the potential gap between estimated memory and actual memory used, which can happen because of composite filters for example

Referenced by AddInputWriter().

◆ SetAutomaticTiledStreaming()

void otb::MultiImageFileWriter::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 The bias parameter is a multiplier applied on the estimated memory size of the pipeline and can be used to fine tune the potential gap between estimated memory and actual memory used, which can happen because of composite filters for example

Referenced by AddInputWriter().

◆ SetNumberOfDivisionsStrippedStreaming()

void otb::MultiImageFileWriter::SetNumberOfDivisionsStrippedStreaming ( unsigned int  nbDivisions)

Set the streaming mode to 'stripped' and configure the number of strips which will be used to stream the image

Referenced by AddInputWriter().

◆ SetNumberOfDivisionsTiledStreaming()

void otb::MultiImageFileWriter::SetNumberOfDivisionsTiledStreaming ( unsigned int  nbDivisions)

Set the streaming mode to 'tiled' and configure the number of tiles which will be used to stream the image

Referenced by AddInputWriter().

◆ SetNumberOfLinesStrippedStreaming()

void otb::MultiImageFileWriter::SetNumberOfLinesStrippedStreaming ( unsigned int  nbLinesPerStrip)

Set the streaming mode to 'stripped' and configure the number of strips which will be used to stream the image with respect to a number of line per strip

Referenced by AddInputWriter().

◆ SetTileDimensionTiledStreaming()

void otb::MultiImageFileWriter::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)

Referenced by AddInputWriter().

◆ Update()

virtual void otb::MultiImageFileWriter::Update ( )
inlineoverridevirtual

Definition at line 140 of file otbMultiImageFileWriter.h.

◆ UpdateFilterProgress()

void otb::MultiImageFileWriter::UpdateFilterProgress ( )
inlineprotected

Definition at line 190 of file otbMultiImageFileWriter.h.

◆ UpdateOutputData()

virtual void otb::MultiImageFileWriter::UpdateOutputData ( itk::DataObject *  )
overridevirtual

◆ UpdateOutputInformation()

virtual void otb::MultiImageFileWriter::UpdateOutputInformation ( )
overridevirtual

Member Data Documentation

◆ m_CurrentDivision

unsigned int otb::MultiImageFileWriter::m_CurrentDivision
private

Definition at line 203 of file otbMultiImageFileWriter.h.

◆ m_DivisionProgress

float otb::MultiImageFileWriter::m_DivisionProgress
private

Definition at line 204 of file otbMultiImageFileWriter.h.

◆ m_IsObserving

bool otb::MultiImageFileWriter::m_IsObserving
private

Definition at line 206 of file otbMultiImageFileWriter.h.

◆ m_NumberOfDivisions

unsigned int otb::MultiImageFileWriter::m_NumberOfDivisions
private

Definition at line 202 of file otbMultiImageFileWriter.h.

◆ m_ObserverID

unsigned long otb::MultiImageFileWriter::m_ObserverID
private

Definition at line 207 of file otbMultiImageFileWriter.h.

◆ m_SinkList

SinkListType otb::MultiImageFileWriter::m_SinkList
private

Definition at line 286 of file otbMultiImageFileWriter.h.

Referenced by AddInputImage(), and AddInputWriter().

◆ m_StreamingManager

StreamingManagerType::Pointer otb::MultiImageFileWriter::m_StreamingManager
private

Streaming manager used for the N inputs

Definition at line 199 of file otbMultiImageFileWriter.h.

Referenced by AddInputWriter().

◆ m_StreamRegionList

std::vector<RegionType> otb::MultiImageFileWriter::m_StreamRegionList
private

Definition at line 288 of file otbMultiImageFileWriter.h.


The documentation for this class was generated from the following files: