QmitkDataGeneratorBase BaseClass that implements the organization of (statistic) data generation for pairs of images and ROIs. The key idea is that this class ensures that for vector of given image ROI pairs (defined by derived classes) a result instance (e.g ImageStatisticsContainer) will be calculated, if needed (e.g. because it is missing or not up to date anymore), and stored in the data storage passed to a generator instance. While derived classes i.a. specify how to generate the image ROI pairs, how to detect latest results, what the next generation step is and how to remove obsolete data from the storage, the base class takes care of the observation of the data storage and orchestrates the whole checking and generation workflow. In all the generation/orchestration process the data storage, passed to the generator, 1) serves as place where the final results are stored and searched and 2) it resembles the state of the generation process with these final results and WIP place holder nodes that indicate planed or currently processed generation steps.
More...
#include <QmitkDataGeneratorBase.h>
QmitkDataGeneratorBase BaseClass that implements the organization of (statistic) data generation for pairs of images and ROIs. The key idea is that this class ensures that for vector of given image ROI pairs (defined by derived classes) a result instance (e.g ImageStatisticsContainer) will be calculated, if needed (e.g. because it is missing or not up to date anymore), and stored in the data storage passed to a generator instance. While derived classes i.a. specify how to generate the image ROI pairs, how to detect latest results, what the next generation step is and how to remove obsolete data from the storage, the base class takes care of the observation of the data storage and orchestrates the whole checking and generation workflow. In all the generation/orchestration process the data storage, passed to the generator, 1) serves as place where the final results are stored and searched and 2) it resembles the state of the generation process with these final results and WIP place holder nodes that indicate planed or currently processed generation steps.
Definition at line 41 of file QmitkDataGeneratorBase.h.
◆ InputPairVectorType
◆ JobResultMapType
◆ QmitkDataGeneratorBase() [1/3]
◆ ~QmitkDataGeneratorBase()
virtual QmitkDataGeneratorBase::~QmitkDataGeneratorBase |
( |
| ) |
|
|
virtual |
◆ QmitkDataGeneratorBase() [2/3]
Constructor.
- Parameters
-
storage | the data storage where all produced data should be stored |
parent | |
◆ QmitkDataGeneratorBase() [3/3]
QmitkDataGeneratorBase::QmitkDataGeneratorBase |
( |
QObject * |
parent = nullptr | ) |
|
|
protected |
◆ ChangedNodeIsRelevant()
virtual bool QmitkDataGeneratorBase::ChangedNodeIsRelevant |
( |
const mitk::DataNode * |
changedNode | ) |
const |
|
protectedpure virtual |
◆ CreateWIPDataNode()
◆ DataGenerationStarted
Signal that is emitted if a data generation job is started to generate outdated/inexistent data.
◆ DoGenerate()
bool QmitkDataGeneratorBase::DoGenerate |
( |
| ) |
const |
|
protected |
Internal part of the generation strategy. Here is where the heavy lifting is done.
◆ EnsureRecheckingAndGeneration()
void QmitkDataGeneratorBase::EnsureRecheckingAndGeneration |
( |
| ) |
const |
|
protected |
Methods either directly calls generation or if its already ongoing flags to restart the generation.
◆ FilterImageROICombinations()
Filters a passed pair vector. The returned pair vector only contains pair of nodes that exist in the data storage.
◆ Generate()
bool QmitkDataGeneratorBase::Generate |
( |
| ) |
const |
Checks data validity and triggers generation of data, if needed. The generation itself will be done with a thread pool and is orchestrated by this class. To learn if the threads are finished and everything is uptodate, listen to the signal GenerationFinished.
- Returns
- indicates if everything is already valid (true) or if the generation of new data was triggered (false).
◆ GenerationFinished
void QmitkDataGeneratorBase::GenerationFinished |
( |
| ) |
const |
|
signal |
Signal that is emitted if all jobs are finished and everything is up to date.
◆ GetAllImageROICombinations()
This method must be implemented by derived classes to return the pairs of images and ROIs (ROI may be null if no ROI is needed) for which data are needed.
Implemented in QmitkImageAndRoiDataGeneratorBase.
◆ GetAutoUpdate()
bool QmitkDataGeneratorBase::GetAutoUpdate |
( |
| ) |
const |
Indicates if the generator may trigger the update automatically (true). Reasons for an update are:
- Input data has been changed or modified
- Generation relevant settings in derived classes have been changed (must be implemented in derived classes)
◆ GetDataStorage()
◆ GetNextMissingGenerationJob()
Is called to generate the next job instance that needs to be done and is associated dummy node in order to progress the data generation workflow.
- Returns
- std::pair of job pointer and placeholder node associated with the job. Following combinations are possible:
- Both are null: nothing to do;
- Both are set: there is something to do for a pending dummy node -> trigger computation;
- Job null and node set: a job for this node is already work in progress -> pass on till its finished.
Implemented in QmitkImageStatisticsDataGenerator.
◆ GetPairDescription()
std::string QmitkDataGeneratorBase::GetPairDescription |
( |
const InputPairVectorType::value_type & |
imageAndSeg | ) |
const |
|
protected |
Return a descriptive label of a passed pair. Used e.g. for some debug log messages.
◆ IndicateFutureResults()
This method should indicate all missing and outdated (interim) results in the data storage, with new placeholder nodes and WIP dummy data added to the storage. The placeholder nodes will be replaced by the real results as soon as they are ready. The strategy how to detect which placeholder node is need and how the dummy data should look like must be implemented by derived classes.
Implemented in QmitkImageStatisticsDataGenerator.
◆ IsGenerating()
bool QmitkDataGeneratorBase::IsGenerating |
( |
| ) |
const |
Indicates if there is currently work in progress, thus data generation jobs are running or pending. It is set to true when GenerationStarted is triggered and becomes false as soon as GenerationFinished is triggered.
◆ IsValidResultAvailable()
◆ JobError
Signal that is emitted in case of job errors.
◆ NewDataAvailable
void QmitkDataGeneratorBase::NewDataAvailable |
( |
mitk::DataStorage::SetOfObjects::ConstPointer |
data | ) |
const |
|
signal |
Signal that is emitted if new final data is produced.
◆ OnFinalResultsAvailable
◆ OnJobError
◆ operator=()
◆ PrepareResultForStorage()
◆ RemoveObsoleteDataNodes()
Remove all obsolete data nodes for the given image and ROI node from the data storage. Obsolete nodes are (interim) result nodes that are not the most recent any more.
Implemented in QmitkImageStatisticsDataGenerator.
◆ SetAutoUpdate
void QmitkDataGeneratorBase::SetAutoUpdate |
( |
bool |
autoUpdate | ) |
|
|
slot |
◆ SetDataStorage
Sets the data storage the generator should monitor and where WIP placeholder nodes and final result nodes should be stored.
◆ m_AutoUpdate
bool QmitkDataGeneratorBase::m_AutoUpdate |
|
protected |
◆ m_DataMutex
std::mutex QmitkDataGeneratorBase::m_DataMutex |
|
mutableprotected |
◆ m_GenerationTime
itk::TimeStamp QmitkDataGeneratorBase::m_GenerationTime |
|
mutableprotected |
Time stamp for the last successful run through with the current image roi pairs.
Definition at line 159 of file QmitkDataGeneratorBase.h.
◆ m_Storage
The documentation for this class was generated from the following file: