Medical Imaging Interaction Toolkit
2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
|
#include <QmitkMultiLabelTreeModel.h>
Public Types | |
enum | TableColumns { NAME_COL, LOCKED_COL, COLOR_COL, VISIBLE_COL } |
enum | ItemModelRole { LabelDataRole, LabelValueRole, LabelInstanceDataRole, LabelInstanceValueRole, GroupIDRole } |
using | LabelValueType = mitk::MultiLabelSegmentation::LabelValueType |
using | GroupIndexType = mitk::MultiLabelSegmentation::GroupIndexType |
Public Slots | |
void | SetAllowVisibilityModification (bool vmod) |
void | SetAllowLockModification (bool lmod) |
Signals | |
void | dataAvailable () |
void | modelChanged () |
Public Member Functions | |
QmitkMultiLabelTreeModel (QObject *parent=nullptr) | |
~QmitkMultiLabelTreeModel () override | |
void | SetSegmentation (mitk::MultiLabelSegmentation *segmentation) |
const mitk::MultiLabelSegmentation * | GetSegmentation () const |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | parent (const QModelIndex &child) const override |
QModelIndex | indexOfLabel (mitk::Label::PixelType labelValue) const |
QModelIndex | indexOfGroup (mitk::MultiLabelSegmentation::GroupIndexType groupIndex) const |
QModelIndex | FirstLabelInstanceIndex (const QModelIndex ¤tIndex) const |
std::vector< LabelValueType > | GetLabelsInSubTree (const QModelIndex ¤tIndex) const |
** Returns the index to the next node in the tree that behaves like an instance (label node with only one instance More... | |
std::vector< LabelValueType > | GetLabelInstancesOfSameLabelClass (const QModelIndex ¤tIndex) const |
bool | GetAllowVisibilityModification () const |
bool | GetAllowLockModification () const |
bool | GetModelUpdateOngoing () const |
LabelValueType | GetNearestLabelValueToLastChange () const |
Protected Member Functions | |
void | ITKEventHandler (const itk::EventObject &e) |
void | OnLabelAdded (LabelValueType labelValue) |
void | OnLabelModified (LabelValueType labelValue) |
void | OnLabelRemoved (LabelValueType labelValue) |
void | OnGroupAdded (GroupIndexType groupIndex) |
void | OnGroupModified (GroupIndexType groupIndex) |
void | OnGroupRemoved (GroupIndexType groupIndex) |
The class is used to represent the information of an MITK MultiLabel segmentation instance (labels, spatial groups...).
Definition at line 32 of file QmitkMultiLabelTreeModel.h.
Definition at line 38 of file QmitkMultiLabelTreeModel.h.
Definition at line 37 of file QmitkMultiLabelTreeModel.h.
Definition at line 89 of file QmitkMultiLabelTreeModel.h.
Enumerator | |
---|---|
NAME_COL | |
LOCKED_COL | |
COLOR_COL | |
VISIBLE_COL |
Definition at line 81 of file QmitkMultiLabelTreeModel.h.
QmitkMultiLabelTreeModel::QmitkMultiLabelTreeModel | ( | QObject * | parent = nullptr | ) |
|
override |
|
override |
|
override |
|
signal |
QModelIndex QmitkMultiLabelTreeModel::FirstLabelInstanceIndex | ( | const QModelIndex & | currentIndex | ) | const |
Returns the index to the first child node (or itself) in the tree that behaves like an instance (label node with only one instance or instance node). If current index is at the end, an invalid index is returned. If an invalid index is passed into the methods, the search starts at the root; thus the whole tree is search for the first label instance.
|
override |
bool QmitkMultiLabelTreeModel::GetAllowLockModification | ( | ) | const |
bool QmitkMultiLabelTreeModel::GetAllowVisibilityModification | ( | ) | const |
std::vector<LabelValueType> QmitkMultiLabelTreeModel::GetLabelInstancesOfSameLabelClass | ( | const QModelIndex & | currentIndex | ) | const |
Returns a vector containing all label values of all label instances that belong to the same label class like the passed index.
If index points to a group or invalid, nothing will be returned.
std::vector<LabelValueType> QmitkMultiLabelTreeModel::GetLabelsInSubTree | ( | const QModelIndex & | currentIndex | ) | const |
** Returns the index to the next node in the tree that behaves like an instance (label node with only one instance
Returns a vector containing all label values of the passed currentIndex or its child items.
bool QmitkMultiLabelTreeModel::GetModelUpdateOngoing | ( | ) | const |
LabelValueType QmitkMultiLabelTreeModel::GetNearestLabelValueToLastChange | ( | ) | const |
Returns the label value that is in the tree the closest instance to the latest removed label. If there was no label removal so far or no label is left, the function will return mitk::MultiLabelSegmentation::UNLABELED_VALUE.
const mitk::MultiLabelSegmentation* QmitkMultiLabelTreeModel::GetSegmentation | ( | ) | const |
|
override |
|
override |
QModelIndex QmitkMultiLabelTreeModel::indexOfGroup | ( | mitk::MultiLabelSegmentation::GroupIndexType | groupIndex | ) | const |
QModelIndex QmitkMultiLabelTreeModel::indexOfLabel | ( | mitk::Label::PixelType | labelValue | ) | const |
returns the index of a passed label value (always first column). If label value does not exist in segmentation or segmentation is not set an invalid index will be returned.
|
protected |
|
signal |
Is emitted whenever the model changes are finished (usually a bit later than dataAvailable()).
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
override |
|
override |
|
slot |
|
slot |
|
override |
void QmitkMultiLabelTreeModel::SetSegmentation | ( | mitk::MultiLabelSegmentation * | segmentation | ) |