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();
497 void operator=( const
Self & ) ITK_DELETE_FUNCTION;
500 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
516 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second.GetPointer() : ITK_NULLPTR; }
518 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second.GetPointer() : ITK_NULLPTR; }
527 virtual void SetInput(
const DataObjectIdentifierType & key,
DataObject *input);
528 virtual void SetNthInput(DataObjectPointerArraySizeType num,
DataObject *input);
541 virtual void PushBackInput(
const DataObject *input);
542 virtual void PopBackInput();
543 virtual void PushFrontInput(
const DataObject *input);
544 virtual void PopFrontInput();
552 virtual void RemoveInput(
const DataObjectIdentifierType & key);
553 virtual void RemoveInput(DataObjectPointerArraySizeType);
557 {
return m_IndexedInputs[0]->second; }
559 {
return m_IndexedInputs[0]->second; }
563 virtual void SetPrimaryInputName(
const DataObjectIdentifierType & key);
565 {
return this->m_IndexedInputs[0]->first.c_str(); }
569 virtual void SetPrimaryInput(
DataObject *input);
577 void SetNumberOfIndexedInputs(DataObjectPointerArraySizeType num);
588 virtual void SetNumberOfRequiredInputs(DataObjectPointerArraySizeType);
589 itkGetConstReferenceMacro(NumberOfRequiredInputs, DataObjectPointerArraySizeType);
593 bool AddRequiredInputName(
const DataObjectIdentifierType & );
599 bool RemoveRequiredInputName(
const DataObjectIdentifierType & );
602 bool IsRequiredInputName(
const DataObjectIdentifierType & )
const;
608 void SetRequiredInputNames(
const NameArray & );
612 bool AddRequiredInputName(
const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx );
619 DataObject * GetOutput(
const DataObjectIdentifierType & key);
620 const DataObject * GetOutput(
const DataObjectIdentifierType & key)
const;
624 virtual void SetPrimaryOutputName(
const DataObjectIdentifierType & key);
626 {
return this->m_IndexedOutputs[0]->first.c_str(); }
630 DataObject * GetOutput(DataObjectPointerArraySizeType idx);
631 const DataObject * GetOutput(DataObjectPointerArraySizeType idx)
const;
635 virtual void SetOutput(
const DataObjectIdentifierType & key,
DataObject *output);
638 virtual void RemoveOutput(
const DataObjectIdentifierType & key);
642 {
return m_IndexedOutputs[0]->second; }
644 {
return m_IndexedOutputs[0]->second; }
648 virtual void SetPrimaryOutput(
DataObject *output);
652 virtual void SetNthOutput(DataObjectPointerArraySizeType num,
DataObject *output);
656 virtual void RemoveOutput(DataObjectPointerArraySizeType idx);
658 itkSetMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
659 itkGetConstReferenceMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
662 void SetNumberOfIndexedOutputs(DataObjectPointerArraySizeType num);
665 DataObjectIdentifierType MakeNameFromInputIndex( DataObjectPointerArraySizeType idx )
const;
666 DataObjectIdentifierType MakeNameFromOutputIndex( DataObjectPointerArraySizeType idx )
const;
667 DataObjectPointerArraySizeType MakeIndexFromInputName(
const DataObjectIdentifierType & name )
const;
668 DataObjectPointerArraySizeType MakeIndexFromOutputName(
const DataObjectIdentifierType & name )
const;
669 bool IsIndexedInputName(
const DataObjectIdentifierType & )
const;
670 bool IsIndexedOutputName(
const DataObjectIdentifierType & )
const;
673 itkLegacyMacro(
virtual void RemoveOutput(
DataObject *output));
676 itkLegacyMacro(
void SetNumberOfOutputs(DataObjectPointerArraySizeType num));
681 itkLegacyMacro(
virtual void RemoveInput(
DataObject *input));
684 itkLegacyMacro(
void SetNumberOfInputs(DataObjectPointerArraySizeType num));
701 virtual void VerifyPreconditions();
713 virtual void VerifyInputInformation();
728 virtual void GenerateInputRequestedRegion();
741 virtual void GenerateOutputRequestedRegion(
DataObject *output);
753 virtual void GenerateOutputInformation();
762 virtual void PropagateResetPipeline();
775 virtual void ReleaseInputs();
785 virtual void CacheInputReleaseDataFlags();
790 virtual void RestoreInputReleaseDataFlags();
804 void operator=(const
Self &) ITK_DELETE_FUNCTION;
814 DataObjectPointerMap m_Inputs;
815 DataObjectPointerMap m_Outputs;
817 std::vector< DataObjectPointerMap::iterator > m_IndexedInputs;
818 std::vector< DataObjectPointerMap::iterator > m_IndexedOutputs;
821 std::map< DataObjectIdentifierType,
bool > m_CachedInputReleaseDataFlags;
827 typedef std::set< DataObjectIdentifierType >
NameSet;
830 NameSet m_RequiredInputNames;
833 bool m_AbortGenerateData;
842 bool m_ReleaseDataBeforeUpdateFlag;
855 friend class TestProcessObject;
Superclass::DomainType DomainType
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Multi-threaded processing on a domain by processing sub-domains per thread.
Light weight base class for most itk classes.
std::string DataObjectIdentifierType
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...
DataObject::Pointer DataObjectPointer
DataObject * GetPrimaryInput()
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
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
A forward iterator over outputs of a ProcessObject.
std::vector< DataObjectPointer > DataObjectPointerArray
virtual void GenerateData()
Control indentation during Print() invocation.
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
void SetProgress(float progress)