OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::ObjectListSource< TOutputList > Class Template Reference

#include <otbObjectListSource.h>

+ Inheritance diagram for otb::ObjectListSource< TOutputList >:
+ Collaboration diagram for otb::ObjectListSource< TOutputList >:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::DataObject::Pointer DataObjectPointer
 
typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
typedef TOutputList::Pointer OutputListPointer
 
typedef TOutputList OutputListType
 
typedef itk::SmartPointer< SelfPointer
 
typedef ObjectListSource Self
 
typedef itk::ProcessObject Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 
DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
void GraftOutput (itk::DataObject *graft)
 
void GraftNthOutput (DataObjectPointerArraySizeType idx, itk::DataObject *graft)
 
OutputListTypeGetOutput (void)
 
OutputListTypeGetOutput (DataObjectPointerArraySizeType idx)
 
 ObjectListSource ()
 
 ~ObjectListSource () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual void AllocateOutputs ()
 
void GenerateData (void) override
 
 ObjectListSource (const Self &)=delete
 
void operator= (const Self &)=delete
 

Detailed Description

template<class TOutputList>
class otb::ObjectListSource< TOutputList >

Base class for all process objects that output ObjectList data.

ObjectListSource is the base class for all process objects that output ObjectList data. Specifically, this class defines the GetOutput() method that returns a pointer to the output ObjectList.

Be aware that this class is templated over the list type, not the object type. It will be typically something like otb::ObjectList<ObjectType>. This is to enable the use of class derived from ObjectList or other implementations.

Definition at line 47 of file otbObjectListSource.h.

Member Typedef Documentation

◆ ConstPointer

template<class TOutputList >
typedef itk::SmartPointer<const Self> otb::ObjectListSource< TOutputList >::ConstPointer

Definition at line 54 of file otbObjectListSource.h.

◆ DataObjectPointer

template<class TOutputList >
typedef itk::DataObject::Pointer otb::ObjectListSource< TOutputList >::DataObjectPointer

Definition at line 67 of file otbObjectListSource.h.

◆ DataObjectPointerArraySizeType

template<class TOutputList >
typedef itk::ProcessObject::DataObjectPointerArraySizeType otb::ObjectListSource< TOutputList >::DataObjectPointerArraySizeType

Some typedefs.

Definition at line 60 of file otbObjectListSource.h.

◆ OutputListPointer

template<class TOutputList >
typedef TOutputList::Pointer otb::ObjectListSource< TOutputList >::OutputListPointer

Definition at line 65 of file otbObjectListSource.h.

◆ OutputListType

template<class TOutputList >
typedef TOutputList otb::ObjectListSource< TOutputList >::OutputListType

Definition at line 64 of file otbObjectListSource.h.

◆ Pointer

template<class TOutputList >
typedef itk::SmartPointer<Self> otb::ObjectListSource< TOutputList >::Pointer

Definition at line 53 of file otbObjectListSource.h.

◆ Self

template<class TOutputList >
typedef ObjectListSource otb::ObjectListSource< TOutputList >::Self

Standard class typedefs.

Definition at line 51 of file otbObjectListSource.h.

◆ Superclass

template<class TOutputList >
typedef itk::ProcessObject otb::ObjectListSource< TOutputList >::Superclass

Definition at line 52 of file otbObjectListSource.h.

Constructor & Destructor Documentation

◆ ObjectListSource() [1/2]

template<class TOutputList >
otb::ObjectListSource< TOutputList >::ObjectListSource
protected

Constructor

Definition at line 35 of file otbObjectListSource.hxx.

◆ ~ObjectListSource()

template<class TOutputList >
otb::ObjectListSource< TOutputList >::~ObjectListSource ( )
inlineoverrideprotected

Destructor

Definition at line 180 of file otbObjectListSource.h.

◆ ObjectListSource() [2/2]

template<class TOutputList >
otb::ObjectListSource< TOutputList >::ObjectListSource ( const Self )
privatedelete

Make a DataObject of the correct type to used as the specified output. Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a SmartPointer to a DataObject. If a subclass of ImageSource has multiple outputs of different types, then that class must provide an implementation of MakeOutput().

Member Function Documentation

◆ AllocateOutputs()

template<class TOutputList >
void otb::ObjectListSource< TOutputList >::AllocateOutputs
protectedvirtual

Ensure that the output lists are cleared before processing

Definition at line 111 of file otbObjectListSource.hxx.

◆ CreateAnother()

template<class TOutputList >
virtual::itk::LightObject::Pointer otb::ObjectListSource< TOutputList >::CreateAnother ( void  ) const

◆ GenerateData()

template<class TOutputList >
void otb::ObjectListSource< TOutputList >::GenerateData ( void  )
overrideprotected

ObjectListSource can be implemented as a multithreaded filter. Therefore, this implementation provides a ThreadedGenerateData() routine which is called for each processing thread. The output image data is allocated automatically by the superclass prior to calling ThreadedGenerateData(). ThreadedGenerateData can only write to the portion of the output image specified by the parameter "outputRegionForThread"

See also
ImageToImageFilter::ThreadedGenerateData(), ImageToImageFilter::GenerateData()

GenerateData

Definition at line 127 of file otbObjectListSource.hxx.

◆ GetNameOfClass()

template<class TOutputList >
virtual const char* otb::ObjectListSource< TOutputList >::GetNameOfClass ( ) const
virtual

◆ GetOutput() [1/2]

template<class TOutputList >
ObjectListSource< TOutputList >::OutputListType * otb::ObjectListSource< TOutputList >::GetOutput ( DataObjectPointerArraySizeType  idx)

Make a DataObject of the correct type to used as the specified output. Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a SmartPointer to a DataObject. If a subclass of ImageSource has multiple outputs of different types, then that class must provide an implementation of MakeOutput().

Definition at line 72 of file otbObjectListSource.hxx.

◆ GetOutput() [2/2]

template<class TOutputList >
ObjectListSource< TOutputList >::OutputListType * otb::ObjectListSource< TOutputList >::GetOutput ( void  )

Get the output data of this process object. The output of this function is not valid until an appropriate Update() method has been called, either explicitly or implicitly. Both the filter itself and the data object have Update() methods, and both methods update the data. Here are three ways to use GetOutput() and make sure the data is valid. In these examples, image is a pointer to some Image object, and the particular ProcessObjects involved are filters. The same examples apply to non-image (e.g. Mesh) data as well.

anotherFilter->SetInput( someFilter->GetOutput() );
anotherFilter->Update();

In this situation, someFilter and anotherFilter are said to constitute a pipeline.

image = someFilter->GetOutput();
image->Update();
someFilter->Update();
image = someFilter->GetOutput();

(In the above example, the two lines of code can be in either order.)

Note that Update() is not called automatically except within a pipeline as in the first example. When streaming (using a StreamingImageFilter) is activated, it may be more efficient to use a pipeline than to call Update() once for each filter in turn.

For an image, the data generated is for the requested Region, which can be set using ImageBase::SetRequestedRegion(). By default, the largest possible region is requested.

Definition at line 58 of file otbObjectListSource.hxx.

◆ GraftNthOutput()

template<class TOutputList >
void otb::ObjectListSource< TOutputList >::GraftNthOutput ( DataObjectPointerArraySizeType  idx,
itk::DataObject *  graft 
)

Graft the specified data object onto this ProcessObject's idx'th output. This is the similar to GraftOutput method except is allows you specify which output is affected. The specified index must be a valid output number (less than ProcessObject::GetNumberOfOutputs()). See the GraftOutput for general usage information.

Definition at line 90 of file otbObjectListSource.hxx.

◆ GraftOutput()

template<class TOutputList >
void otb::ObjectListSource< TOutputList >::GraftOutput ( itk::DataObject *  graft)

Graft the specified DataObject onto this ProcessObject's output. This method grabs a handle to the specified DataObject's path data to use as its output's own path data. It also copies the region ivars (RequestedRegion, BufferedRegion, LargestPossibleRegion) and meta-data (Spacing, Origin) from the specified data object into this filter's output data object. Most importantly, however, it leaves the Source ivar untouched so the original pipeline routing is intact. This method is used when a process object is implemented using a mini-pipeline which is defined in its GenerateData() method. The usage is:

// setup the mini-pipeline to process the input to this filter
firstFilterInMiniPipeline->SetInput( this->GetInput() );
// setup the mini-pipeline to calculate the correct regions
// and write to the appropriate bulk data block
lastFilterInMiniPipeline->GraftOutput( this->GetOutput() );
// execute the mini-pipeline
lastFilterInMiniPipeline->Update();
// graft the mini-pipeline output back onto this filter's output.
// this is needed to get the appropriate regions passed back.
this->GraftOutput( lastFilterInMiniPipeline->GetOutput() );

For proper pipeline execution, a filter using a mini-pipeline must implement the GeneratseInputRequestedRegion(), GenerateOutputRequestedRegion(), GenerateOutputInformation() and EnlargeOutputRequestedRegion() methods as necessary to reflect how the mini-pipeline will execute (in other words, the outer filter's pipeline mechanism must be consistent with what the mini-pipeline will do).

Definition at line 81 of file otbObjectListSource.hxx.

◆ MakeOutput()

template<class TOutputList >
ObjectListSource< TOutputList >::DataObjectPointer otb::ObjectListSource< TOutputList >::MakeOutput ( DataObjectPointerArraySizeType  idx)
override

Make a DataObject of the correct type to used as the specified output. Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a SmartPointer to a DataObject. If a subclass of ImageSource has multiple outputs of different types, then that class must provide an implementation of MakeOutput().

Definition at line 49 of file otbObjectListSource.hxx.

◆ New()

template<class TOutputList >
static Pointer otb::ObjectListSource< TOutputList >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TOutputList >
void otb::ObjectListSource< TOutputList >::operator= ( const Self )
privatedelete

Make a DataObject of the correct type to used as the specified output. Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a SmartPointer to a DataObject. If a subclass of ImageSource has multiple outputs of different types, then that class must provide an implementation of MakeOutput().

◆ PrintSelf()

template<class TOutputList >
void otb::ObjectListSource< TOutputList >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

PrintSelf Method

Definition at line 136 of file otbObjectListSource.hxx.


The documentation for this class was generated from the following files:
otb::ObjectListSource::GetOutput
OutputListType * GetOutput(void)
Definition: otbObjectListSource.hxx:58
otb::ObjectListSource::GraftOutput
void GraftOutput(itk::DataObject *graft)
Definition: otbObjectListSource.hxx:81