|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Generates and manages ImageStatisticsContainer results for image/ROI pairs. More...
#include <QmitkImageStatisticsDataGenerator.h>


Public Member Functions | |
| QmitkImageStatisticsDataGenerator (mitk::DataStorage::Pointer storage, QObject *parent=nullptr) | |
| Constructs the generator with a data storage. More... | |
| QmitkImageStatisticsDataGenerator (QObject *parent=nullptr) | |
| Constructs the generator without an initial data storage. More... | |
| bool | IsValidResultAvailable (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const |
| Checks whether a valid, up-to-date statistics result exists for the given image/ROI pair. More... | |
| mitk::DataNode::Pointer | GetLatestResult (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode, bool onlyIfUpToDate=false, bool noWIP=true) const |
| Returns the latest statistics result node for a given image/ROI pair and current settings. More... | |
| std::string | GenerateStatisticsNodeName (const mitk::Image *image, const mitk::BaseData *roi) const |
| Generates a unique node name for a statistics result based on image, ROI, and current settings. More... | |
| void | SetIgnoreZeroValueVoxel (bool _arg) |
| Sets whether zero-valued voxels should be ignored in statistics computation. More... | |
| bool | GetIgnoreZeroValueVoxel () const |
| Returns whether zero-valued voxels are currently being ignored. More... | |
| void | SetHistogramNBins (unsigned int nbins) |
| Sets the number of bins for histogram computation. More... | |
| unsigned int | GetHistogramNBins () const |
| Returns the current number of histogram bins. More... | |
Public Member Functions inherited from QmitkImageAndRoiDataGeneratorBase | |
| ConstNodeVectorType | GetImageNodes () const |
| Returns the currently set image nodes. More... | |
| ConstNodeVectorType | GetROINodes () const |
| Returns the currently set ROI nodes. More... | |
Public Member Functions inherited from QmitkDataGeneratorBase | |
| QmitkDataGeneratorBase (const QmitkDataGeneratorBase &other)=delete | |
| QmitkDataGeneratorBase & | operator= (const QmitkDataGeneratorBase &other)=delete |
| virtual | ~QmitkDataGeneratorBase () |
| mitk::DataStorage::Pointer | GetDataStorage () const |
| Returns the data storage used by this generator. More... | |
| bool | GetAutoUpdate () const |
| Returns whether automatic updates are enabled. More... | |
| bool | IsGenerating () const |
| Returns whether data generation jobs are currently running or pending. More... | |
| bool | Generate () const |
| Checks data validity and triggers generation of missing or outdated data. More... | |
Protected Member Functions | |
| bool | ChangedNodeIsRelevant (const mitk::DataNode *changedNode) const |
| Determines whether a changed data node is relevant and should trigger a regeneration. More... | |
| void | IndicateFutureResults (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const |
| Adds placeholder nodes and WIP dummy data to the data storage for missing or outdated results. More... | |
| std::pair< QmitkDataGenerationJobBase *, mitk::DataNode::Pointer > | GetNextMissingGenerationJob (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const |
| Returns the next generation job and its associated placeholder node. More... | |
| void | RemoveObsoleteDataNodes (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const |
| Removes obsolete result nodes for the given image/ROI pair from the data storage. More... | |
| mitk::DataNode::Pointer | PrepareResultForStorage (const std::string &label, mitk::BaseData *result, const QmitkDataGenerationJobBase *job) const |
| Wraps a generation result in a data node suitable for storage. More... | |
| QmitkImageStatisticsDataGenerator (const QmitkImageStatisticsDataGenerator &)=delete | |
| QmitkImageStatisticsDataGenerator & | operator= (const QmitkImageStatisticsDataGenerator &)=delete |
Protected Member Functions inherited from QmitkImageAndRoiDataGeneratorBase | |
| QmitkImageAndRoiDataGeneratorBase (mitk::DataStorage::Pointer storage, QObject *parent=nullptr) | |
| QmitkImageAndRoiDataGeneratorBase (QObject *parent=nullptr) | |
| InputPairVectorType | GetAllImageROICombinations () const override |
| Returns all image/ROI pairs for which data generation is needed. More... | |
| QmitkImageAndRoiDataGeneratorBase (const QmitkImageAndRoiDataGeneratorBase &)=delete | |
| QmitkImageAndRoiDataGeneratorBase & | operator= (const QmitkImageAndRoiDataGeneratorBase &)=delete |
Protected Member Functions inherited from QmitkDataGeneratorBase | |
| QmitkDataGeneratorBase (mitk::DataStorage::Pointer storage, QObject *parent=nullptr) | |
| Constructs a generator with the given data storage. More... | |
| QmitkDataGeneratorBase (QObject *parent=nullptr) | |
| Constructs a generator without an initial data storage. More... | |
| InputPairVectorType | FilterImageROICombinations (InputPairVectorType &&imageROICombinations) const |
| Filters image/ROI pairs to only include those whose nodes exist in the data storage. More... | |
| std::string | GetPairDescription (const InputPairVectorType::value_type &imageAndSeg) const |
| Returns a human-readable description of an image/ROI pair for debug logging. More... | |
| bool | DoGenerate () const |
| Core generation loop that checks validity and launches jobs for all image/ROI pairs. More... | |
| void | EnsureRecheckingAndGeneration () const |
| Ensures generation is (re)started, either immediately or by flagging a restart if already running. More... | |
Protected Attributes | |
| bool | m_IgnoreZeroValueVoxel |
| unsigned int | m_HistogramNBins |
Protected Attributes inherited from QmitkImageAndRoiDataGeneratorBase | |
| ConstNodeVectorType | m_ImageNodes |
| ConstNodeVectorType | m_ROINodes |
Protected Attributes inherited from QmitkDataGeneratorBase | |
| mitk::WeakPointer< mitk::DataStorage > | m_Storage |
| bool | m_AutoUpdate |
| std::mutex | m_DataMutex |
| itk::TimeStamp | m_GenerationTime |
Additional Inherited Members | |
Public Types inherited from QmitkImageAndRoiDataGeneratorBase | |
| using | Superclass = QmitkDataGeneratorBase |
| Superclass typedef. More... | |
| using | ConstNodeVectorType = std::vector< mitk::DataNode::ConstPointer > |
| Vector of const data node pointers. More... | |
| using | NodeVectorType = std::vector< mitk::DataNode::Pointer > |
| Vector of mutable data node pointers. More... | |
Public Types inherited from QmitkDataGeneratorBase | |
| using | JobResultMapType = QmitkDataGenerationJobBase::ResultMapType |
| Alias for the result map type produced by generation jobs. More... | |
Public Slots inherited from QmitkImageAndRoiDataGeneratorBase | |
| void | SetImageNodes (const ConstNodeVectorType &imageNodes) |
| Sets the image nodes for data generation. More... | |
| void | SetImageNodes (const NodeVectorType &imageNodes) |
| Convenience overload accepting mutable node pointers. More... | |
| void | SetROINodes (const ConstNodeVectorType &roiNodes) |
| Sets the ROI nodes for data generation. More... | |
| void | SetROINodes (const NodeVectorType &roiNodes) |
| Convenience overload accepting mutable node pointers. More... | |
Public Slots inherited from QmitkDataGeneratorBase | |
| void | SetDataStorage (mitk::DataStorage *storage) |
| Sets the data storage for monitoring, storing WIP placeholders, and final results. More... | |
| void | SetAutoUpdate (bool autoUpdate) |
| Enables or disables automatic update on data changes. More... | |
Signals inherited from QmitkDataGeneratorBase | |
| void | DataGenerationStarted (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode, const QmitkDataGenerationJobBase *job) const |
| Emitted when a data generation job is started for outdated or missing data. More... | |
| void | NewDataAvailable (mitk::DataStorage::SetOfObjects::ConstPointer data) const |
| Emitted when new final result data has been produced and added to the data storage. More... | |
| void | GenerationFinished () const |
| Emitted when all generation jobs have finished and all results are up to date. More... | |
| void | JobError (QString error, const QmitkDataGenerationJobBase *failedJob) const |
| Emitted when a generation job encounters an error. More... | |
Protected Types inherited from QmitkImageAndRoiDataGeneratorBase | |
| using | InputPairVectorType = Superclass::InputPairVectorType |
Protected Types inherited from QmitkDataGeneratorBase | |
| using | InputPairVectorType = std::vector< std::pair< mitk::DataNode::ConstPointer, mitk::DataNode::ConstPointer > > |
| Vector of image/ROI node pairs used as input for generation. More... | |
Protected Slots inherited from QmitkDataGeneratorBase | |
| void | OnJobError (QString error, const QmitkDataGenerationJobBase *failedJob) const |
| Handles error signals from generation jobs and re-emits JobError. More... | |
| void | OnFinalResultsAvailable (JobResultMapType results, const QmitkDataGenerationJobBase *job) const |
| Handles completed job results, adds them to the data storage, and emits NewDataAvailable. More... | |
Static Protected Member Functions inherited from QmitkDataGeneratorBase | |
| static mitk::DataNode::Pointer | CreateWIPDataNode (mitk::BaseData *dataDummy, const std::string &nodeName) |
| Creates a WIP placeholder data node for future results. More... | |
Generates and manages ImageStatisticsContainer results for image/ROI pairs.
Uses QmitkImageStatisticsCalculationRunnable jobs to compute statistics for each image/ROI combination and ensures their validity. The generator encodes HistogramNBins and IgnoreZeroValueVoxel as properties on the result containers, since these settings are critical criteria for distinguishing statistics results.
For details on the generation orchestration, see QmitkDataGeneratorBase.
Definition at line 35 of file QmitkImageStatisticsDataGenerator.h.
|
inline |
Constructs the generator with a data storage.
| [in] | storage | The data storage for storing results and observing changes. |
| [in] | parent | Optional parent QObject for Qt ownership. |
Definition at line 43 of file QmitkImageStatisticsDataGenerator.h.
|
inline |
Constructs the generator without an initial data storage.
| [in] | parent | Optional parent QObject for Qt ownership. |
Definition at line 49 of file QmitkImageStatisticsDataGenerator.h.
|
protecteddelete |
|
protectedvirtual |
Determines whether a changed data node is relevant and should trigger a regeneration.
| [in] | changedNode | The node that was changed in the data storage. |
Reimplemented from QmitkImageAndRoiDataGeneratorBase.
| std::string QmitkImageStatisticsDataGenerator::GenerateStatisticsNodeName | ( | const mitk::Image * | image, |
| const mitk::BaseData * | roi | ||
| ) | const |
Generates a unique node name for a statistics result based on image, ROI, and current settings.
| [in] | image | The source image. Must not be nullptr. |
| [in] | roi | The source ROI data (may be nullptr). |
| mitk::Exception | if image is nullptr. |
| unsigned int QmitkImageStatisticsDataGenerator::GetHistogramNBins | ( | ) | const |
Returns the current number of histogram bins.
| bool QmitkImageStatisticsDataGenerator::GetIgnoreZeroValueVoxel | ( | ) | const |
Returns whether zero-valued voxels are currently being ignored.
| mitk::DataNode::Pointer QmitkImageStatisticsDataGenerator::GetLatestResult | ( | const mitk::DataNode * | imageNode, |
| const mitk::DataNode * | roiNode, | ||
| bool | onlyIfUpToDate = false, |
||
| bool | noWIP = true |
||
| ) | const |
Returns the latest statistics result node for a given image/ROI pair and current settings.
| [in] | imageNode | The image data node. Must not be nullptr and must contain valid data. |
| [in] | roiNode | The ROI data node (may be nullptr). |
| [in] | onlyIfUpToDate | If true, only returns results that are newer than the source image and ROI. |
| [in] | noWIP | If true, only returns finalized results (not WIP placeholders). If false, may also return a WIP placeholder indicating computation is in progress. |
| mitk::Exception | if imageNode is nullptr or contains no data. |
|
protectedvirtual |
Returns the next generation job and its associated placeholder node.
| [in] | imageNode | The image data node. |
| [in] | roiNode | The ROI data node (may be nullptr). |
Implements QmitkDataGeneratorBase.
|
protectedvirtual |
Adds placeholder nodes and WIP dummy data to the data storage for missing or outdated results.
The placeholder nodes will be replaced by real results once generation completes. Derived classes define the detection strategy and dummy data format.
| [in] | imageNode | The image data node. |
| [in] | roiNode | The ROI data node (may be nullptr). |
Implements QmitkDataGeneratorBase.
|
virtual |
Checks whether a valid, up-to-date statistics result exists for the given image/ROI pair.
| [in] | imageNode | The image data node. |
| [in] | roiNode | The ROI data node (may be nullptr). |
Implements QmitkDataGeneratorBase.
|
protecteddelete |
|
protectedvirtual |
Wraps a generation result in a data node suitable for storage.
| [in] | label | The result label from the job's result map. |
| [in] | result | The generated data to store. |
| [in] | job | The job that produced the result. |
Implements QmitkDataGeneratorBase.
|
protectedvirtual |
Removes obsolete result nodes for the given image/ROI pair from the data storage.
Obsolete nodes are interim result nodes that have been superseded by newer results.
| [in] | imageNode | The image data node. |
| [in] | roiNode | The ROI data node (may be nullptr). |
Implements QmitkDataGeneratorBase.
| void QmitkImageStatisticsDataGenerator::SetHistogramNBins | ( | unsigned int | nbins | ) |
Sets the number of bins for histogram computation.
If auto-update is enabled and the value changes, regeneration is triggered.
| [in] | nbins | The number of histogram bins. |
| void QmitkImageStatisticsDataGenerator::SetIgnoreZeroValueVoxel | ( | bool | _arg | ) |
Sets whether zero-valued voxels should be ignored in statistics computation.
If auto-update is enabled and the value changes, regeneration is triggered.
| [in] | _arg | True to ignore zero-valued voxels; false to include them. |
|
protected |
Definition at line 122 of file QmitkImageStatisticsDataGenerator.h.
|
protected |
Definition at line 121 of file QmitkImageStatisticsDataGenerator.h.