35 mitkThrow() <<
"Cannot add model or fit properties to data instance. Passed data instance is null. parameter name:" << name;
40 mitkThrow() <<
"Cannot add model or fit properties to data. Passed fit info instance is null. parameter name:" << name;
65 modelFit::Parameter::ConstPointer param = fitInfo->
GetParameter(name,dataType);
69 mitkThrow() <<
"Cannot generate model fit result data. Parameter name is not part of the model fit info. Parameter name: "<<name;
72 if (!param->unit.empty())
77 if (param->scale != 1.0)
91 mitkThrow() <<
"Cannot add model or fit properties to data. Passed data instance is null.";
96 mitkThrow() <<
"Cannot add model or fit properties to data. Passed model traits instance is null.";
139 mitk::ScalarListLookupTableProperty::Pointer inputDataProp = mitk::ScalarListLookupTableProperty::New();
140 inputDataProp->SetValue(fitInfo->
inputData);
145 if (!fitInfo->
roiUID.empty())
157 mitkThrow() <<
"Cannot generate model fit result node. Passed parameterImage is null. parameter name: "<<name;
162 mitkThrow() <<
"Cannot generate model fit result node. Passed model traits instance is null. parameter name: "<<name;
167 result->SetData(parameterImage);
169 std::string nodeName = name;
173 nodeName = fitInfo->
fitName +
"_" + nodeName;
176 result->SetName(nodeName);
178 result->SetVisibility(
false);
187 mitk::ScalarListLookupTableProperty::Pointer result = mitk::ScalarListLookupTableProperty::New();
196 result->SetValue(table);
211 mitkThrow() <<
"Cannot generate model fit result node. Passed parameterImage is null. parameter name: "<<name;
216 mitkThrow() <<
"Cannot generate model fit result node. Passed model fit info instance is null. parameter name: "<<name;
229 mitkThrow() <<
"Cannot store model fit results in data storage. Passed model traits instance is null.";
234 for (ModelFitResultImageMapType::const_iterator pos = results.begin(); pos!=results.end(); ++pos)
237 nodes.push_back(newNode);
240 for (ModelFitResultImageMapType::const_iterator pos = derivedResults.begin(); pos!=derivedResults.end(); ++pos)
243 nodes.push_back(newNode);
246 for (ModelFitResultImageMapType::const_iterator pos = criterionResults.begin(); pos!=criterionResults.end(); ++pos)
249 nodes.push_back(newNode);
252 for (ModelFitResultImageMapType::const_iterator pos = evaluationResults.begin(); pos!=evaluationResults.end(); ++pos)
255 nodes.push_back(newNode);
265 mitkThrow() <<
"Cannot store model fit results in data storage. Passed storage is null.";
268 for (ModelFitResultNodeVectorType::const_iterator pos = resultNodes.begin(); pos!=resultNodes.end(); ++pos)
270 storage->
Add(*pos,parentNode);
275 for (ModelFitResultNodeVectorType::const_iterator pos = resultNodes.begin(); pos != resultNodes.end(); pos++)
static void DeriveDICOMPMProperties(BaseData *derivedDICOMImage)
static const std::string PARAMETER_TYPE_VALUE_CRITERION()
static const std::string FIT_TYPE_PROPERTY_NAME()
Data management class that handles 'was created by' relations.
void SetTableValue(const KeyType &key, const ValueType &value)
Sets the list at the given map key to the given value.
std::map< ModelBase::ParameterNameType, Image::Pointer > ModelFitResultImageMapType
MITKMODELFIT_EXPORT void StoreResultsInDataStorage(DataStorage *storage, const ModelFitResultNodeVectorType &resultNodes, DataNode *parentNode=nullptr)
Base of all data objects.
static const std::string MODEL_TYPE_PROPERTY_NAME()
MITKMODELFIT_EXPORT mitk::ScalarListLookupTableProperty::Pointer ConvertStaticParametersToProperty(const mitk::modelFit::StaticParameterMap ¶ms)
static const std::string YAXIS_NAME_PROPERTY_NAME()
static const std::string PARAMETER_UNIT_PROPERTY_NAME()
const_iterator end() const
DataCollection - Class to facilitate loading/accessing structured data.
Parameter::ConstPointer GetParameter(const std::string &name, const Parameter::Type &type) const
Searches for the parameter with the given name and type in the fit's parameter list and returns it...
static const std::string MODEL_NAME_PROPERTY_NAME()
Data class for modelfit properties that store a map of lists (e.g. static parameters).
virtual void Add(DataNode *node, const DataStorage::SetOfObjects *parents=nullptr)=0
Adds a DataNode containing a data object to its internal storage.
std::string functionClassID
StaticParameterMap staticParamMap
#define MITKMODELFIT_EXPORT
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
Add new or change existent property.
static const std::string FIT_UID_PROPERTY_NAME()
void AdaptDataPropertyToParameter(mitk::BaseData *data, const ModelBase::ParameterNameType &name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo *fitInfo)
MITKMODELFIT_EXPORT DataNode::Pointer CreateResultNode(const ModelBase::ParameterNameType &name, modelFit::Parameter::Type nodeType, Image *parameterImage, const ModelFitInfo *modelFitInfo)
static const std::string MODEL_FUNCTION_PROPERTY_NAME()
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
mitk::DataNode::Pointer CreateNode(const ModelBase::ParameterNameType &name, Image *parameterImage, const ModelFitInfo *fitInfo)
static const std::string PARAMETER_TYPE_VALUE_DERIVED_PARAMETER()
static const std::string FIT_INPUT_DATA_PROPERTY_NAME()
static void DeriveDICOMSourceProperties(const BaseData *sourceDICOMImage, BaseData *derivedDICOMImage)
static const std::string XAXIS_NAME_PROPERTY_NAME()
MITKMODELFIT_EXPORT void SetModelFitDataProperties(mitk::BaseData *data, const ModelBase::ParameterNameType &name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo *fitInfo)
Image class for storing images.
static const std::string FIT_INPUT_IMAGEUID_PROPERTY_NAME()
std::vector< DataNode::Pointer > ModelFitResultNodeVectorType
MITKMODELFIT_EXPORT ModelFitResultNodeVectorType CreateResultNodeMap(const ModelFitResultImageMapType &results, const ModelFitResultImageMapType &derivedResults, const ModelFitResultImageMapType &criterionResults, const ModelFitResultImageMapType &evaluationResults, const ModelFitInfo *fitInfo)
static const std::string MODEL_X_PROPERTY_NAME()
Data class that stores all information about a modelfit that is relevant to the visualization and sto...
ModelTraitsInterface::ParameterNameType ParameterNameType
const LookupTableType & GetLookupTable() const
Returns the map of lists.
mitk::PropertyList::Pointer GetPropertyList() const
Get the data's property list.
void AdaptDataPropertyToModelFit(mitk::BaseData *data, const modelFit::ModelFitInfo *fitInfo)
static const std::string MODEL_FUNCTION_CLASS_PROPERTY_NAME()
static const std::string PARAMETER_TYPE_VALUE_PARAMETER()
static const std::string FIT_INPUT_ROIUID_PROPERTY_NAME()
static const std::string YAXIS_UNIT_PROPERTY_NAME()
ScalarListLookupTable inputData
static const std::string FIT_STATIC_PARAMETERS_PROPERTY_NAME()
static const std::string FIT_NAME_PROPERTY_NAME()
static const std::string XAXIS_UNIT_PROPERTY_NAME()
static const std::string PARAMETER_NAME_PROPERTY_NAME()
static const std::string PARAMETER_TYPE_PROPERTY_NAME()
static const std::string PARAMETER_SCALE_PROPERTY_NAME()
static const std::string PARAMETER_TYPE_VALUE_EVALUATION_PARAMETER()
Class for nodes of the DataTree.
const_iterator begin() const
MapType::const_iterator const_iterator
Needed for 'foreach' support.