OTB  6.7.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 Self
ConstPointer
 
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 Types inherited from itk::ProcessObject
typedef SmartPointer< const SelfConstPointer
 
typedef
DataObject::DataObjectIdentifierType 
DataObjectIdentifierType
 
typedef DataObject::Pointer DataObjectPointer
 
typedef std::vector
< DataObjectPointer
DataObjectPointerArray
 
typedef
DataObjectPointerArray::size_type 
DataObjectPointerArraySizeType
 
typedef std::vector
< DataObjectIdentifierType
NameArray
 
typedef SmartPointer< SelfPointer
 
typedef ProcessObject Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

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
 
template<class TImage >
void AddInputImage (const TImage *inputPtr, const std::string &fileName)
 
template<class TWriter >
void AddInputWriter (const TWriter *writer)
 
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOff ()
 
virtual void AbortGenerateDataOn ()
 
virtual void EnlargeOutputRequestedRegion (DataObject *)
 
virtual const bool & GetAbortGenerateData () const
 
DataObjectPointerArray GetIndexedInputs ()
 
DataObjectPointerArray GetIndexedOutputs ()
 
NameArray GetInputNames () const
 
DataObjectPointerArray GetInputs ()
 
MultiThreader * GetMultiThreader () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
 
DataObjectPointerArraySizeType GetNumberOfInputs () const
 
DataObjectPointerArraySizeType GetNumberOfOutputs () const
 
virtual const ThreadIdTypeGetNumberOfThreads () const
 
virtual
DataObjectPointerArraySizeType 
GetNumberOfValidRequiredInputs () const
 
NameArray GetOutputNames () const
 
DataObjectPointerArray GetOutputs ()
 
virtual const float & GetProgress () const
 
virtual const bool & GetReleaseDataBeforeUpdateFlag () const
 
virtual bool GetReleaseDataFlag () const
 
NameArray GetRequiredInputNames () const
 
bool HasInput (const DataObjectIdentifierType &key) const
 
bool HasOutput (const DataObjectIdentifierType &key) const
 
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
 
virtual DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx)
 
virtual void PrepareOutputs ()
 
virtual void PropagateRequestedRegion (DataObject *output)
 
virtual void ReleaseDataBeforeUpdateFlagOff ()
 
virtual void ReleaseDataBeforeUpdateFlagOn ()
 
void ReleaseDataFlagOff ()
 
void ReleaseDataFlagOn ()
 
virtual void ResetPipeline ()
 
virtual void SetAbortGenerateData (bool _arg)
 
virtual void SetNumberOfThreads (ThreadIdType _arg)
 
void SetProgress (float progress)
 
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
 
virtual void SetReleaseDataFlag (bool flag)
 
virtual void UpdateLargestPossibleRegion ()
 
void UpdateProgress (float progress)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
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 ()
 
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
 
virtual void AddOutput (DataObject *output)
 
bool AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
bool AddRequiredInputName (const DataObjectIdentifierType &)
 
virtual void CacheInputReleaseDataFlags ()
 
virtual void GenerateOutputInformation ()
 
virtual void GenerateOutputRequestedRegion (DataObject *output)
 
const DataObjectGetInput (const DataObjectIdentifierType &key) const
 
DataObjectGetInput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetInput (const DataObjectIdentifierType &key)
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredInputs () const
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredOutputs () const
 
DataObjectGetOutput (const DataObjectIdentifierType &key)
 
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
 
DataObjectGetOutput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetOutput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetPrimaryInput ()
 
const DataObjectGetPrimaryInput () const
 
virtual const char * GetPrimaryInputName (void) const
 
DataObjectGetPrimaryOutput ()
 
const DataObjectGetPrimaryOutput () const
 
virtual const char * GetPrimaryOutputName (void) const
 
bool IsIndexedInputName (const DataObjectIdentifierType &) const
 
bool IsIndexedOutputName (const DataObjectIdentifierType &) const
 
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 
 itkLegacyMacro (virtual void RemoveInput(DataObject *input))
 
 itkLegacyMacro (void SetNumberOfInputs(DataObjectPointerArraySizeType num))
 
 itkLegacyMacro (virtual void RemoveOutput(DataObject *output))
 
 itkLegacyMacro (void SetNumberOfOutputs(DataObjectPointerArraySizeType num))
 
DataObjectPointerArraySizeType MakeIndexFromInputName (const DataObjectIdentifierType &name) const
 
DataObjectPointerArraySizeType MakeIndexFromOutputName (const DataObjectIdentifierType &name) const
 
DataObjectIdentifierType MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const
 
DataObjectIdentifierType MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const
 
virtual void PopBackInput ()
 
virtual void PopFrontInput ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
 ProcessObject ()
 
virtual void PropagateResetPipeline ()
 
virtual void PushBackInput (const DataObject *input)
 
virtual void PushFrontInput (const DataObject *input)
 
virtual void ReleaseInputs ()
 
virtual void RemoveInput (const DataObjectIdentifierType &key)
 
virtual void RemoveInput (DataObjectPointerArraySizeType)
 
virtual void RemoveOutput (const DataObjectIdentifierType &key)
 
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
 
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
 
virtual void RestoreInputReleaseDataFlags ()
 
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
 
virtual void SetNthInput (DataObjectPointerArraySizeType num, DataObject *input)
 
virtual void SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output)
 
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
 
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
 
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
 
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
 
virtual void SetOutput (const DataObjectIdentifierType &key, DataObject *output)
 
virtual void SetPrimaryInput (DataObject *input)
 
virtual void SetPrimaryInputName (const DataObjectIdentifierType &key)
 
virtual void SetPrimaryOutput (DataObject *output)
 
virtual void SetPrimaryOutputName (const DataObjectIdentifierType &key)
 
void SetRequiredInputNames (const NameArray &)
 
virtual void VerifyInputInformation ()
 
virtual void VerifyPreconditions ()
 
 ~ProcessObject ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Types

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

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
 

Additional Inherited Members

- Protected Attributes inherited from itk::ProcessObject
TimeStamp m_OutputInformationMTime
 
bool m_Updating
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

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

Definition at line 54 of file otbMultiImageFileWriter.h.

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

Definition at line 208 of file otbMultiImageFileWriter.h.

Public typedefs

Definition at line 58 of file otbMultiImageFileWriter.h.

Definition at line 63 of file otbMultiImageFileWriter.h.

Definition at line 64 of file otbMultiImageFileWriter.h.

Definition at line 53 of file otbMultiImageFileWriter.h.

Definition at line 62 of file otbMultiImageFileWriter.h.

Standard class typedefs.

Definition at line 51 of file otbMultiImageFileWriter.h.

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

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

Definition at line 274 of file otbMultiImageFileWriter.h.

Definition at line 65 of file otbMultiImageFileWriter.h.

Definition at line 66 of file otbMultiImageFileWriter.h.

Definition at line 209 of file otbMultiImageFileWriter.h.

Definition at line 52 of file otbMultiImageFileWriter.h.

Constructor & Destructor Documentation

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

Definition at line 162 of file otbMultiImageFileWriter.h.

Member Function Documentation

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

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. It 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 129 of file otbMultiImageFileWriter.h.

template<class TWriter >
void otb::MultiImageFileWriter::AddInputWriter ( const TWriter *  writer)
inline

Add a new ImageFileWriter to the multi-writer. This is an alternative method when you already have an instanciated writer.

Definition at line 142 of file otbMultiImageFileWriter.h.

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

Reimplemented from itk::Object.

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

GenerateData calls the Write method for each connected input

Reimplemented from itk::ProcessObject.

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

Reimplemented from itk::ProcessObject.

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

Reimplemented from itk::ProcessObject.

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

Returns the current stream region of the given input

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

Computes the number of divisions

static Pointer otb::MultiImageFileWriter::New ( )
static
void otb::MultiImageFileWriter::ObserveSourceFilterProgress ( itk::Object object,
const itk::EventObject event 
)
inlineprotected

Definition at line 186 of file otbMultiImageFileWriter.h.

References itk::ProcessObject::GetProgress().

void otb::MultiImageFileWriter::operator= ( const MultiImageFileWriter )
protecteddelete
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.

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

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

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

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

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

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

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)

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

Reimplemented from itk::ProcessObject.

Definition at line 154 of file otbMultiImageFileWriter.h.

void otb::MultiImageFileWriter::UpdateFilterProgress ( )
inlineprotected

Definition at line 202 of file otbMultiImageFileWriter.h.

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

Reimplemented from itk::ProcessObject.

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

Reimplemented from itk::ProcessObject.

Member Data Documentation

unsigned int otb::MultiImageFileWriter::m_CurrentDivision
private

Definition at line 215 of file otbMultiImageFileWriter.h.

float otb::MultiImageFileWriter::m_DivisionProgress
private

Definition at line 216 of file otbMultiImageFileWriter.h.

bool otb::MultiImageFileWriter::m_IsObserving
private

Definition at line 218 of file otbMultiImageFileWriter.h.

unsigned int otb::MultiImageFileWriter::m_NumberOfDivisions
private

Definition at line 214 of file otbMultiImageFileWriter.h.

unsigned long otb::MultiImageFileWriter::m_ObserverID
private

Definition at line 219 of file otbMultiImageFileWriter.h.

SinkListType otb::MultiImageFileWriter::m_SinkList
private

Definition at line 275 of file otbMultiImageFileWriter.h.

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

Streaming manager used for the N inputs

Definition at line 211 of file otbMultiImageFileWriter.h.

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

Definition at line 277 of file otbMultiImageFileWriter.h.


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