28 #ifndef itkProcessObject_h
29 #define itkProcessObject_h
159 typedef std::vector< DataObjectIdentifierType >
NameArray;
272 itkSetMacro(AbortGenerateData,
bool);
275 itkGetConstReferenceMacro(AbortGenerateData,
bool);
278 itkBooleanMacro(AbortGenerateData);
292 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
296 m_Progress = std::max(progress, 0.0f);
297 m_Progress = std::min(m_Progress, 1.0f);
307 itkGetConstReferenceMacro(Progress,
float);
315 void UpdateProgress(
float progress);
338 virtual void Update();
349 virtual void UpdateLargestPossibleRegion();
366 virtual void UpdateOutputInformation();
370 virtual void PropagateRequestedRegion(
DataObject *output);
373 virtual void UpdateOutputData(
DataObject *output);
392 virtual void ResetPipeline();
410 virtual DataObjectPointer MakeOutput(
const DataObjectIdentifierType & );
417 virtual void SetReleaseDataFlag(
bool flag);
418 virtual bool GetReleaseDataFlag()
const;
435 itkSetMacro(ReleaseDataBeforeUpdateFlag,
bool);
436 itkGetConstReferenceMacro(ReleaseDataBeforeUpdateFlag,
bool);
437 itkBooleanMacro(ReleaseDataBeforeUpdateFlag);
442 itkGetConstReferenceMacro(NumberOfThreads,
ThreadIdType);
447 {
return m_Threader; }
455 virtual void PrepareOutputs();
471 template<
typename TDomainPartitioner,
typename TAssociate >
493 virtual void DetermineNumberOfThreadsUsed();
499 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
515 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second.GetPointer() : ITK_NULLPTR; }
517 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second.GetPointer() : ITK_NULLPTR; }
526 virtual void SetInput(
const DataObjectIdentifierType & key,
DataObject *input);
527 virtual void SetNthInput(DataObjectPointerArraySizeType num,
DataObject *input);
540 virtual void PushBackInput(
const DataObject *input);
541 virtual void PopBackInput();
542 virtual void PushFrontInput(
const DataObject *input);
543 virtual void PopFrontInput();
551 virtual void RemoveInput(
const DataObjectIdentifierType & key);
552 virtual void RemoveInput(DataObjectPointerArraySizeType);
556 {
return m_IndexedInputs[0]->second; }
558 {
return m_IndexedInputs[0]->second; }
562 virtual void SetPrimaryInputName(
const DataObjectIdentifierType & key);
564 {
return this->m_IndexedInputs[0]->first.c_str(); }
568 virtual void SetPrimaryInput(
DataObject *input);
576 void SetNumberOfIndexedInputs(DataObjectPointerArraySizeType num);
587 virtual void SetNumberOfRequiredInputs(DataObjectPointerArraySizeType);
588 itkGetConstReferenceMacro(NumberOfRequiredInputs, DataObjectPointerArraySizeType);
592 bool AddRequiredInputName(
const DataObjectIdentifierType & );
598 bool RemoveRequiredInputName(
const DataObjectIdentifierType & );
601 bool IsRequiredInputName(
const DataObjectIdentifierType & )
const;
607 void SetRequiredInputNames(
const NameArray & );
611 bool AddRequiredInputName(
const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx );
618 DataObject * GetOutput(
const DataObjectIdentifierType & key);
619 const DataObject * GetOutput(
const DataObjectIdentifierType & key)
const;
623 virtual void SetPrimaryOutputName(
const DataObjectIdentifierType & key);
625 {
return this->m_IndexedOutputs[0]->first.c_str(); }
629 DataObject * GetOutput(DataObjectPointerArraySizeType idx);
630 const DataObject * GetOutput(DataObjectPointerArraySizeType idx)
const;
634 virtual void SetOutput(
const DataObjectIdentifierType & key,
DataObject *output);
637 virtual void RemoveOutput(
const DataObjectIdentifierType & key);
641 {
return m_IndexedOutputs[0]->second; }
643 {
return m_IndexedOutputs[0]->second; }
647 virtual void SetPrimaryOutput(
DataObject *output);
651 virtual void SetNthOutput(DataObjectPointerArraySizeType num,
DataObject *output);
655 virtual void RemoveOutput(DataObjectPointerArraySizeType idx);
657 itkSetMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
658 itkGetConstReferenceMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
661 void SetNumberOfIndexedOutputs(DataObjectPointerArraySizeType num);
664 DataObjectIdentifierType MakeNameFromInputIndex( DataObjectPointerArraySizeType idx )
const;
665 DataObjectIdentifierType MakeNameFromOutputIndex( DataObjectPointerArraySizeType idx )
const;
666 DataObjectPointerArraySizeType MakeIndexFromInputName(
const DataObjectIdentifierType & name )
const;
667 DataObjectPointerArraySizeType MakeIndexFromOutputName(
const DataObjectIdentifierType & name )
const;
668 bool IsIndexedInputName(
const DataObjectIdentifierType & )
const;
669 bool IsIndexedOutputName(
const DataObjectIdentifierType & )
const;
672 itkLegacyMacro(
virtual void RemoveOutput(
DataObject *output));
675 itkLegacyMacro(
void SetNumberOfOutputs(DataObjectPointerArraySizeType num));
680 itkLegacyMacro(
virtual void RemoveInput(
DataObject *input));
683 itkLegacyMacro(
void SetNumberOfInputs(DataObjectPointerArraySizeType num));
700 virtual void VerifyPreconditions();
712 virtual void VerifyInputInformation();
727 virtual void GenerateInputRequestedRegion();
740 virtual void GenerateOutputRequestedRegion(
DataObject *output);
752 virtual void GenerateOutputInformation();
761 virtual void PropagateResetPipeline();
774 virtual void ReleaseInputs();
784 virtual void CacheInputReleaseDataFlags();
789 virtual void RestoreInputReleaseDataFlags();
825 typedef std::set< DataObjectIdentifierType >
NameSet;
853 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
MultiThreader * GetMultiThreader() const
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()
MultiThreader::Pointer m_Threader
TimeStamp m_OutputInformationMTime
ProcessObjectDomainThreader Self
const DataObject * GetInput(DataObjectPointerArraySizeType idx) const
SmartPointer< Self > Pointer
void ReleaseDataFlagOff()
A forward iterator over the DataObject of a ProcessObject.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject * GetInput(DataObjectPointerArraySizeType idx)
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.
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)