28 #ifndef itkProcessObject_h
29 #define itkProcessObject_h
159 typedef std::vector< DataObjectIdentifierType >
NameArray;
275 itkSetMacro(AbortGenerateData,
bool);
278 itkGetConstReferenceMacro(AbortGenerateData,
bool);
281 itkBooleanMacro(AbortGenerateData);
295 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
299 m_Progress = std::max(progress, 0.0f);
300 m_Progress = std::min(m_Progress, 1.0f);
310 itkGetConstReferenceMacro(Progress,
float);
318 void UpdateProgress(
float progress);
341 virtual void Update();
352 virtual void UpdateLargestPossibleRegion();
369 virtual void UpdateOutputInformation();
373 virtual void PropagateRequestedRegion(
DataObject *output);
376 virtual void UpdateOutputData(
DataObject *output);
395 virtual void ResetPipeline();
413 virtual DataObjectPointer MakeOutput(
const DataObjectIdentifierType & );
420 virtual void SetReleaseDataFlag(
bool flag);
421 virtual bool GetReleaseDataFlag()
const;
438 itkSetMacro(ReleaseDataBeforeUpdateFlag,
bool);
439 itkGetConstReferenceMacro(ReleaseDataBeforeUpdateFlag,
bool);
440 itkBooleanMacro(ReleaseDataBeforeUpdateFlag);
445 itkGetConstReferenceMacro(NumberOfThreads,
ThreadIdType);
450 {
return m_Threader; }
458 virtual void PrepareOutputs();
474 template< typename TDomainPartitioner, typename TAssociate >
496 virtual void DetermineNumberOfThreadsUsed();
502 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
518 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second.GetPointer() : ITK_NULLPTR; }
520 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second.GetPointer() : ITK_NULLPTR; }
529 virtual void SetInput(
const DataObjectIdentifierType & key,
DataObject *input);
530 virtual void SetNthInput(DataObjectPointerArraySizeType num,
DataObject *input);
543 virtual void PushBackInput(
const DataObject *input);
544 virtual void PopBackInput();
545 virtual void PushFrontInput(
const DataObject *input);
546 virtual void PopFrontInput();
554 virtual void RemoveInput(
const DataObjectIdentifierType & key);
555 virtual void RemoveInput(DataObjectPointerArraySizeType);
559 {
return m_IndexedInputs[0]->second; }
561 {
return m_IndexedInputs[0]->second; }
565 virtual void SetPrimaryInputName(
const DataObjectIdentifierType & key);
567 {
return this->m_IndexedInputs[0]->first.c_str(); }
571 virtual void SetPrimaryInput(
DataObject *input);
579 void SetNumberOfIndexedInputs(DataObjectPointerArraySizeType num);
590 virtual void SetNumberOfRequiredInputs(DataObjectPointerArraySizeType);
591 itkGetConstReferenceMacro(NumberOfRequiredInputs, DataObjectPointerArraySizeType);
598 bool RemoveRequiredInputName(
const DataObjectIdentifierType & );
601 bool IsRequiredInputName(
const DataObjectIdentifierType & )
const;
607 void SetRequiredInputNames(
const NameArray & );
619 bool AddRequiredInputName(
const DataObjectIdentifierType & );
620 bool AddRequiredInputName(
const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx );
632 void AddOptionalInputName(
const DataObjectIdentifierType & );
633 void AddOptionalInputName(
const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx );
641 DataObject * GetOutput(
const DataObjectIdentifierType & key);
642 const DataObject * GetOutput(
const DataObjectIdentifierType & key)
const;
646 virtual void SetPrimaryOutputName(
const DataObjectIdentifierType & key);
648 {
return this->m_IndexedOutputs[0]->first.c_str(); }
652 DataObject * GetOutput(DataObjectPointerArraySizeType idx);
653 const DataObject * GetOutput(DataObjectPointerArraySizeType idx)
const;
657 virtual void SetOutput(
const DataObjectIdentifierType & key,
DataObject *output);
660 virtual void RemoveOutput(
const DataObjectIdentifierType & key);
664 {
return m_IndexedOutputs[0]->second; }
666 {
return m_IndexedOutputs[0]->second; }
670 virtual void SetPrimaryOutput(
DataObject *output);
674 virtual void SetNthOutput(DataObjectPointerArraySizeType num,
DataObject *output);
678 virtual void RemoveOutput(DataObjectPointerArraySizeType idx);
680 itkSetMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
681 itkGetConstReferenceMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
684 void SetNumberOfIndexedOutputs(DataObjectPointerArraySizeType num);
687 DataObjectIdentifierType MakeNameFromInputIndex( DataObjectPointerArraySizeType idx )
const;
688 DataObjectIdentifierType MakeNameFromOutputIndex( DataObjectPointerArraySizeType idx )
const;
689 DataObjectPointerArraySizeType MakeIndexFromInputName(
const DataObjectIdentifierType & name )
const;
690 DataObjectPointerArraySizeType MakeIndexFromOutputName(
const DataObjectIdentifierType & name )
const;
691 bool IsIndexedInputName(
const DataObjectIdentifierType & )
const;
692 bool IsIndexedOutputName(
const DataObjectIdentifierType & )
const;
695 itkLegacyMacro(
virtual void RemoveOutput(
DataObject *output));
698 itkLegacyMacro(
void SetNumberOfOutputs(DataObjectPointerArraySizeType num));
703 itkLegacyMacro(
virtual void RemoveInput(
DataObject *input));
706 itkLegacyMacro(
void SetNumberOfInputs(DataObjectPointerArraySizeType num));
723 virtual void VerifyPreconditions();
735 virtual void VerifyInputInformation();
750 virtual void GenerateInputRequestedRegion();
763 virtual void GenerateOutputRequestedRegion(
DataObject *output);
775 virtual void GenerateOutputInformation();
784 virtual void PropagateResetPipeline();
797 virtual void ReleaseInputs();
807 virtual void CacheInputReleaseDataFlags();
812 virtual void RestoreInputReleaseDataFlags();
848 typedef std::set< DataObjectIdentifierType >
NameSet;
876 friend class TestProcessObject;
DataObjectPointerMap m_Inputs
DataObjectPointerArraySizeType m_NumberOfRequiredInputs
Superclass::DomainType DomainType
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Multi-threaded processing on a domain by processing sub-domains per thread.
NameSet m_RequiredInputNames
std::string DataObjectIdentifierType
bool m_ReleaseDataBeforeUpdateFlag
DataObject * GetPrimaryOutput()
Multi-threaded processing on a domain by processing sub-domains per thread.
std::vector< DataObjectIdentifierType > NameArray
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
virtual const char * GetPrimaryInputName(void) const
const DataObject * GetPrimaryInput() const
A forward iterator over outputs of a ProcessObject.
DomainThreader< TDomainPartitioner, ProcessObject::Self > Superclass
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
std::map< DataObjectIdentifierType, bool > m_CachedInputReleaseDataFlags
DataObject::Pointer DataObjectPointer
DataObjectPointerMap m_Outputs
DataObject * GetPrimaryInput()
class ITK_FORWARD_EXPORT ProcessObject
TimeStamp m_OutputInformationMTime
ProcessObjectDomainThreader Self
const DataObject * GetInput(DataObjectPointerArraySizeType idx) const
SmartPointer< Self > Pointer
MultiThreaderType * GetMultiThreader() const
void ReleaseDataFlagOff()
A forward iterator over the DataObject of a ProcessObject.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject * GetInput(DataObjectPointerArraySizeType idx)
MultiThreaderType::Pointer m_Threader
SmartPointer< const Self > ConstPointer
virtual void EnlargeOutputRequestedRegion(DataObject *)
Generate a unique, increasing time value.
std::map< DataObjectIdentifierType, DataObjectPointer > DataObjectPointerMap
virtual const char * GetPrimaryOutputName(void) const
unsigned int ThreadIdType
ThreadIdType m_NumberOfThreads
A forward iterator over outputs of a ProcessObject.
DataObjectPointerArraySizeType m_NumberOfRequiredOutputs
std::vector< DataObjectPointer > DataObjectPointerArray
virtual void GenerateData()
Control indentation during Print() invocation.
MultiThreader MultiThreaderType
std::vector< DataObjectPointerMap::iterator > m_IndexedOutputs
A forward iterator over the DataObject of a ProcessObject.
Superclass::DomainPartitionerType DomainPartitionerType
const DataObject * GetPrimaryOutput() const
Base class for most ITK classes.
Base class for all data objects in ITK.
std::set< DataObjectIdentifierType > NameSet
std::vector< DataObjectPointerMap::iterator > m_IndexedInputs
void SetProgress(float progress)