Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkInitialValuesModel Class Reference

#include <QmitkInitialValuesModel.h>

Inheritance diagram for QmitkInitialValuesModel:
Collaboration diagram for QmitkInitialValuesModel:

Public Member Functions

 QmitkInitialValuesModel (QObject *parent=nullptr)
 
 ~QmitkInitialValuesModel () override
 
void setInitialValues (const mitk::ModelTraitsInterface::ParameterNamesType &names, const mitk::ModelTraitsInterface::ParametersType values)
 
void setInitialValues (const mitk::ModelTraitsInterface::ParameterNamesType &names)
 
void addInitialParameterImage (const mitk::DataNode *node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex)
 
bool hasValidInitialValues () const
 
void resetInitialParameterImage ()
 
mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate () const
 
mitk::ModelTraitsInterface::ParametersType getInitialValues () const
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant data (const QModelIndex &index, int role) const 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
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
bool isModified ()
 

Detailed Description

Model that handles the definition of initial model values.

Definition at line 30 of file QmitkInitialValuesModel.h.

Constructor & Destructor Documentation

◆ QmitkInitialValuesModel()

QmitkInitialValuesModel::QmitkInitialValuesModel ( QObject *  parent = nullptr)

◆ ~QmitkInitialValuesModel()

QmitkInitialValuesModel::~QmitkInitialValuesModel ( )
inlineoverride

Definition at line 36 of file QmitkInitialValuesModel.h.

Member Function Documentation

◆ addInitialParameterImage()

void QmitkInitialValuesModel::addInitialParameterImage ( const mitk::DataNode node,
mitk::ModelTraitsInterface::ParametersType::size_type  paramIndex 
)

Adds an image as a source for the initial value of a parameter.

Parameters
nodePointer to the image that is the value source.
paramIndexIndicates which parameter is defined by the source image. It equals the position of the vector defined by setInitialValues().
Remarks
setting an image for an index overwrites the value for this index set by SetInitialParameterization.
Precondition
paramIndex must be in bound of the initial parametrization vector.
node must be a valid image instance

◆ columnCount()

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

◆ data()

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

◆ flags()

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

◆ getInitialParametrizationDelegate()

mitk::InitialParameterizationDelegateBase::Pointer QmitkInitialValuesModel::getInitialParametrizationDelegate ( ) const

Returns a pointer to a delegate instance that represents the parameterization of the model.

◆ getInitialValues()

mitk::ModelTraitsInterface::ParametersType QmitkInitialValuesModel::getInitialValues ( ) const

Returns the current set initial values of the model.

Remarks
this are only the simpel scalar initial values. If an source image was set, this is missed here. Use getInitialParametrizationDelegate() to get everything at once.

◆ hasValidInitialValues()

bool QmitkInitialValuesModel::hasValidInitialValues ( ) const

◆ headerData()

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

◆ isModified()

bool QmitkInitialValuesModel::isModified ( )

Indicates if the content of the model was modified since the data was set via setInitialValues()

◆ resetInitialParameterImage()

void QmitkInitialValuesModel::resetInitialParameterImage ( )

◆ rowCount()

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

◆ setData()

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

◆ setInitialValues() [1/2]

void QmitkInitialValuesModel::setInitialValues ( const mitk::ModelTraitsInterface::ParameterNamesType names)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Convenience method that sets the default initial values always to zero.

◆ setInitialValues() [2/2]

void QmitkInitialValuesModel::setInitialValues ( const mitk::ModelTraitsInterface::ParameterNamesType names,
const mitk::ModelTraitsInterface::ParametersType  values 
)

Sets the names and the values of the initial parameter set for the model.

Parameters
namesList of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model and its parameter values.
valuesDefault values to start with.

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