Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkFitParameterModel Class Reference

Qt table model for displaying parameter values of model fit results at various world positions. More...

#include <QmitkFitParameterModel.h>

Inheritance diagram for QmitkFitParameterModel:
Collaboration diagram for QmitkFitParameterModel:

Public Types

using FitVectorType = std::vector< mitk::modelFit::ModelFitInfo::ConstPointer >
 Vector type holding const pointers to ModelFitInfo instances. More...
 

Public Slots

void setFits (const FitVectorType &fits)
 Sets the model fit info instances to display. More...
 
void setCurrentPosition (const mitk::Point3D &currentPos)
 Sets the current world coordinate position for parameter value lookup. More...
 
void setPositionBookmarks (const mitk::PointSet *bookmarks)
 Sets the point set used as position bookmarks. More...
 

Public Member Functions

 QmitkFitParameterModel (QObject *parent=nullptr)
 Constructs a QmitkFitParameterModel. More...
 
 ~QmitkFitParameterModel () override
 Destructor. More...
 
const FitVectorType & getFits () const
 Returns the currently set model fit info instances. More...
 
mitk::Point3D getCurrentPosition () const
 Returns the current world coordinate position used for value lookup. More...
 
const mitk::PointSet * getPositionBookmarks () const
 Returns the point set used as position bookmarks. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Returns item flags for the given model index. More...
 
QVariant data (const QModelIndex &index, int role) const override
 Returns data for the given index and role. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 Returns header data for the specified section, orientation, and role. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of rows in the model. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of columns in the model. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 Sets data for a given index (currently always returns false; model is read-only). More...
 

Protected Member Functions

std::size_t getBookmarksCount () const
 

Detailed Description

Qt table model for displaying parameter values of model fit results at various world positions.

This model presents the parameter values of one or more ModelFitInfo instances evaluated at the current world coordinate position and optional bookmark positions. When a single fit is provided, the model displays a flat list of parameters. When multiple fits are present, the model uses a tree hierarchy where the first level represents fits and the second level represents the parameters of each fit.

Columns are organized as: parameter name, parameter type, value at the current position, and one additional column per bookmark position.

See also
QmitkFitParameterWidget
mitk::modelFit::ModelFitInfo

Definition at line 40 of file QmitkFitParameterModel.h.

Member Typedef Documentation

◆ FitVectorType

using QmitkFitParameterModel::FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>

Vector type holding const pointers to ModelFitInfo instances.

Definition at line 46 of file QmitkFitParameterModel.h.

Constructor & Destructor Documentation

◆ QmitkFitParameterModel()

QmitkFitParameterModel::QmitkFitParameterModel ( QObject *  parent = nullptr)

Constructs a QmitkFitParameterModel.

Parameters
[in]parentOptional parent QObject.

◆ ~QmitkFitParameterModel()

QmitkFitParameterModel::~QmitkFitParameterModel ( )
inlineoverride

Destructor.

Definition at line 55 of file QmitkFitParameterModel.h.

Member Function Documentation

◆ columnCount()

int QmitkFitParameterModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Returns the number of columns in the model.

Always returns 3 (name, type, current value) plus the number of bookmark positions.

Parameters
[in]parentThe parent model index.
Returns
The column count.

◆ data()

QVariant QmitkFitParameterModel::data ( const QModelIndex &  index,
int  role 
) const
override

Returns data for the given index and role.

Provides parameter names (column 0), parameter types (column 1), values at the current position (column 2), and values at bookmark positions (columns 3+). Static parameters are displayed with comma-separated values. When multiple fits are set, the top-level rows show fit name and UID.

Parameters
[in]indexThe model index to query.
[in]roleThe Qt item data role.
Returns
The requested data as QVariant, or an invalid QVariant if unavailable.

◆ flags()

Qt::ItemFlags QmitkFitParameterModel::flags ( const QModelIndex &  index) const
override

Returns item flags for the given model index.

Parameters
[in]indexThe model index to query.
Returns
The item flags (read-only by default).

◆ getBookmarksCount()

std::size_t QmitkFitParameterModel::getBookmarksCount ( ) const
protected

◆ getCurrentPosition()

mitk::Point3D QmitkFitParameterModel::getCurrentPosition ( ) const

Returns the current world coordinate position used for value lookup.

Returns
The current 3D position.

◆ getFits()

const FitVectorType& QmitkFitParameterModel::getFits ( ) const

Returns the currently set model fit info instances.

Returns
Const reference to the vector of ModelFitInfo pointers.

◆ getPositionBookmarks()

const mitk::PointSet* QmitkFitParameterModel::getPositionBookmarks ( ) const

Returns the point set used as position bookmarks.

Returns
Pointer to the position bookmark PointSet, or nullptr if none is set.

◆ headerData()

QVariant QmitkFitParameterModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Returns header data for the specified section, orientation, and role.

Horizontal headers are: "Name", "Type", "Value", and positional headers for each bookmark showing coordinates.

Parameters
[in]sectionThe column index.
[in]orientationThe header orientation (horizontal or vertical).
[in]roleThe Qt item data role.
Returns
The header data as QVariant.

◆ rowCount()

int QmitkFitParameterModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Returns the number of rows in the model.

For a single fit, returns the number of parameters plus static parameters. For multiple fits, the top-level row count equals the number of fits, and child row counts equal the parameter counts of each respective fit.

Parameters
[in]parentThe parent model index.
Returns
The row count.

◆ setCurrentPosition

void QmitkFitParameterModel::setCurrentPosition ( const mitk::Point3D &  currentPos)
slot

Sets the current world coordinate position for parameter value lookup.

Triggers a full model reset so that values are re-read at the new position.

Parameters
[in]currentPosThe new 3D world position.

◆ setData()

bool QmitkFitParameterModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Sets data for a given index (currently always returns false; model is read-only).

Parameters
[in]indexThe model index.
[in]valueThe value to set.
[in]roleThe Qt item data role.
Returns
Always false.

◆ setFits

void QmitkFitParameterModel::setFits ( const FitVectorType &  fits)
slot

Sets the model fit info instances to display.

Triggers a full model reset.

Parameters
[in]fitsVector of ModelFitInfo pointers to display.

◆ setPositionBookmarks

void QmitkFitParameterModel::setPositionBookmarks ( const mitk::PointSet *  bookmarks)
slot

Sets the point set used as position bookmarks.

Each bookmark adds an additional column to the model showing parameter values at that position. Triggers a full model reset.

Parameters
[in]bookmarksPointer to a PointSet of bookmark positions, or nullptr to clear.

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