28 #ifndef __itkProcessObject_h
29 #define __itkProcessObject_h
142 typedef std::vector< DataObjectIdentifierType >
NameArray;
237 itkSetMacro(AbortGenerateData,
bool);
241 itkGetConstReferenceMacro(AbortGenerateData,
bool);
244 itkBooleanMacro(AbortGenerateData);
258 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
262 m_Progress = std::max(progress, 0.0f);
263 m_Progress = std::min(m_Progress, 1.0f);
271 itkGetConstReferenceMacro(Progress,
float);
278 void UpdateProgress(
float progress);
298 virtual void Update();
306 virtual void UpdateLargestPossibleRegion();
320 virtual void UpdateOutputInformation();
324 virtual void PropagateRequestedRegion(
DataObject *output);
327 virtual void UpdateOutputData(
DataObject *output);
341 virtual void ResetPipeline();
357 virtual DataObjectPointer MakeOutput(
const DataObjectIdentifierType & );
364 virtual void SetReleaseDataFlag(
bool flag);
365 virtual bool GetReleaseDataFlag()
const;
382 itkSetMacro(ReleaseDataBeforeUpdateFlag,
bool);
383 itkGetConstReferenceMacro(ReleaseDataBeforeUpdateFlag,
bool);
384 itkBooleanMacro(ReleaseDataBeforeUpdateFlag);
389 itkGetConstReferenceMacro(NumberOfThreads,
ThreadIdType);
394 {
return m_Threader; }
402 virtual void PrepareOutputs();
418 template<
typename TDomainPartitioner,
typename TAssociate >
440 virtual void DetermineNumberOfThreadsUsed();
444 void operator=(
const Self & );
447 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
461 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second : ITK_NULLPTR; }
463 {
return idx < m_IndexedInputs.size() ? m_IndexedInputs[idx]->second : ITK_NULLPTR; }
467 virtual void SetInput(
const DataObjectIdentifierType & key,
DataObject *input);
471 virtual void SetNthInput(DataObjectPointerArraySizeType num,
DataObject *input);
481 virtual void PushBackInput(
const DataObject *input);
482 virtual void PopBackInput();
483 virtual void PushFrontInput(
const DataObject *input);
484 virtual void PopFrontInput();
493 virtual void RemoveInput(
const DataObjectIdentifierType & key);
494 virtual void RemoveInput(DataObjectPointerArraySizeType);
498 {
return m_IndexedInputs[0]->second; }
500 {
return m_IndexedInputs[0]->second; }
504 virtual void SetPrimaryInputName(
const DataObjectIdentifierType & key);
506 {
return this->m_IndexedInputs[0]->first.c_str(); }
510 virtual void SetPrimaryInput(
DataObject *input);
516 void SetNumberOfIndexedInputs(DataObjectPointerArraySizeType num);
524 virtual void SetNumberOfRequiredInputs(DataObjectPointerArraySizeType);
525 itkGetConstReferenceMacro(NumberOfRequiredInputs, DataObjectPointerArraySizeType);
530 bool AddRequiredInputName(
const DataObjectIdentifierType & );
531 bool AddRequiredInputName(
const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx );
532 bool RemoveRequiredInputName(
const DataObjectIdentifierType & );
533 bool IsRequiredInputName(
const DataObjectIdentifierType & )
const;
534 void SetRequiredInputNames(
const NameArray & );
542 DataObject * GetOutput(
const DataObjectIdentifierType & key);
543 const DataObject * GetOutput(
const DataObjectIdentifierType & key)
const;
547 virtual void SetPrimaryOutputName(
const DataObjectIdentifierType & key);
549 {
return this->m_IndexedOutputs[0]->first.c_str(); }
553 DataObject * GetOutput(DataObjectPointerArraySizeType idx);
554 const DataObject * GetOutput(DataObjectPointerArraySizeType idx)
const;
558 virtual void SetOutput(
const DataObjectIdentifierType & key,
DataObject *output);
561 virtual void RemoveOutput(
const DataObjectIdentifierType & key);
565 {
return m_IndexedOutputs[0]->second; }
567 {
return m_IndexedOutputs[0]->second; }
571 virtual void SetPrimaryOutput(
DataObject *output);
575 virtual void SetNthOutput(DataObjectPointerArraySizeType num,
DataObject *output);
579 virtual void RemoveOutput(DataObjectPointerArraySizeType idx);
581 itkSetMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
582 itkGetConstReferenceMacro(NumberOfRequiredOutputs, DataObjectPointerArraySizeType);
585 void SetNumberOfIndexedOutputs(DataObjectPointerArraySizeType num);
588 DataObjectIdentifierType MakeNameFromInputIndex( DataObjectPointerArraySizeType idx )
const;
589 DataObjectIdentifierType MakeNameFromOutputIndex( DataObjectPointerArraySizeType idx )
const;
590 DataObjectPointerArraySizeType MakeIndexFromInputName(
const DataObjectIdentifierType & name )
const;
591 DataObjectPointerArraySizeType MakeIndexFromOutputName(
const DataObjectIdentifierType & name )
const;
592 bool IsIndexedInputName(
const DataObjectIdentifierType & )
const;
593 bool IsIndexedOutputName(
const DataObjectIdentifierType & )
const;
596 itkLegacyMacro(
virtual void RemoveOutput(
DataObject *output));
599 itkLegacyMacro(
void SetNumberOfOutputs(DataObjectPointerArraySizeType num));
604 itkLegacyMacro(
virtual void RemoveInput(
DataObject *input));
607 itkLegacyMacro(
void SetNumberOfInputs(DataObjectPointerArraySizeType num));
624 virtual void VerifyPreconditions();
636 virtual void VerifyInputInformation();
651 virtual void GenerateInputRequestedRegion();
664 virtual void GenerateOutputRequestedRegion(
DataObject *output);
676 virtual void GenerateOutputInformation();
685 virtual void PropagateResetPipeline();
698 virtual void ReleaseInputs();
708 virtual void CacheInputReleaseDataFlags();
713 virtual void RestoreInputReleaseDataFlags();
727 void operator=(
const Self &);
750 typedef std::set< DataObjectIdentifierType >
NameSet;
778 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
Light weight base class for most itk classes.
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
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.
unsigned int ThreadIdType
std::set< DataObjectIdentifierType > NameSet
std::vector< DataObjectPointerMap::iterator > m_IndexedInputs
void SetProgress(float progress)