#include <itkProcessObject.h>
Inheritance diagram for itk::ProcessObject:
Public Types | |
typedef ProcessObject | Self |
typedef Object | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef DataObject::Pointer | DataObjectPointer |
typedef std::vector< DataObjectPointer > | DataObjectPointerArray |
Public Methods | |
virtual const char * | GetClassName () const |
virtual void | SetAbortGenerateData (bool _arg) |
itkGetConstReferenceMacro (AbortGenerateData, bool) | |
virtual void | AbortGenerateDataOn () |
virtual void | AbortGenerateDataOff () |
virtual void | SetProgress (float _arg) |
itkGetConstReferenceMacro (Progress, float) | |
void | UpdateProgress (float amount) |
virtual void | Update () |
virtual void | UpdateLargestPossibleRegion () |
virtual void | UpdateOutputInformation () |
virtual void | PropagateRequestedRegion (DataObject *output) |
virtual void | PrepareOutputs () |
virtual void | UpdateOutputData (DataObject *output) |
void | ComputeEstimatedPipelineMemorySize (DataObject *output, unsigned long size[3]) |
virtual void | ComputeEstimatedOutputMemorySize (DataObject *output, unsigned long *inputSize, unsigned long size[2]) |
virtual void | GenerateOutputInformation () |
virtual void | EnlargeOutputRequestedRegion (DataObject *) |
virtual void | GenerateInputRequestedRegion () |
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
virtual void | ResetPipeline () |
virtual DataObjectPointer | MakeOutput (unsigned int idx) |
MultiThreader * | GetMultiThreader () |
DataObjectPointerArray & | GetInputs () |
unsigned int | GetNumberOfInputs () const |
DataObjectPointerArray & | GetOutputs () |
unsigned int | GetNumberOfOutputs () const |
virtual void | SetReleaseDataFlag (bool flag) |
virtual bool | GetReleaseDataFlag () |
void | ReleaseDataFlagOn () |
void | ReleaseDataFlagOff () |
virtual void | SetNumberOfThreads (int _arg) |
itkGetConstReferenceMacro (NumberOfThreads, int) | |
Protected Methods | |
ProcessObject () | |
~ProcessObject () | |
void | PrintSelf (std::ostream &os, Indent indent) const |
virtual void | GenerateData () |
void | SetNumberOfInputs (unsigned int num) |
DataObject * | GetInput (unsigned int idx) |
void | SetNumberOfOutputs (unsigned int num) |
DataObject * | GetOutput (unsigned int idx) |
virtual void | PropagateResetPipeline () |
virtual void | SetNthInput (unsigned int num, DataObject *input) |
virtual void | AddInput (DataObject *input) |
virtual void | RemoveInput (DataObject *input) |
virtual void | SetNumberOfRequiredInputs (unsigned int _arg) |
itkGetConstReferenceMacro (NumberOfRequiredInputs, unsigned int) | |
virtual void | SetNthOutput (unsigned int num, DataObject *output) |
virtual void | AddOutput (DataObject *output) |
virtual void | RemoveOutput (DataObject *output) |
virtual void | SetNumberOfRequiredOutputs (unsigned int _arg) |
itkGetConstReferenceMacro (NumberOfRequiredOutputs, unsigned int) | |
Protected Attributes | |
bool | m_Updating |
TimeStamp | m_InformationTime |
Friends | |
class | DataObject |
ProcessObject is an abstract object that specifies behavior and interface of visualization network process objects (sources, filters, mappers). Source objects are creators of visualization data; filters input, process, and output image data; and mappers transform data into another form (like transforming coordinates or writing data to a file).
A major role of ProcessObject is to define the inputs and outputs of a filter. More than one input and/or output may exist for a given filter. Some classes (e.g., source objects or mapper objects) will not use inputs (the source) or outputs (mappers). In this case, the inputs or outputs is just ignored.
ProcessObject invokes the following events: Command::StartEvent, Command::EndEvent These are convenience events you can use for any purpose (e.g., debugging info, highlighting/notifying user interface, etc.) See Command and LightObject for information on using AddObserver.
Another event Command::ProgressEvent can be observed. Some filters invoke this event periodically during their execution (with the progress, parameter, the fraction of work done). The use is similar to that of StartEvent and EndEvent. Filters may also check their AbortGenerateData flag to determine whether to prematurally end their execution.
An important feature of subclasses of ProcessObject is that it is possible to control the memory-management model (i.e., retain output versus delete output data). If enabled the ReleaseDataFlag enables the deletion of the output data once the downstream process object finishes processing the data (please see text).
Subclasses of ProcessObject may override 4 of the methods of this class to control how a given filter may interact with the pipeline (dataflow). These methods are: GenerateOutputInformation(), EnlargeOutputRequestedRegion(), GenerateInputRequestedRegion(), and GenerateOutputRequestedRegion(). By overriding these methods, a filter can deviate from the base assumptions of the pipeline execution model.
Definition at line 78 of file itkProcessObject.h.
|
|
|
STL Array of SmartPointers to DataObjects Definition at line 94 of file itkProcessObject.h. |
|
|
|
|
|
|
|
|
|
|
Turn on and off the AbortGenerateData flag. |
|
Protected methods for setting inputs. Subclasses make use of them for setting input. |
|
Protected methods for setting outputs. Subclasses make use of them for getting output. |
|
The estimated size of the specified output after execution of this source is stored in the first size entry. The second size is the sum of all estimated output memory. The size of all inputs is given to help this filter in the estimation. All sizes are in kilobytes. |
|
Propagate the computation of the size of the pipeline. The first size is the size of the pipeline after this source has finished executing (and potentially freeing some input data). The second size is the size of the specified output. The third size is the maximum pipeline size encountered so far during this propagation. All sizes are in kilobytes. |
|
|
|
|
|
Given one output whose requested region has been set, how should the requested regions for the remaining outputs of the process object be set? By default, all the outputs are set to the same requested region. If a filter needs to produce different requested regions for each output, for instance an image processing filter producing several outputs at different resolutions, then that filter may override this method and set the requested regions appropriatedly. Note that a filter producing multiple outputs of different types is required to override this method. The default implementation can only correctly handle multiple outputs of the same type. Reimplemented in itk::MultiResolutionPyramidImageFilter< TInputImage, TOutputImage >, itk::RecursiveMultiResolutionPyramidImageFilter< TInputImage, TOutputImage >, itk::watershed::BoundaryResolver< TPixelType, TDimension >, itk::watershed::EquivalenceRelabeler< TScalarType, TImageDimension >, itk::watershed::Relabeler< TScalarType, TImageDimension >, itk::watershed::Segmenter< TInputImage >, itk::watershed::SegmentTreeGenerator< TScalarType >, itk::watershed::Relabeler< ScalarType, itkGetStaticConstMacro(ImageDimension)>, itk::watershed::Segmenter< InputImageType >, and itk::watershed::SegmentTreeGenerator< ScalarType >. |
|
|
|
Return an array with all the inputs of this process object. This is useful for tracing back in the pipeline to construct graphs etc. Definition at line 99 of file itkProcessObject.h. |
|
Return the multithreader used by this class. Definition at line 301 of file itkProcessObject.h. References HardConnectedComponentImageFilter::GenerateData(), and HardConnectedComponentImageFilter::PrintSelf(). |
|
Return an array with all the inputs of this process object. This is useful for tracing back in the pipeline to construct graphs etc. Definition at line 101 of file itkProcessObject.h. |
|
Return an array with all the outputs of this process object. This is useful for tracing forward in the pipeline to contruct graphs etc. Definition at line 110 of file itkProcessObject.h. |
|
|
Return an array with all the outputs of this process object. This is useful for tracing forward in the pipeline to contruct graphs etc. Definition at line 108 of file itkProcessObject.h. |
|
Turn on/off the flags to control whether the data belonging to the outputs of this ProcessObject are released after being used by a source by ProcessObjects further downstream. |
|
Protected methods for setting outputs. Subclasses make use of them for getting output. Reimplemented in itk::StreamingImageFilter< TInputImage, TOutputImage >. |
|
Protected methods for setting inputs. Subclasses make use of them for setting input. Reimplemented in itk::StreamingImageFilter< TInputImage, TOutputImage >. |
|
Get/Set the number of threads to create when executing. |
|
Get the execution progress of a process object. The progress is a floating number in [0,1] with 0 meaning no progress and 1 meaning the filter has completed execution. |
|
Get the AbortGenerateData flag for the process object. Process objects may handle premature termination of execution in different ways. |
|
|
An opportunity to Allocate/Deallocate bulk data. Some filters may wish to reuse the existing bulk data. The default implementation applies Initialize() to each Output. DataObject::Initialize() frees its bulk data. Reimplemented in itk::ImageSource< TOutputImage >, itk::ImageSource< TLevelSet >, itk::ImageSource< Functor::MakeJoin< TInputImage1, TInputImage2 >::ImageType >, itk::ImageSource< TInputImage >, itk::ImageSource< TImage >, itk::ImageSource< TClassifiedImage >, itk::ImageSource< TImageType >, itk::ImageSource< TInputImage1 >, itk::ImageSource< TTarget >, itk::ImageSource< TDeformationField >, itk::ImageSource< Image< TPixel, VImageDimension > >, and itk::ImageSource< TEigenValueImage >. |
|
|
Send the requested region information back up the pipeline (to the filters that preceed this one). Reimplemented in itk::VTKImageImport< TOutputImage >. |
|
Propagate a call to ResetPipeline() up the pipeline. Called only from DataObject. |
|
Turn on/off the flags to control whether the data belonging to the outputs of this ProcessObject are released after being used by a source by ProcessObjects further downstream. Definition at line 292 of file itkProcessObject.h. |
|
Turn on/off the flags to control whether the data belonging to the outputs of this ProcessObject are released after being used by a source by ProcessObjects further downstream. Definition at line 291 of file itkProcessObject.h. References ITK_MAX_THREADS. |
|
Protected methods for setting inputs. Subclasses make use of them for setting input. |
|
Protected methods for setting outputs. Subclasses make use of them for getting output. |
|
Reset the pipeline. If an exception is thrown during an Update(), the pipeline may be in an inconsistent state. This method clears the internal state of the pipeline so Update() can be called. |
|
Set the AbortGenerateData flag for the process object. Process objects may handle premature termination of execution in different ways. |
|
Protected methods for setting inputs. Subclasses make use of them for setting input. |
|
Protected methods for setting outputs. Subclasses make use of them for getting output. |
|
Called to allocate the input array. Copies old inputs. |
|
Called to allocate the output array. Copies old outputs. |
|
Protected methods for setting inputs. Subclasses make use of them for setting input. |
|
Protected methods for setting outputs. Subclasses make use of them for getting output. |
|
Get/Set the number of threads to create when executing. |
|
Set the execution progress of a process object. The progress is a floating number in [0,1] with 0 meaning no progress and 1 meaning the filter has completed execution. The ProgressEvent is NOT invoked. |
|
Turn on/off the flags to control whether the data belonging to the outputs of this ProcessObject are released after being used by a source by ProcessObjects further downstream. |
|
Bring this filter up-to-date. Update() checks modified times against last execution times, and re-executes objects if necessary. A side effect of this method is that the whole pipeline may execute in order to bring this filter up-to-date. This method updates the currently prescribed requested region. If no requested region has been set on the output, then the requested region will be set to the largest possible region. Once the requested region is set, Update() will make sure the specified requested region is up-to-date. This is a confusing side effect to users who are just calling Update() on a filter. A first call to Update() will cause the largest possible region to be updated. A second call to Update() will update that same region. If a modification to the upstream pipeline cause a filter to have a different largest possible region, this second call to Update() will not cause the output requested region to be reset to the new largest possible region. Instead, the output requested region will be the same as the last time Update() was called. To have a filter always to produce its largest possible region, users should call UpdateLargestPossibleRegion() instead. Reimplemented in itk::ImageFileWriter< TInputImage >, and itk::Writer. |
|
Like Update(), but sets the output requested region to the largest possible region for the output. This is the method users should call if they want the entire dataset to be processed. If a user wants to update the same output region as a previous call to Update() or a previous call to UpdateLargestPossibleRegion(), then they should call the method Update(). |
|
Actually generate new output Reimplemented in itk::StreamingImageFilter< TInputImage, TOutputImage >. |
|
Update the information decribing the output data. This method transverses up the pipeline gathering modified time information. On the way back down the pipeline, this method calls GenerateOutputInformation() to set any necessary information about the output data objects. For instance, a filter that shrinks an image will need to provide an implementation for GenerateOutputInformation() that changes the spacing of the pixels. Such filters should call their superclass' implementation of GenerateOutputInformation prior to changing the information values they need (i.e. GenerateOutputInformation() should call Superclass::GenerateOutputInformation() prior to changing the information. Reimplemented in itk::watershed::Segmenter< TInputImage >, itk::VTKImageImport< TOutputImage >, and itk::watershed::Segmenter< InputImageType >. |
|
Update the progress of the process object. Sets the Progress ivar to amount and invokes any observers for the ProgressEvent. The parameter amount should be in [0,1] and is the cumulative (not incremental) progress. Referenced by itk::ProgressReporter::CompletedPixel(). |
|
Friends of ProcessObject Definition at line 378 of file itkProcessObject.h. |
|
Time when GenerateOutputInformation was last called. Definition at line 354 of file itkProcessObject.h. |
|
This flag indicates when the pipeline is executing. It prevents infinite recursion when pipelines have loops. Definition at line 351 of file itkProcessObject.h. |