13 #ifndef QmitkInitialValuesModel_h
14 #define QmitkInitialValuesModel_h
16 #include <QAbstractTableModel>
146 Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
158 QVariant
data(
const QModelIndex& index,
int role)
const override;
170 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
177 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
184 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
198 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole)
override;
207 int valueType(
const QModelIndex& index)
const;
213 typedef std::map<mitk::ModelTraitsInterface::ParametersType::size_type, mitk::DataNode::ConstPointer> ImageMapType;
214 ImageMapType m_ParameterImageMap;
#define MITKMODELFITUI_EXPORT
Qt table model for defining and editing initial parameter values of a model fit.
mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const
Creates and returns a delegate representing the full initial parameterization.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of parameters (rows).
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns header data for the specified section.
bool isModified()
Indicates whether the model content has been modified since the last setInitialValues() call.
QmitkInitialValuesModel(QObject *parent=nullptr)
Constructs a QmitkInitialValuesModel.
bool hasValidInitialValues() const
Checks whether all initial values are valid.
~QmitkInitialValuesModel() override
Destructor.
void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType &names, const mitk::ModelTraitsInterface::ParametersType values, const mitk::ModelTraitsInterface::ParamterUnitMapType units)
Sets the parameter names, default values, and units.
mitk::ModelTraitsInterface::ParametersType getInitialValues() const
Returns the current scalar initial values.
void resetInitialParameterImage()
Clears all image-based parameter assignments.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags for the given model index.
QVariant data(const QModelIndex &index, int role) const override
Returns data for the given index and role.
void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType &names)
Sets the parameter names with all initial values defaulting to zero.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns (always 4).
void addInitialParameterImage(const mitk::DataNode *node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex)
Assigns an image as the initial value source for a specific parameter.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets data for a given index.
Central node class of the MITK data tree, associating a data object with properties and mappers.
std::map< ParameterNameType, std::string > ParamterUnitMapType
Map type associating parameter names to their unit strings.
itk::Array< ParameterValueType > ParametersType
Type representing a vector of parameter values.
std::vector< ParameterNameType > ParameterNamesType
Type for a list of parameter names.