Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkImageStatisticsDataGenerator Class Reference

#include <QmitkImageStatisticsDataGenerator.h>

Inheritance diagram for QmitkImageStatisticsDataGenerator:
Collaboration diagram for QmitkImageStatisticsDataGenerator:

Public Member Functions

 QmitkImageStatisticsDataGenerator (mitk::DataStorage::Pointer storage, QObject *parent=nullptr)
 
 QmitkImageStatisticsDataGenerator (QObject *parent=nullptr)
 
bool IsValidResultAvailable (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const
 
mitk::DataNode::Pointer GetLatestResult (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode, bool onlyIfUpToDate=false, bool noWIP=true) const
 
std::string GenerateStatisticsNodeName (const mitk::Image *image, const mitk::BaseData *roi) const
 
void SetIgnoreZeroValueVoxel (bool _arg)
 
bool GetIgnoreZeroValueVoxel () const
 
void SetHistogramNBins (unsigned int nbins)
 
unsigned int GetHistogramNBins () const
 
- Public Member Functions inherited from QmitkImageAndRoiDataGeneratorBase
ConstNodeVectorType GetImageNodes () const
 
ConstNodeVectorType GetROINodes () const
 
- Public Member Functions inherited from QmitkDataGeneratorBase
 QmitkDataGeneratorBase (const QmitkDataGeneratorBase &other)=delete
 
QmitkDataGeneratorBaseoperator= (const QmitkDataGeneratorBase &other)=delete
 
virtual ~QmitkDataGeneratorBase ()
 
mitk::DataStorage::Pointer GetDataStorage () const
 
bool GetAutoUpdate () const
 
bool IsGenerating () const
 
bool Generate () const
 

Protected Member Functions

bool ChangedNodeIsRelevant (const mitk::DataNode *changedNode) const
 
void IndicateFutureResults (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const
 
std::pair< QmitkDataGenerationJobBase *, mitk::DataNode::PointerGetNextMissingGenerationJob (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const
 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. More...
 
void RemoveObsoleteDataNodes (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode) const
 
mitk::DataNode::Pointer PrepareResultForStorage (const std::string &label, mitk::BaseData *result, const QmitkDataGenerationJobBase *job) const
 
 QmitkImageStatisticsDataGenerator (const QmitkImageStatisticsDataGenerator &)=delete
 
QmitkImageStatisticsDataGeneratoroperator= (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
 
 QmitkImageAndRoiDataGeneratorBase (const QmitkImageAndRoiDataGeneratorBase &)=delete
 
QmitkImageAndRoiDataGeneratorBaseoperator= (const QmitkImageAndRoiDataGeneratorBase &)=delete
 
- Protected Member Functions inherited from QmitkDataGeneratorBase
 QmitkDataGeneratorBase (mitk::DataStorage::Pointer storage, QObject *parent=nullptr)
 Constructor. More...
 
 QmitkDataGeneratorBase (QObject *parent=nullptr)
 
InputPairVectorType FilterImageROICombinations (InputPairVectorType &&imageROICombinations) const
 
std::string GetPairDescription (const InputPairVectorType::value_type &imageAndSeg) const
 
bool DoGenerate () const
 
void EnsureRecheckingAndGeneration () const
 

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::DataStoragem_Storage
 
bool m_AutoUpdate
 
std::mutex m_DataMutex
 
itk::TimeStamp m_GenerationTime
 

Additional Inherited Members

- Public Types inherited from QmitkImageAndRoiDataGeneratorBase
using Superclass = QmitkDataGeneratorBase
 
using ConstNodeVectorType = std::vector< mitk::DataNode::ConstPointer >
 
using NodeVectorType = std::vector< mitk::DataNode::Pointer >
 
- Public Types inherited from QmitkDataGeneratorBase
using JobResultMapType = QmitkDataGenerationJobBase::ResultMapType
 
- Public Slots inherited from QmitkImageAndRoiDataGeneratorBase
void SetImageNodes (const ConstNodeVectorType &imageNodes)
 Setter for image nodes. More...
 
void SetImageNodes (const NodeVectorType &imageNodes)
 
void SetROINodes (const ConstNodeVectorType &roiNodes)
 Setter for roi nodes. More...
 
void SetROINodes (const NodeVectorType &roiNodes)
 
- Public Slots inherited from QmitkDataGeneratorBase
void SetDataStorage (mitk::DataStorage *storage)
 
void SetAutoUpdate (bool autoUpdate)
 
- Signals inherited from QmitkDataGeneratorBase
void DataGenerationStarted (const mitk::DataNode *imageNode, const mitk::DataNode *roiNode, const QmitkDataGenerationJobBase *job) const
 Signal that is emitted if a data generation job is started to generate outdated/inexistent data. More...
 
void NewDataAvailable (mitk::DataStorage::SetOfObjects::ConstPointer data) const
 Signal that is emitted if new final data is produced. More...
 
void GenerationFinished () const
 Signal that is emitted if all jobs are finished and everything is up to date. More...
 
void JobError (QString error, const QmitkDataGenerationJobBase *failedJob) const
 Signal that is emitted in case of job errors. 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 > >
 
- Protected Slots inherited from QmitkDataGeneratorBase
void OnJobError (QString error, const QmitkDataGenerationJobBase *failedJob) const
 
void OnFinalResultsAvailable (JobResultMapType results, const QmitkDataGenerationJobBase *job) const
 
- Static Protected Member Functions inherited from QmitkDataGeneratorBase
static mitk::DataNode::Pointer CreateWIPDataNode (mitk::BaseData *dataDummy, const std::string &nodeName)
 

Detailed Description

Generates ImageStatisticContainers by using QmitkImageStatisticsCalculationRunnables for each pair if image and ROIs and ensures their validity. It also encodes the HistogramNBins and IgnoreZeroValueVoxel as properties to the results as these settings are important criteria for discriminating statistics results. For more details of how the generation is done see QmitkDataGenerationBase.

Definition at line 27 of file QmitkImageStatisticsDataGenerator.h.

Constructor & Destructor Documentation

◆ QmitkImageStatisticsDataGenerator() [1/3]

QmitkImageStatisticsDataGenerator::QmitkImageStatisticsDataGenerator ( mitk::DataStorage::Pointer  storage,
QObject *  parent = nullptr 
)
inline

Definition at line 30 of file QmitkImageStatisticsDataGenerator.h.

◆ QmitkImageStatisticsDataGenerator() [2/3]

QmitkImageStatisticsDataGenerator::QmitkImageStatisticsDataGenerator ( QObject *  parent = nullptr)
inline

Definition at line 31 of file QmitkImageStatisticsDataGenerator.h.

◆ QmitkImageStatisticsDataGenerator() [3/3]

QmitkImageStatisticsDataGenerator::QmitkImageStatisticsDataGenerator ( const QmitkImageStatisticsDataGenerator )
protecteddelete

Member Function Documentation

◆ ChangedNodeIsRelevant()

bool QmitkImageStatisticsDataGenerator::ChangedNodeIsRelevant ( const mitk::DataNode changedNode) const
protectedvirtual

This method must be implemented by derived to indicate if a changed node is relevant and therefore if an update must be triggered.

Reimplemented from QmitkImageAndRoiDataGeneratorBase.

◆ GenerateStatisticsNodeName()

std::string QmitkImageStatisticsDataGenerator::GenerateStatisticsNodeName ( const mitk::Image image,
const mitk::BaseData roi 
) const

◆ GetHistogramNBins()

unsigned int QmitkImageStatisticsDataGenerator::GetHistogramNBins ( ) const

/brief Get bin size for histogram resolution.

◆ GetIgnoreZeroValueVoxel()

bool QmitkImageStatisticsDataGenerator::GetIgnoreZeroValueVoxel ( ) const

/brief Get status of zero value voxel ignoring.

◆ GetLatestResult()

mitk::DataNode::Pointer QmitkImageStatisticsDataGenerator::GetLatestResult ( const mitk::DataNode imageNode,
const mitk::DataNode roiNode,
bool  onlyIfUpToDate = false,
bool  noWIP = true 
) const

Returns the latest result for a given image and ROI and the current settings of the generator.

Parameters
imageNode
roiNode
onlyIfUpToDateIndicates if results should only be returned if the are up to date, thus not older then image and ROI.
noWIPIf noWIP is true, the function only returns valid final result and not just its placeholder (WIP). If noWIP equals false it might also return a WIP, thus the valid result is currently processed/ordered but might not be ready yet.

◆ GetNextMissingGenerationJob()

std::pair<QmitkDataGenerationJobBase*, mitk::DataNode::Pointer> QmitkImageStatisticsDataGenerator::GetNextMissingGenerationJob ( const mitk::DataNode imageNode,
const mitk::DataNode roiNode 
) const
protectedvirtual

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.

Remarks
The method can assume that the caller takes care of the job instance deletion.
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.

Implements QmitkDataGeneratorBase.

◆ IndicateFutureResults()

void QmitkImageStatisticsDataGenerator::IndicateFutureResults ( const mitk::DataNode imageNode,
const mitk::DataNode roiNode 
) const
protectedvirtual

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.

Implements QmitkDataGeneratorBase.

◆ IsValidResultAvailable()

bool QmitkImageStatisticsDataGenerator::IsValidResultAvailable ( const mitk::DataNode imageNode,
const mitk::DataNode roiNode 
) const
virtual

Indicates if for a given image and ROI a valid final result is available.

Implements QmitkDataGeneratorBase.

◆ operator=()

QmitkImageStatisticsDataGenerator& QmitkImageStatisticsDataGenerator::operator= ( const QmitkImageStatisticsDataGenerator )
protecteddelete

◆ PrepareResultForStorage()

mitk::DataNode::Pointer QmitkImageStatisticsDataGenerator::PrepareResultForStorage ( const std::string &  label,
mitk::BaseData result,
const QmitkDataGenerationJobBase job 
) const
protectedvirtual

Prepares result to be added to the storage in an appropriate way and returns the data node for that.

Implements QmitkDataGeneratorBase.

◆ RemoveObsoleteDataNodes()

void QmitkImageStatisticsDataGenerator::RemoveObsoleteDataNodes ( const mitk::DataNode imageNode,
const mitk::DataNode roiNode 
) const
protectedvirtual

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.

Implements QmitkDataGeneratorBase.

◆ SetHistogramNBins()

void QmitkImageStatisticsDataGenerator::SetHistogramNBins ( unsigned int  nbins)

/brief Set bin size for histogram resolution.

◆ SetIgnoreZeroValueVoxel()

void QmitkImageStatisticsDataGenerator::SetIgnoreZeroValueVoxel ( bool  _arg)

/brief Set flag to ignore zero valued voxels

Member Data Documentation

◆ m_HistogramNBins

unsigned int QmitkImageStatisticsDataGenerator::m_HistogramNBins
protected

Definition at line 66 of file QmitkImageStatisticsDataGenerator.h.

◆ m_IgnoreZeroValueVoxel

bool QmitkImageStatisticsDataGenerator::m_IgnoreZeroValueVoxel
protected

Definition at line 65 of file QmitkImageStatisticsDataGenerator.h.


The documentation for this class was generated from the following file: