|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Tree model that represents mitk::ImageStatisticsContainer data in the Qt model/view framework. More...
#include <QmitkImageStatisticsTreeModel.h>


Signals | |
| void | dataAvailable () |
| Emitted when new statistics data becomes available in the model. More... | |
| void | modelChanged () |
| Emitted when the model rebuild is finished (usually shortly after dataAvailable()). More... | |
Public Member Functions | |
| QmitkImageStatisticsTreeModel (QObject *parent=nullptr) | |
| Constructs the tree model. More... | |
| ~QmitkImageStatisticsTreeModel () override | |
| Destructor. Disconnects from the data storage. More... | |
| void | SetImageNodes (const std::vector< mitk::DataNode::ConstPointer > &nodes) |
| Sets the image nodes whose statistics should be displayed. More... | |
| void | SetMaskNodes (const std::vector< mitk::DataNode::ConstPointer > &nodes) |
| Sets the mask nodes whose statistics should be displayed. More... | |
| void | Clear () |
| Clears all image nodes, mask nodes, statistics, and resets the model. More... | |
| void | SetIgnoreZeroValueVoxel (bool _arg) |
| Sets whether zero-valued voxels should be ignored when selecting statistics. More... | |
| bool | GetIgnoreZeroValueVoxel () const |
| Returns whether zero-valued voxels are currently being ignored. More... | |
| void | SetHistogramNBins (unsigned int nbins) |
| Sets the number of histogram bins used to select matching statistics. More... | |
| unsigned int | GetHistogramNBins () const |
| Returns the current number of histogram bins. More... | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Returns the item flags for the given model index. More... | |
| QVariant | data (const QModelIndex &index, int role) const override |
| Returns the data for the given index and role. More... | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
| Returns the header data for the given section and orientation. More... | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of child rows under the given parent. More... | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns (statistic names count + 1). More... | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| Returns the model index for the specified row, column, and parent. More... | |
| QModelIndex | parent (const QModelIndex &child) const override |
| Returns the parent model index of the given child. More... | |
Public Member Functions inherited from QmitkAbstractDataStorageModel | |
| ~QmitkAbstractDataStorageModel () override | |
| void | SetDataStorage (mitk::DataStorage *dataStorage) |
| Sets the data storage and registers node event listeners. More... | |
| mitk::DataStorage::Pointer | GetDataStorage () const |
| Returns a locked pointer to the current data storage. More... | |
| void | SetNodePredicate (const mitk::NodePredicateBase *nodePredicate) |
| Sets the node predicate and triggers a model update. More... | |
| const mitk::NodePredicateBase * | GetNodePredicate () const |
| Returns the currently set node predicate. More... | |
Protected Member Functions | |
| void | DataStorageChanged () override |
| void | NodePredicateChanged () override |
| void | NodeAdded (const mitk::DataNode *node) override |
| void | NodeChanged (const mitk::DataNode *node) override |
| void | NodeRemoved (const mitk::DataNode *node) override |
Protected Member Functions inherited from QmitkAbstractDataStorageModel | |
| QmitkAbstractDataStorageModel (QObject *parent=nullptr) | |
| QmitkAbstractDataStorageModel (mitk::DataStorage *dataStorage, QObject *parent=nullptr) | |
Additional Inherited Members | |
Protected Attributes inherited from QmitkAbstractDataStorageModel | |
| mitk::WeakPointer< mitk::DataStorage > | m_DataStorage |
| mitk::NodePredicateBase::ConstPointer | m_NodePredicate |
Tree model that represents mitk::ImageStatisticsContainer data in the Qt model/view framework.
This model queries the data storage for ImageStatisticsContainer objects matching the configured image nodes, mask nodes, histogram bin count, and zero-voxel ignore flag. The results are presented in a hierarchical tree structure:
Definition at line 42 of file QmitkImageStatisticsTreeModel.h.
| QmitkImageStatisticsTreeModel::QmitkImageStatisticsTreeModel | ( | QObject * | parent = nullptr | ) |
Constructs the tree model.
| [in] | parent | Optional parent QObject. |
|
override |
Destructor. Disconnects from the data storage.
| void QmitkImageStatisticsTreeModel::Clear | ( | ) |
Clears all image nodes, mask nodes, statistics, and resets the model.
|
override |
Returns the number of columns (statistic names count + 1).
| [in] | parent | The parent model index (unused). |
|
override |
Returns the data for the given index and role.
Supports Qt::DisplayRole for statistics values and Qt::DecorationRole for label color icons and WIP hourglass indicators in the first column.
| [in] | index | The model index to query. |
| [in] | role | The data role (e.g. Qt::DisplayRole, Qt::DecorationRole). |
|
signal |
Emitted when new statistics data becomes available in the model.
|
overrideprotectedvirtual |
Implements QmitkAbstractDataStorageModel.
|
override |
Returns the item flags for the given model index.
| [in] | index | The model index to query. |
| unsigned int QmitkImageStatisticsTreeModel::GetHistogramNBins | ( | ) | const |
Returns the current number of histogram bins.
| bool QmitkImageStatisticsTreeModel::GetIgnoreZeroValueVoxel | ( | ) | const |
Returns whether zero-valued voxels are currently being ignored.
|
override |
Returns the header data for the given section and orientation.
The first column header is dynamically generated based on whether masks and multiple time steps are present. Subsequent columns show statistic names.
| [in] | section | The column index. |
| [in] | orientation | The header orientation (only Qt::Horizontal is supported). |
| [in] | role | The data role (only Qt::DisplayRole is supported). |
|
override |
Returns the model index for the specified row, column, and parent.
| [in] | row | The row number. |
| [in] | column | The column number. |
| [in] | parent | The parent model index. |
|
signal |
Emitted when the model rebuild is finished (usually shortly after dataAvailable()).
|
overrideprotectedvirtual |
Implements QmitkAbstractDataStorageModel.
|
overrideprotectedvirtual |
Implements QmitkAbstractDataStorageModel.
|
overrideprotectedvirtual |
Implements QmitkAbstractDataStorageModel.
|
overrideprotectedvirtual |
Implements QmitkAbstractDataStorageModel.
|
override |
Returns the parent model index of the given child.
| [in] | child | The child model index. |
|
override |
Returns the number of child rows under the given parent.
| [in] | parent | The parent model index. Invalid index refers to the root. |
| void QmitkImageStatisticsTreeModel::SetHistogramNBins | ( | unsigned int | nbins | ) |
Sets the number of histogram bins used to select matching statistics.
Triggers a model reset and rebuild if the value changes.
| [in] | nbins | The number of histogram bins. |
| void QmitkImageStatisticsTreeModel::SetIgnoreZeroValueVoxel | ( | bool | _arg | ) |
Sets whether zero-valued voxels should be ignored when selecting statistics.
Triggers a model reset and rebuild if the value changes.
| [in] | _arg | True to ignore zero-valued voxels; false to include them. |
| void QmitkImageStatisticsTreeModel::SetImageNodes | ( | const std::vector< mitk::DataNode::ConstPointer > & | nodes | ) |
Sets the image nodes whose statistics should be displayed.
Internally resolves each image's time steps for the hierarchical model. Triggers a model reset and rebuild.
| [in] | nodes | Vector of image data nodes. |
| void QmitkImageStatisticsTreeModel::SetMaskNodes | ( | const std::vector< mitk::DataNode::ConstPointer > & | nodes | ) |
Sets the mask nodes whose statistics should be displayed.
Handles the special case where a single-timestep mask is applied to a multi-timestep image. Triggers a model reset and rebuild.
| [in] | nodes | Vector of mask data nodes. |