diff --git a/Modules/FitMIData/autoload/IO/CMakeLists.txt b/Modules/FitMIData/autoload/IO/CMakeLists.txt deleted file mode 100644 index 380ed6a748..0000000000 --- a/Modules/FitMIData/autoload/IO/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -MITK_CREATE_MODULE(PerfusionIOServices - DEPENDS - PUBLIC MitkFitMIData - PRIVATE MitkCore - AUTOLOAD_WITH MitkCore -) diff --git a/Modules/FitMIData/autoload/Models/CMakeLists.txt b/Modules/FitMIData/autoload/Models/CMakeLists.txt deleted file mode 100644 index bc85492d5e..0000000000 --- a/Modules/FitMIData/autoload/Models/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -MITK_CREATE_MODULE(FitMIDataModelsServices - DEPENDS - PUBLIC MitkFitMIData - PRIVATE MitkCore - AUTOLOAD_WITH MitkFitMIData -) diff --git a/Modules/FitMIData/cmdapps/CMakeLists.txt b/Modules/FitMIData/cmdapps/CMakeLists.txt deleted file mode 100644 index c70d9ba056..0000000000 --- a/Modules/FitMIData/cmdapps/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -option(BUILD_FitMIDataMiniApps "Build commandline tools for the perfusion module" OFF) - -if(BUILD_FitMIDataMiniApps) - - # needed include directories - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ) - # list of miniapps - # if an app requires additional dependencies - # they are added after a "^^" and separated by "_" - set( miniapps - GenericFittingMiniApp^^ - PixelDumpMiniApp^^ - ) - - foreach(miniapp ${miniapps}) - # extract mini app name and dependencies - string(REPLACE "^^" "\\;" miniapp_info ${miniapp}) - set(miniapp_info_list ${miniapp_info}) - list(GET miniapp_info_list 0 appname) - list(GET miniapp_info_list 1 raw_dependencies) - string(REPLACE "_" "\\;" dependencies "${raw_dependencies}") - set(dependencies_list ${dependencies}) - - mitk_create_executable(${appname} - DEPENDS MitkFitMIData MitkCommandLine ${dependencies_list} - PACKAGE_DEPENDS ITK - CPP_FILES ${appname}.cpp - ) - - if(EXECUTABLE_IS_ENABLED) - # On Linux, create a shell script to start a relocatable application - if(UNIX AND NOT APPLE) - install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh) - endif() - - get_target_property(_is_bundle ${EXECUTABLE_TARGET} MACOSX_BUNDLE) - - if(APPLE) - if(_is_bundle) - set(_target_locations ${EXECUTABLE_TARGET}.app) - set(${_target_locations}_qt_plugins_install_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) - set(_bundle_dest_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) - set(_qt_plugins_for_current_bundle ${EXECUTABLE_TARGET}.app/Contents/MacOS) - set(_qt_conf_install_dirs ${EXECUTABLE_TARGET}.app/Contents/Resources) - install(TARGETS ${EXECUTABLE_TARGET} BUNDLE DESTINATION . ) - else() - if(NOT MACOSX_BUNDLE_NAMES) - set(_qt_conf_install_dirs bin) - set(_target_locations bin/${EXECUTABLE_TARGET}) - set(${_target_locations}_qt_plugins_install_dir bin) - install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) - else() - foreach(bundle_name ${MACOSX_BUNDLE_NAMES}) - list(APPEND _qt_conf_install_dirs ${bundle_name}.app/Contents/Resources) - set(_current_target_location ${bundle_name}.app/Contents/MacOS/${EXECUTABLE_TARGET}) - list(APPEND _target_locations ${_current_target_location}) - set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) - message( " set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) ") - - install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION ${bundle_name}.app/Contents/MacOS/) - endforeach() - endif() - endif() - else() - set(_target_locations bin/${EXECUTABLE_TARGET}${CMAKE_EXECUTABLE_SUFFIX}) - set(${_target_locations}_qt_plugins_install_dir bin) - set(_qt_conf_install_dirs bin) - install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) - endif() - endif() - endforeach() - -endif() diff --git a/Modules/FitMIData/CMakeLists.txt b/Modules/ModelFit/CMakeLists.txt similarity index 93% rename from Modules/FitMIData/CMakeLists.txt rename to Modules/ModelFit/CMakeLists.txt index c9f3089296..6ddd33235a 100644 --- a/Modules/FitMIData/CMakeLists.txt +++ b/Modules/ModelFit/CMakeLists.txt @@ -1,19 +1,19 @@ -MITK_CREATE_MODULE(FitMIData +MITK_CREATE_MODULE(ModelFit INCLUDE_DIRS PUBLIC ${MITK_BINARY_DIR} PRIVATE src/Common src/Functors src/Models src/TestingHelper DEPENDS PUBLIC MitkCore MitkSceneSerializationBase PRIVATE MitkMultilabel PACKAGE_DEPENDS PUBLIC ITK|ITKOptimizers PRIVATE Boost ) if(BUILD_TESTING) ADD_SUBDIRECTORY(test) endif(BUILD_TESTING) ADD_SUBDIRECTORY(autoload/IO) ADD_SUBDIRECTORY(autoload/Models) ADD_SUBDIRECTORY(cmdapps) diff --git a/Modules/ModelFit/autoload/IO/CMakeLists.txt b/Modules/ModelFit/autoload/IO/CMakeLists.txt new file mode 100644 index 0000000000..64fbc9b5f1 --- /dev/null +++ b/Modules/ModelFit/autoload/IO/CMakeLists.txt @@ -0,0 +1,6 @@ +MITK_CREATE_MODULE(ModelFitIOServices + DEPENDS + PUBLIC MitkModelFit + PRIVATE MitkCore + AUTOLOAD_WITH MitkCore +) diff --git a/Modules/FitMIData/autoload/IO/files.cmake b/Modules/ModelFit/autoload/IO/files.cmake similarity index 68% rename from Modules/FitMIData/autoload/IO/files.cmake rename to Modules/ModelFit/autoload/IO/files.cmake index def5b6e75b..8452a05661 100644 --- a/Modules/FitMIData/autoload/IO/files.cmake +++ b/Modules/ModelFit/autoload/IO/files.cmake @@ -1,12 +1,12 @@ set(CPP_FILES - mitkFitMIDataIOActivator.cpp + mitkModelFitIOActivator.cpp ) set(H_FILES ) set(TPP_FILES ) set(MOC_H_FILES ) diff --git a/Modules/FitMIData/autoload/IO/mitkFitMIDataIOActivator.cpp b/Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp similarity index 96% rename from Modules/FitMIData/autoload/IO/mitkFitMIDataIOActivator.cpp rename to Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp index ba150065dd..404470f04d 100644 --- a/Modules/FitMIData/autoload/IO/mitkFitMIDataIOActivator.cpp +++ b/Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include #include namespace mitk { /* - * This is the module activator for the IO aspects of the "perfusion" module. + * This is the module activator for the IO aspects of the "ModelFit" module. */ -class PerfusionIOActivator : public us::ModuleActivator +class ModelFitIOActivator : public us::ModuleActivator { public: void registerProperty(const std::string& name, const std::string& key, const std::string& description) { mitk::CoreServices::GetPropertyDescriptions()->AddDescription(name, description); mitk::PropertyPersistenceInfo::Pointer ppi = mitk::PropertyPersistenceInfo::New(); ppi->SetNameAndKey(name, key); mitk::CoreServices::GetPropertyPersistence()->AddInfo(ppi, true); } void registerProperty(const std::string& name, const std::string& key, const std::string& description, const PropertyPersistenceInfo::DeserializationFunctionType &deFnc, const PropertyPersistenceInfo::SerializationFunctionType &serFnc) { mitk::CoreServices::GetPropertyDescriptions()->AddDescription(name, description); mitk::PropertyPersistenceInfo::Pointer ppi = mitk::PropertyPersistenceInfo::New(); ppi->SetNameAndKey(name, key); ppi->SetDeserializationFunction(deFnc); ppi->SetSerializationFunction(serFnc); mitk::CoreServices::GetPropertyPersistence()->AddInfo(ppi, true); } void Load(us::ModuleContext* /*context*/) { //register relevant properties registerProperty(mitk::ModelFitConstants::UID_PROPERTY_NAME(), "data_uid", "UID used to identify data in an MITK session."); registerProperty(mitk::ModelFitConstants::INPUT_VARIABLES_PROPERTY_NAME(), "modelfit_input_variables", "Array of input variables used in/for a model fit.", PropertyPersistenceDeserialization::deserializeXMLToScalarListLookupTableProperty, PropertyPersistenceSerialization::serializeScalarListLookupTablePropertyToXML); registerProperty(mitk::ModelFitConstants::PARAMETER_NAME_PROPERTY_NAME(), "modelfit_parameter_name", "Name of the parameter, that is represented by the data and how it is used in the function string (modelfit.model.function)."); registerProperty(mitk::ModelFitConstants::PARAMETER_UNIT_PROPERTY_NAME(), "modelfit_parameter_unit", "Unit string of the Parameter. Is only used for display. Default value: \"\" (no unit)"); registerProperty(mitk::ModelFitConstants::PARAMETER_SCALE_PROPERTY_NAME(), "modelfit_parameter_scale", "Scaling of the parameter. Default value: 1."); registerProperty(mitk::ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME(), "modelfit_parameter_type", "Type of the parameters. Default value: parameter. Other options: derived, criterion, evaluation."); registerProperty(mitk::ModelFitConstants::MODEL_TYPE_PROPERTY_NAME(), "modelfit_model_type", "Value specifies the type of model (helpfull for classification; e.g. MR perfusion)"); registerProperty(mitk::ModelFitConstants::MODEL_NAME_PROPERTY_NAME(), "modelfit_model_name", "Name of the specific fit. Only used for display."); registerProperty(mitk::ModelFitConstants::MODEL_FUNCTION_PROPERTY_NAME(), "modelfit_model_function", "Functions string, that specifies the model and will be parsed, to plot the curves based on the parameter. Optional parameter that must not be set."); registerProperty(mitk::ModelFitConstants::MODEL_FUNCTION_CLASS_PROPERTY_NAME(), "modelfit_model_functionClass", "ID of the model class implementation."); registerProperty(mitk::ModelFitConstants::MODEL_X_PROPERTY_NAME(), "modelfit_model_x", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::XAXIS_NAME_PROPERTY_NAME(), "modelfit_xaxis_name", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::XAXIS_UNIT_PROPERTY_NAME(), "modelfit_xaxis_unit", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::YAXIS_NAME_PROPERTY_NAME(), "modelfit_yaxis_name", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::YAXIS_UNIT_PROPERTY_NAME(), "modelfit_yaxis_unit", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME(), "modelfit_fit_uid", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_TYPE_PROPERTY_NAME(), "modelfit_fit_type", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_INPUT_IMAGEUID_PROPERTY_NAME(), "modelfit_fit_input_imageUID", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_INPUT_ROIUID_PROPERTY_NAME(), "modelfit_fit_input_roiUID", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_INPUT_DATA_PROPERTY_NAME(), "modelfit_fit_input_data", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_STATIC_PARAMETERS_PROPERTY_NAME(), "modelfit_fit_staticParameters", "Value identifies the model type.", PropertyPersistenceDeserialization::deserializeXMLToScalarListLookupTableProperty, PropertyPersistenceSerialization::serializeScalarListLookupTablePropertyToXML); } void Unload(us::ModuleContext* ) { } private: }; } -US_EXPORT_MODULE_ACTIVATOR(mitk::PerfusionIOActivator) +US_EXPORT_MODULE_ACTIVATOR(mitk::ModelFitIOActivator) diff --git a/Modules/ModelFit/autoload/Models/CMakeLists.txt b/Modules/ModelFit/autoload/Models/CMakeLists.txt new file mode 100644 index 0000000000..1f15532ba7 --- /dev/null +++ b/Modules/ModelFit/autoload/Models/CMakeLists.txt @@ -0,0 +1,6 @@ +MITK_CREATE_MODULE(ModelFitModelsServices + DEPENDS + PUBLIC MitkModelFit + PRIVATE MitkCore + AUTOLOAD_WITH MitkModelFit +) diff --git a/Modules/FitMIData/autoload/Models/files.cmake b/Modules/ModelFit/autoload/Models/files.cmake similarity index 65% rename from Modules/FitMIData/autoload/Models/files.cmake rename to Modules/ModelFit/autoload/Models/files.cmake index d087d89cff..911de0a41f 100644 --- a/Modules/FitMIData/autoload/Models/files.cmake +++ b/Modules/ModelFit/autoload/Models/files.cmake @@ -1,12 +1,12 @@ set(CPP_FILES - mitkFitMIDataModelsActivator.cpp + mitkModelFitModelsActivator.cpp ) set(H_FILES ) set(TPP_FILES ) set(MOC_H_FILES ) diff --git a/Modules/FitMIData/autoload/Models/mitkFitMIDataModelsActivator.cpp b/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp similarity index 88% rename from Modules/FitMIData/autoload/Models/mitkFitMIDataModelsActivator.cpp rename to Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp index 48ef1339b0..6d7895d695 100644 --- a/Modules/FitMIData/autoload/Models/mitkFitMIDataModelsActivator.cpp +++ b/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include //general models #include "mitkGenericParamModelFactory.h" #include "mitkLinearModelFactory.h" #include "mitkT2DecayModelFactory.h" namespace mitk { /* - * This is the module activator for the IO aspects of the "perfusion" module. + * This is the module activator for the IO aspects of the "ModelFit" module. */ -class PerfusionModelsActivator : public us::ModuleActivator +class ModelFitModelsActivator : public us::ModuleActivator { public: template void RegisterProvider(us::ModuleContext* context) { auto provider = new TProvider(); provider->RegisterService(context); m_RegisteredProviders.push_back(std::unique_ptr(provider)); } virtual void Load(us::ModuleContext* context) override { m_RegisteredProviders.clear(); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); } virtual void Unload(us::ModuleContext* ) override { } private: std::vector > m_RegisteredProviders; }; } -US_EXPORT_MODULE_ACTIVATOR(mitk::PerfusionModelsActivator) +US_EXPORT_MODULE_ACTIVATOR(mitk::ModelFitModelsActivator) diff --git a/Modules/ModelFit/cmdapps/CMakeLists.txt b/Modules/ModelFit/cmdapps/CMakeLists.txt new file mode 100644 index 0000000000..f78ad56dda --- /dev/null +++ b/Modules/ModelFit/cmdapps/CMakeLists.txt @@ -0,0 +1,34 @@ +option(BUILD_ModelFitMiniApps "Build commandline tools for the ModelFit module" OFF) + +if(BUILD_ModelFitMiniApps OR MITK_BUILD_ALL_APPS) + + # needed include directories + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ) + # list of miniapps + # if an app requires additional dependencies + # they are added after a "^^" and separated by "_" + set( miniapps + GenericFittingMiniApp^^ + PixelDumpMiniApp^^ + ) + + foreach(miniapp ${miniapps}) + # extract mini app name and dependencies + string(REPLACE "^^" "\\;" miniapp_info ${miniapp}) + set(miniapp_info_list ${miniapp_info}) + list(GET miniapp_info_list 0 appname) + list(GET miniapp_info_list 1 raw_dependencies) + string(REPLACE "_" "\\;" dependencies "${raw_dependencies}") + set(dependencies_list ${dependencies}) + + mitkFunctionCreateCommandLineApp( + NAME ${appname} + DEPENDS MitkCore MitkModelFit ${dependencies_list} + PACKAGE_DEPENDS ITK + ) + endforeach() + +endif(BUILD_ModelFitMiniApps OR MITK_BUILD_ALL_APPS) diff --git a/Modules/FitMIData/cmdapps/GenericFittingMiniApp.cpp b/Modules/ModelFit/cmdapps/GenericFittingMiniApp.cpp similarity index 100% rename from Modules/FitMIData/cmdapps/GenericFittingMiniApp.cpp rename to Modules/ModelFit/cmdapps/GenericFittingMiniApp.cpp diff --git a/Modules/FitMIData/cmdapps/PixelDumpMiniApp.cpp b/Modules/ModelFit/cmdapps/PixelDumpMiniApp.cpp similarity index 100% rename from Modules/FitMIData/cmdapps/PixelDumpMiniApp.cpp rename to Modules/ModelFit/cmdapps/PixelDumpMiniApp.cpp diff --git a/Modules/FitMIData/files.cmake b/Modules/ModelFit/files.cmake similarity index 100% rename from Modules/FitMIData/files.cmake rename to Modules/ModelFit/files.cmake diff --git a/Modules/FitMIData/include/itkMaskedNaryStatisticsImageFilter.h b/Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.h similarity index 100% rename from Modules/FitMIData/include/itkMaskedNaryStatisticsImageFilter.h rename to Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.h diff --git a/Modules/FitMIData/include/itkMaskedNaryStatisticsImageFilter.hxx b/Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.hxx similarity index 100% rename from Modules/FitMIData/include/itkMaskedNaryStatisticsImageFilter.hxx rename to Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.hxx diff --git a/Modules/FitMIData/include/itkMaskedStatisticsImageFilter.h b/Modules/ModelFit/include/itkMaskedStatisticsImageFilter.h similarity index 100% rename from Modules/FitMIData/include/itkMaskedStatisticsImageFilter.h rename to Modules/ModelFit/include/itkMaskedStatisticsImageFilter.h diff --git a/Modules/FitMIData/include/itkMaskedStatisticsImageFilter.hxx b/Modules/ModelFit/include/itkMaskedStatisticsImageFilter.hxx similarity index 100% rename from Modules/FitMIData/include/itkMaskedStatisticsImageFilter.hxx rename to Modules/ModelFit/include/itkMaskedStatisticsImageFilter.hxx diff --git a/Modules/FitMIData/include/itkMultiOutputNaryFunctorImageFilter.h b/Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.h similarity index 100% rename from Modules/FitMIData/include/itkMultiOutputNaryFunctorImageFilter.h rename to Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.h diff --git a/Modules/FitMIData/include/itkMultiOutputNaryFunctorImageFilter.tpp b/Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.tpp similarity index 100% rename from Modules/FitMIData/include/itkMultiOutputNaryFunctorImageFilter.tpp rename to Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.tpp diff --git a/Modules/FitMIData/include/mitkBinaryImageToLabelSetImageFilter.h b/Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h similarity index 93% rename from Modules/FitMIData/include/mitkBinaryImageToLabelSetImageFilter.h rename to Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h index b165be6ee4..c11a782db6 100644 --- a/Modules/FitMIData/include/mitkBinaryImageToLabelSetImageFilter.h +++ b/Modules/ModelFit/include/mitkBinaryImageToLabelSetImageFilter.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkBinaryImageToLabelSetImageFilter_h #define mitkBinaryImageToLabelSetImageFilter_h #include #include "mitkCommon.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** \brief Converts an binary image to a LabelSetImage. The amount of labels equals the connected components. */ - class MITKFITMIDATA_EXPORT BinaryImageToLabelSetImageFilter : public ImageToImageFilter + class MITKMODELFIT_EXPORT BinaryImageToLabelSetImageFilter : public ImageToImageFilter { public: mitkClassMacro(BinaryImageToLabelSetImageFilter, ImageToImageFilter); itkFactorylessNewMacro(Self) itkCloneMacro(Self) void SetInput(const InputImageType* image) override; void SetInput(unsigned int index, const InputImageType* image) override; itkSetMacro(FullyConnected, bool); itkGetConstMacro(FullyConnected, bool); itkSetMacro(ForegroundValue, unsigned int); itkGetConstMacro(ForegroundValue, unsigned int); itkSetMacro(OutputIsLabelSetImage, bool); itkGetConstMacro(OutputIsLabelSetImage, bool); private: using Superclass::SetInput; BinaryImageToLabelSetImageFilter() = default; ~BinaryImageToLabelSetImageFilter() override = default; template void ApplyBinaryImageToLabelMapFilter(const itk::Image* inputImage); void GenerateData() override; void VerifyInputInformation() override; void VerifyInputImage(const mitk::Image* inputImage); bool m_FullyConnected = true; unsigned int m_ForegroundValue = 1; bool m_OutputIsLabelSetImage = false; }; } #endif diff --git a/Modules/FitMIData/include/mitkChiSquareFitCostFunction.h b/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h similarity index 86% rename from Modules/FitMIData/include/mitkChiSquareFitCostFunction.h rename to Modules/ModelFit/include/mitkChiSquareFitCostFunction.h index b6de467169..cb96da86bb 100644 --- a/Modules/FitMIData/include/mitkChiSquareFitCostFunction.h +++ b/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h @@ -1,39 +1,39 @@ #ifndef CHI_SQUARE_FITCOSTFUNCTION_H #define CHI_SQUARE_FITCOSTFUNCTION_H #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the Chi square. NOTE: This is only for Data from Radioactive Decays (e.g. PET, SPECT) */ -class MITKFITMIDATA_EXPORT ChiSquareFitCostFunction : public mitk::SVModelFitCostFunction +class MITKMODELFIT_EXPORT ChiSquareFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef ChiSquareFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; ChiSquareFitCostFunction() { } ~ChiSquareFitCostFunction(){} }; } #endif // CHISQUAREFITCOSTFUNCTION_H diff --git a/Modules/FitMIData/include/mitkConcreteModelFactoryBase.h b/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h similarity index 99% rename from Modules/FitMIData/include/mitkConcreteModelFactoryBase.h rename to Modules/ModelFit/include/mitkConcreteModelFactoryBase.h index 09a8fefc11..9cc6238bd2 100644 --- a/Modules/FitMIData/include/mitkConcreteModelFactoryBase.h +++ b/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h @@ -1,176 +1,176 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __CONCRETE_MODEL_FACTORY_BASE_H #define __CONCRETE_MODEL_FACTORY_BASE_H #include "mitkModelFactoryBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { template class ConcreteModelFactoryBase : public ModelFactoryBase { public: /* typedef ConcreteModelFactoryBase Self; typedef ModelFactoryBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; */ mitkClassMacro(ConcreteModelFactoryBase, ModelFactoryBase); typedef ModelFactoryBase::ModelBaseType ModelBaseType; typedef ModelFactoryBase::ModelBasePointer ModelBasePointer; typedef TModel ModelType; typedef typename ModelType::Pointer ModelPointer; typedef ModelFactoryBase::ParameterNameType ParameterNameType; typedef ModelFactoryBase::ParameterNamesType ParameterNamesType; typedef ModelFactoryBase::ParametersSizeType ParametersSizeType; typedef ModelFactoryBase::ParamterScaleMapType ParamterScaleMapType; typedef ModelFactoryBase::ParamterUnitMapType ParamterUnitMapType; typedef ModelFactoryBase::DerivedParameterNamesType DerivedParameterNamesType; typedef ModelFactoryBase::DerivedParametersSizeType DerivedParametersSizeType; typedef ModelFactoryBase::DerivedParamterScaleMapType DerivedParamterScaleMapType; typedef ModelFactoryBase::DerivedParamterUnitMapType DerivedParamterUnitMapType; typedef ModelFactoryBase::FunctionStringType FunctionStringType; typedef ModelFactoryBase::ModellClassIDType ModellClassIDType; static ModelPointer CreateConcreteModel() { return ModelType::New(); } virtual ModelBasePointer CreateModel() const override { return CreateConcreteModel().GetPointer(); }; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override { ConstraintCheckerBase::Pointer noConstraints; return noConstraints; }; virtual ParameterNamesType GetParameterNames() const override { return m_Reference->GetParameterNames(); }; virtual ParametersSizeType GetNumberOfParameters() const override { return m_Reference->GetNumberOfParameters(); }; virtual ParamterScaleMapType GetParameterScales() const override { return m_Reference->GetParameterScales(); }; virtual ParamterUnitMapType GetParameterUnits() const override { return m_Reference->GetParameterUnits(); }; virtual ParameterNamesType GetDerivedParameterNames() const override { return m_Reference->GetDerivedParameterNames(); }; virtual ParametersSizeType GetNumberOfDerivedParameters() const override { return m_Reference->GetNumberOfDerivedParameters(); }; virtual DerivedParamterScaleMapType GetDerivedParameterScales() const override { return m_Reference->GetDerivedParameterScales(); }; virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const override { return m_Reference->GetDerivedParameterUnits(); }; virtual std::string GetModelDisplayName() const override { return m_Reference->GetModelDisplayName(); }; virtual std::string GetModelType() const override { return m_Reference->GetModelType(); }; virtual FunctionStringType GetFunctionString() const override { return m_Reference->GetFunctionString(); }; virtual ModellClassIDType GetClassID() const override { return m_Reference->GetClassID(); }; virtual std::string GetXName() const override { return m_Reference->GetXName(); }; virtual std::string GetXAxisName() const override { return m_Reference->GetXAxisName(); }; virtual std::string GetXAxisUnit() const override { return m_Reference->GetXAxisUnit(); }; virtual std::string GetYAxisName() const override { return m_Reference->GetYAxisName(); }; virtual std::string GetYAxisUnit() const override { return m_Reference->GetYAxisUnit(); } protected: ConcreteModelFactoryBase() { m_Reference = ModelType::New(); }; virtual ~ConcreteModelFactoryBase() { }; ModelPointer m_Reference; private: //No copy constructor allowed ConcreteModelFactoryBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __CONCRETE_MODEL_FACTORY_BASE_H diff --git a/Modules/FitMIData/include/mitkConcreteModelParameterizerBase.h b/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h similarity index 100% rename from Modules/FitMIData/include/mitkConcreteModelParameterizerBase.h rename to Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h diff --git a/Modules/FitMIData/include/mitkConstraintCheckerBase.h b/Modules/ModelFit/include/mitkConstraintCheckerBase.h similarity index 92% rename from Modules/FitMIData/include/mitkConstraintCheckerBase.h rename to Modules/ModelFit/include/mitkConstraintCheckerBase.h index db87677b3b..674be6d874 100644 --- a/Modules/FitMIData/include/mitkConstraintCheckerBase.h +++ b/Modules/ModelFit/include/mitkConstraintCheckerBase.h @@ -1,66 +1,66 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CONSTRAINT_CHECKER_BASE_H #define CONSTRAINT_CHECKER_BASE_H #include #include #include "mitkConstraintCheckerInterface.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** \class ConstraintCheckerBase * \brief This class is the base class for constraint checker. * @remark All functions of the ConstraintCheckerInterface must be implemented thread save because it will be used in a multi threaded * environment. */ -class MITKFITMIDATA_EXPORT ConstraintCheckerBase : public itk::Object, public ConstraintCheckerInterface +class MITKMODELFIT_EXPORT ConstraintCheckerBase : public itk::Object, public ConstraintCheckerInterface { public: typedef ConstraintCheckerBase Self; typedef ConstraintCheckerInterface Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::PenaltyValueType PenaltyValueType; typedef Superclass::PenaltyArrayType PenaltyArrayType; typedef Superclass::SignalType SignalType; typedef Superclass::ParametersType ParametersType; virtual PenaltyValueType GetPenaltySum(const ParametersType ¶meters) const; protected: ConstraintCheckerBase() { } ~ConstraintCheckerBase(){} private: ConstraintCheckerBase(const ConstraintCheckerBase& source); void operator=(const ConstraintCheckerBase&); //purposely not implemented }; } #endif // ConstraintCheckerBase_H diff --git a/Modules/FitMIData/include/mitkConstraintCheckerInterface.h b/Modules/ModelFit/include/mitkConstraintCheckerInterface.h similarity index 96% rename from Modules/FitMIData/include/mitkConstraintCheckerInterface.h rename to Modules/ModelFit/include/mitkConstraintCheckerInterface.h index a1e2cd1152..0ed97e430d 100644 --- a/Modules/FitMIData/include/mitkConstraintCheckerInterface.h +++ b/Modules/ModelFit/include/mitkConstraintCheckerInterface.h @@ -1,73 +1,73 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CONSTRAINTCHECKER_INTERFACE_H #define CONSTRAINTCHECKER_INTERFACE_H #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Interface class that is implemented by all constraint checkers that are used in the context of model fitting. * @remark All functions of the interface must be implemented thread save because it will be used in a multi threaded * environment. */ - class MITKFITMIDATA_EXPORT ConstraintCheckerInterface + class MITKMODELFIT_EXPORT ConstraintCheckerInterface { public: typedef ConstraintCheckerInterface Self; typedef double PenaltyValueType; typedef itk::Array PenaltyArrayType; typedef itk::Array SignalType; typedef ModelBase::ParametersType ParametersType; /** Returns the penalties for all defined constraints. * @pre defined constraints must address valid parameters in the passed parameters set. * @post the result vector has the size given by GetNumberOfConstraints(). */ virtual PenaltyArrayType GetPenalties(const ParametersType ¶meters) const = 0; /** Returns the sum of all penalties. * @pre defined constraints must address valid parameters in the passed parameters set. */ virtual PenaltyValueType GetPenaltySum(const ParametersType ¶meters) const = 0; /** Returns the number of defined constraints, that will be checked. Thus also the size of the penalty vector.*/ virtual unsigned int GetNumberOfConstraints() const = 0; /** Returns the penalty value that indicates at least one failed constrained.*/ virtual PenaltyValueType GetFailedConstraintValue() const = 0; protected: ConstraintCheckerInterface() {} virtual ~ConstraintCheckerInterface() {} private: ConstraintCheckerInterface(const ConstraintCheckerInterface& source); void operator=(const ConstraintCheckerInterface&); //purposely not implemented }; } #endif // MODELFITCOSTFUNCTION_H diff --git a/Modules/FitMIData/include/mitkDummyModelFitFunctor.h b/Modules/ModelFit/include/mitkDummyModelFitFunctor.h similarity index 95% rename from Modules/FitMIData/include/mitkDummyModelFitFunctor.h rename to Modules/ModelFit/include/mitkDummyModelFitFunctor.h index e264356a54..ca9c086126 100644 --- a/Modules/FitMIData/include/mitkDummyModelFitFunctor.h +++ b/Modules/ModelFit/include/mitkDummyModelFitFunctor.h @@ -1,80 +1,80 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __DUMMYMODELFITFUNCTOR_H #define __DUMMYMODELFITFUNCTOR_H #include #include "mitkModelBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkMVConstrainedCostFunctionDecorator.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT DummyModelFitFunctor : public ModelFitFunctorBase + class MITKMODELFIT_EXPORT DummyModelFitFunctor : public ModelFitFunctorBase { public: typedef DummyModelFitFunctor Self; typedef ModelFitFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); itkTypeMacro(DummyModelFitFunctor, ModelFitFunctorBase); typedef Superclass::InputPixelArrayType InputPixelArrayType; typedef Superclass::OutputPixelArrayType OutputPixelArrayType; itkSetMacro(DerivativeStepLength, double); itkGetMacro(DerivativeStepLength, double); virtual ParameterNamesType GetCriterionNames() const; protected: typedef Superclass::ParametersType ParametersType; typedef Superclass::SignalType SignalType; DummyModelFitFunctor(); ~DummyModelFitFunctor(); virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters, DebugParameterMapType& debugParameters) const; virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, const SignalType& sample) const; /** Generator function that instantiates and parameterizes the cost function that should be used by the fit functor*/ virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value, const ModelBase* model) const; virtual ParameterNamesType DefineDebugParameterNames() const; private: double m_DerivativeStepLength; }; } #endif // __DUMMYMODELFITFUNCTOR_H diff --git a/Modules/FitMIData/include/mitkExtractTimeGrid.h b/Modules/ModelFit/include/mitkExtractTimeGrid.h similarity index 84% rename from Modules/FitMIData/include/mitkExtractTimeGrid.h rename to Modules/ModelFit/include/mitkExtractTimeGrid.h index 53541a0687..90cfdb9530 100644 --- a/Modules/FitMIData/include/mitkExtractTimeGrid.h +++ b/Modules/ModelFit/include/mitkExtractTimeGrid.h @@ -1,44 +1,44 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_EXTRACT_TIME_GRID_H_ #define __MITK_EXTRACT_TIME_GRID_H_ #include #include #include #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /*Extracts the time grid of an image (its time geometry) for usage with models. * Time grid is empty (size == 0) if image pointer is invalid. * @remark the model time grid has a resolution in sec and not ms like the time geometry.*/ - MITKFITMIDATA_EXPORT ModelBase::TimeGridType ExtractTimeGrid(const Image* image); + MITKMODELFIT_EXPORT ModelBase::TimeGridType ExtractTimeGrid(const Image* image); /*Extracts the time grid of a time geometry for usage with models. * Time grid is empty (size == 0) if geometry pointer is invalid. * @remark the model time grid has a resolution in sec and not ms like the time geometry.*/ - MITKFITMIDATA_EXPORT ModelBase::TimeGridType ExtractTimeGrid(const TimeGeometry* geometry); + MITKMODELFIT_EXPORT ModelBase::TimeGridType ExtractTimeGrid(const TimeGeometry* geometry); } #endif diff --git a/Modules/FitMIData/include/mitkFormulaParser.h b/Modules/ModelFit/include/mitkFormulaParser.h similarity index 96% rename from Modules/FitMIData/include/mitkFormulaParser.h rename to Modules/ModelFit/include/mitkFormulaParser.h index feba5c6fc4..5ad3b291c8 100644 --- a/Modules/FitMIData/include/mitkFormulaParser.h +++ b/Modules/ModelFit/include/mitkFormulaParser.h @@ -1,111 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITKFORMULAPARSER_H__ #define __MITKFORMULAPARSER_H__ #include #include #include "mitkExceptionMacro.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /*! * @brief Exception class for all exceptions that are generated in the FormulaParser module. */ - class MITKFITMIDATA_EXPORT FormulaParserException : public mitk::Exception + class MITKMODELFIT_EXPORT FormulaParserException : public mitk::Exception { public: mitkExceptionClassMacro(FormulaParserException, mitk::Exception); }; /*! * @brief This class offers the functionality to evaluate simple mathematical formula * strings (e.g. "3.5 + 4 * x * sin(x) - 1 / 2"). * @details Internally it utilizes the @c boost::spirit framework with the @ref Grammar * structure to parse the input string into a valid result number. * Function strings (e.g. @c "sin", @c "tan" or @c "abs") are translated to * actual function calls and variables (e.g. @c "x", @c "myVariable", "amount_") * are replaced by their currently assigned value via a look-up table. * * The parser is able to recognize: * @li sums, differences, products and divisions (a + b, * 4 - 3, 2 * x, 9 / 3) * @li algebraic signs (@c +5, @c -5) * @li exponentiation (2 ^ 4) * @li parentheses (3 * (4 + 2)) * @li variables (@c x, @c myVar, @c test2_var_) * @li the following unary functions: @c abs, @c exp, @c sin, @c cos, @c tan, * @c sind (sine in degrees), @c cosd (cosine in degrees), @c tand (tangent in * degrees) * * In order to use the FormulaParser you just have to initialize it with a map of * variables (i.e. a look-up table where @c "x" is assigned to @c 5 for example and * @c "y" is assigned to @c 13 and so on) and then call the * @ref FormulaParser::parse function with the string that should be evaluated. Be * sure to update the look-up table everytime a variable's value changes since that * is not done automatically. * * @author Sascha Diatschuk */ - class MITKFITMIDATA_EXPORT FormulaParser + class MITKMODELFIT_EXPORT FormulaParser { public: using ValueType = double; using VariableMapType = std::map; /*! * @brief Construct the FormulaParser and initialized the variables with * @b variables. * @param[in] variables A map of variables with values that will be assigned to the * corresponding member variable. The map is delivered as a * pointer so you can still change it from outside this class. */ FormulaParser(const VariableMapType* variables); /*! * @brief Evaluates the @b input string and returns the resulting * value. * @param[in] input The string to be evaluated. * @return The number that results from the evaluated string. * @throw FormulaParserException If * @li the parser comes across an unexpected character, * @li a variable in the input string could not be found in the look-up * table or * @li the parser cannot apply the grammar to the string at all. */ ValueType parse(const std::string& input); /*! * @brief Looks up the associated value of the given string @b var in the * variables map. * @param[in] var The name of the variable whose value is to be returned. * @return The associated value of the given variable name. * @throw FormulaParserException If the variable map is empty or the given variable name * cannot be found. */ ValueType lookupVariable(const std::string var); private: /*! @brief Map that holds the values that will replace the variables during evaluation. */ const VariableMapType* m_Variables; }; } #endif diff --git a/Modules/FitMIData/include/mitkFresnel.h b/Modules/ModelFit/include/mitkFresnel.h similarity index 100% rename from Modules/FitMIData/include/mitkFresnel.h rename to Modules/ModelFit/include/mitkFresnel.h diff --git a/Modules/FitMIData/include/mitkGaussianNoiseFunctor.h b/Modules/ModelFit/include/mitkGaussianNoiseFunctor.h similarity index 100% rename from Modules/FitMIData/include/mitkGaussianNoiseFunctor.h rename to Modules/ModelFit/include/mitkGaussianNoiseFunctor.h diff --git a/Modules/FitMIData/include/mitkGenericParamModel.h b/Modules/ModelFit/include/mitkGenericParamModel.h similarity index 97% rename from Modules/FitMIData/include/mitkGenericParamModel.h rename to Modules/ModelFit/include/mitkGenericParamModel.h index 3bd18360bb..7d6fb8a78e 100644 --- a/Modules/FitMIData/include/mitkGenericParamModel.h +++ b/Modules/ModelFit/include/mitkGenericParamModel.h @@ -1,112 +1,112 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_GENERIC_PARAM_MODEL_H_ #define __MITK_GENERIC_PARAM_MODEL_H_ #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Model that can parse a user specified function string and uses it as model function that is represented by the model instance. The parser used to interpret the string can handle simple mathematical formulas (e.g. "3.5 + a * x * sin(x) - 1 / 2"). The parser is able to recognize: - sums, differences, products and divisions (a + b, 4 - 3, 2 * x, 9 / 3) - algebraic signs ( +5, -5) - exponentiation ( 2 ^ 4 ) - parentheses (3 * (4 + 2)) - following unary functions: abs, exp, sin, cos, tan, sind (sine in degrees), cosd (cosine in degrees), tand (tangent in degrees) - variables (x, a, b, ... j) Remark: The variable "x" is reserved. It is the signal position / timepoint. Remark: The current version supports up to 10 model parameter. Don't use it for a model parameter that should be deduced by fitting (these are a..j).*/ - class MITKFITMIDATA_EXPORT GenericParamModel : public mitk::ModelBase + class MITKMODELFIT_EXPORT GenericParamModel : public mitk::ModelBase { public: typedef GenericParamModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(GenericParamModel, ModelBase); static const std::string NAME_STATIC_PARAMETER_number; virtual std::string GetModelDisplayName() const override; virtual std::string GetModelType() const override; virtual FunctionStringType GetFunctionString() const override; itkSetStringMacro(FunctionString); /**@pre The Number of paremeters must be between 1 and 10.*/ itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10); virtual std::string GetXName() const override; virtual ParameterNamesType GetParameterNames() const override; virtual ParametersSizeType GetNumberOfParameters() const override; virtual ParameterNamesType GetStaticParameterNames() const override; virtual ParametersSizeType GetNumberOfStaticParameters() const override; protected: GenericParamModel(); virtual ~GenericParamModel() {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ virtual itk::LightObject::Pointer InternalClone() const; virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values); virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; private: /**Function string that should be parsed when computing the model function.*/ FunctionStringType m_FunctionString; /**Number of parameters the model should offer / the function string contains.*/ ParametersSizeType m_NumberOfParameters; //No copy constructor allowed GenericParamModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif \ No newline at end of file diff --git a/Modules/FitMIData/include/mitkGenericParamModelFactory.h b/Modules/ModelFit/include/mitkGenericParamModelFactory.h similarity index 94% rename from Modules/FitMIData/include/mitkGenericParamModelFactory.h rename to Modules/ModelFit/include/mitkGenericParamModelFactory.h index 249ac5738c..c487b37532 100644 --- a/Modules/FitMIData/include/mitkGenericParamModelFactory.h +++ b/Modules/ModelFit/include/mitkGenericParamModelFactory.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __GENERIC_PARAM_MODEL_FACTORY_H #define __GENERIC_PARAM_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkGenericParamModel.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT GenericParamModelFactory : public + class MITKMODELFIT_EXPORT GenericParamModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(GenericParamModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const override; protected: virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const override; GenericParamModelFactory(); virtual ~GenericParamModelFactory(); private: //No copy constructor allowed GenericParamModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__GENERIC_PARAM_MODEL_FACTORY_H diff --git a/Modules/FitMIData/include/mitkGenericParamModelParameterizer.h b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h similarity index 96% rename from Modules/FitMIData/include/mitkGenericParamModelParameterizer.h rename to Modules/ModelFit/include/mitkGenericParamModelParameterizer.h index ed01b341be..e52f90b7cb 100644 --- a/Modules/FitMIData/include/mitkGenericParamModelParameterizer.h +++ b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __GENERIC_PARAM_MODEL_PARAMETERIZER_H #define __GENERIC_PARAM_MODEL_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkGenericParamModel.h" namespace mitk { /** Parameterizer for the GenricParamModel. */ - class MITKFITMIDATA_EXPORT GenericParamModelParameterizer : public ConcreteModelParameterizerBase + class MITKMODELFIT_EXPORT GenericParamModelParameterizer : public ConcreteModelParameterizerBase { public: typedef GenericParamModelParameterizer Self; typedef ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(GenericParamModelParameterizer, ConcreteModelParameterizerBase); itkFactorylessNewMacro(Self); typedef typename Superclass::ModelBaseType ModelBaseType; typedef typename Superclass::ModelBasePointer ModelBasePointer; typedef typename Superclass::ModelType ModelType; typedef typename Superclass::ModelPointer ModelPointer; typedef typename Superclass::StaticParameterValueType StaticParameterValueType; typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType; typedef typename Superclass::StaticParameterMapType StaticParameterMapType; typedef typename Superclass::IndexType IndexType; itkSetMacro(FunctionString, mitk::ModelBase::FunctionStringType); /**@pre The Number of paremeters must be between 1 and 10.*/ itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10); virtual mitk::ModelBase::FunctionStringType GetFunctionString() const override; using Superclass::GenerateParameterizedModel; virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const; virtual StaticParameterMapType GetGlobalStaticParameters() const override; virtual ParametersType GetDefaultInitialParameterization() const override; protected: GenericParamModelParameterizer(); virtual ~GenericParamModelParameterizer(); mitk::ModelBase::FunctionStringType m_FunctionString; /**Number of parameters the model should offer / the function string contains.*/ ParametersSizeType m_NumberOfParameters; private: //No copy constructor allowed GenericParamModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __GENERIC_PARAM_MODEL_PARAMETERIZER_H diff --git a/Modules/FitMIData/include/mitkIModelFitProvider.h b/Modules/ModelFit/include/mitkIModelFitProvider.h similarity index 97% rename from Modules/FitMIData/include/mitkIModelFitProvider.h rename to Modules/ModelFit/include/mitkIModelFitProvider.h index ffa4cab0f9..9e32e804dc 100644 --- a/Modules/FitMIData/include/mitkIModelFitProvider.h +++ b/Modules/ModelFit/include/mitkIModelFitProvider.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __I_MODEL_FIT_PROVIDER_H #define __I_MODEL_FIT_PROVIDER_H #include #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { class ModelFactoryBase; namespace modelFit { class ModelFitInfo; } } namespace itk { template class SmartPointer; } namespace mitk { /** * \ingroup MicroServices_Interfaces * * \brief The common interface for all model providers for model fitting. * * Implementations of this interface must be registered as a service * to make themselves available via the service registry. * * It is recommended to derive new implementations from ModelFitProviderBase or * from AbstractFileIO (if both reader and writer is implemented), * which provide correct service registration semantics. * * \sa ModelFitProviderBase */ - struct MITKFITMIDATA_EXPORT IModelFitProvider + struct MITKMODELFIT_EXPORT IModelFitProvider { virtual ~IModelFitProvider(); /** * \brief returns a factory instance for the model represented by the provider. */ virtual itk::SmartPointer GenerateFactory() const = 0; /** * @param fitInfo Pointer to a fit info instance for the respective model. * * This methods returns the values of the model variable that was used by the fit. * Normally it is a time grid directly extracted from the input image time geometry. * But depending on the model and fit it could be generated out of other properties. * This method is a.o. used when the fit should be plotted correctly. */ virtual ModelBase::TimeGridType GetVariableGrid(const modelFit::ModelFitInfo* fitInfo) const = 0; /** * @brief Service property name for a description. * * The property value must be of type \c std::string. * * @return The property name. */ static std::string PROP_DESCRIPTION(); /** * @brief Service property name for the model ID handled by the provider. * * The property value must be of type \c std::string. * * @return The property name. */ static std::string PROP_MODEL_CLASS_ID(); /** * @brief Service property name for the model type of the model handled by the provider. * * The property value must be of type \c std::string. * * @return The property name. */ static std::string PROP_MODEL_TYPE(); }; } // namespace mitk MITK_DECLARE_SERVICE_INTERFACE(mitk::IModelFitProvider, "org.mitk.IModelFitProvider") #endif /* __I_MODEL_FIT_PROVIDER_H */ diff --git a/Modules/FitMIData/include/mitkIModelProvider.h b/Modules/ModelFit/include/mitkIModelProvider.h similarity index 100% rename from Modules/FitMIData/include/mitkIModelProvider.h rename to Modules/ModelFit/include/mitkIModelProvider.h diff --git a/Modules/FitMIData/include/mitkImageBasedParameterizationDelegate.h b/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h similarity index 94% rename from Modules/FitMIData/include/mitkImageBasedParameterizationDelegate.h rename to Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h index 1db23286c3..0066bc6156 100644 --- a/Modules/FitMIData/include/mitkImageBasedParameterizationDelegate.h +++ b/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h @@ -1,69 +1,69 @@ #ifndef MITKIMAGEBASEDPARAMETERIZATIONDELEGATE_H #define MITKIMAGEBASEDPARAMETERIZATIONDELEGATE_H #include "mitkValueBasedParameterizationDelegate.h" #include #include #include "mitkModelBase.h" #include "mitkImage.h" #include "mitkModelTraitsInterface.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { -class MITKFITMIDATA_EXPORT ImageBasedParameterizationDelegate : public ValueBasedParameterizationDelegate +class MITKMODELFIT_EXPORT ImageBasedParameterizationDelegate : public ValueBasedParameterizationDelegate { public: typedef ImageBasedParameterizationDelegate Self; typedef ValueBasedParameterizationDelegate Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); itkTypeMacro(ImageBasedParameterizationDelegate, InitialParameterizationDelegateBase); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ParametersType ParametersType; typedef Superclass::IndexType IndexType; /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ virtual ParametersType GetInitialParameterization() const override; virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const override; /** Adds an image as a source for the initial value of a parameter. * @param image Pointer to the image that is the value source. * @param paramIndex Indicates which parameter is defined by the source image. * It equals the position in the return vector of GetInitialParameterization(). * @remark setting an image for an index overwrites the value for this index set by * SetInitialParameterization. * @pre paramIndex must be in bound of the initial parametrization vector. * @pre image must be a valid instance*/ void AddInitialParameterImage(const mitk::Image* image, ParametersType::size_type paramIndex); protected: typedef std::map ImageMapType; ImageMapType m_ParameterImageMap; ImageBasedParameterizationDelegate(); virtual ~ImageBasedParameterizationDelegate(); private: //No copy constructor allowed ImageBasedParameterizationDelegate(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCXINITIALPARAMETERIZATIONDELEGATE_H diff --git a/Modules/FitMIData/include/mitkIndexedValueFunctorBase.h b/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h similarity index 94% rename from Modules/FitMIData/include/mitkIndexedValueFunctorBase.h rename to Modules/ModelFit/include/mitkIndexedValueFunctorBase.h index 850454048f..aabc270e7c 100644 --- a/Modules/FitMIData/include/mitkIndexedValueFunctorBase.h +++ b/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef IndexedValueFunctorBase_H #define IndexedValueFunctorBase_H #include #include #include #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /**Functor base class for functors that use the index and/or input value to generate the output. This class is used in conjunction with IndexedValueFunctorPolicy and the itkMultiOutputNaryFunctorImageFilter. */ - class MITKFITMIDATA_EXPORT IndexedValueFunctorBase: public ::itk::Object + class MITKMODELFIT_EXPORT IndexedValueFunctorBase: public ::itk::Object { public: typedef IndexedValueFunctorBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(IndexedValueFunctorBase, itk::Object); typedef ScalarType InputImagePixelType; typedef std::vector InputPixelVectorType; typedef std::vector OutputPixelVectorType; typedef itk::Array GridArrayType; typedef itk::Index<3> IndexType; virtual OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const = 0; virtual unsigned int GetNumberOfOutputs() const = 0; protected: IndexedValueFunctorBase() {}; ~IndexedValueFunctorBase() {}; }; } #endif // IndexedValueFunctorBase_H diff --git a/Modules/FitMIData/include/mitkIndexedValueFunctorPolicy.h b/Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h similarity index 94% rename from Modules/FitMIData/include/mitkIndexedValueFunctorPolicy.h rename to Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h index d4ab62c445..0abf293e82 100644 --- a/Modules/FitMIData/include/mitkIndexedValueFunctorPolicy.h +++ b/Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h @@ -1,63 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef IndexedValueFunctorPolicy_H #define IndexedValueFunctorPolicy_H #include "itkIndex.h" #include "mitkIndexedValueFunctorBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT IndexedValueFunctorPolicy + class MITKMODELFIT_EXPORT IndexedValueFunctorPolicy { public: typedef IndexedValueFunctorBase FunctorType; typedef IndexedValueFunctorBase::ConstPointer FunctorConstPointer; typedef FunctorType::InputPixelVectorType InputPixelVectorType; typedef FunctorType::OutputPixelVectorType OutputPixelVectorType; typedef InputPixelVectorType InputPixelArrayType; typedef FunctorType::IndexType IndexType; typedef std::vector OutputPixelArrayType; IndexedValueFunctorPolicy(); ~IndexedValueFunctorPolicy(); unsigned int GetNumberOfOutputs() const; void SetFunctor(const FunctorType *functor); bool operator!=(const IndexedValueFunctorPolicy & other) const; bool operator==(const IndexedValueFunctorPolicy & other) const; OutputPixelVectorType operator()(const InputPixelVectorType & value, const IndexType& currentIndex) const; private: FunctorConstPointer m_Functor; }; } #endif // IndexedValueFunctorPolicy_H diff --git a/Modules/FitMIData/include/mitkInitialParameterizationDelegateBase.h b/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h similarity index 94% rename from Modules/FitMIData/include/mitkInitialParameterizationDelegateBase.h rename to Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h index 0f15b567ab..787c845d14 100644 --- a/Modules/FitMIData/include/mitkInitialParameterizationDelegateBase.h +++ b/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __INITIAL_PARAMETERIZATION_DELEGATE_BASE_H #define __INITIAL_PARAMETERIZATION_DELEGATE_BASE_H #include #include #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Base class for all initial parametrization delegates * These delegates are used to define custom strategies, which are used by model parameterizers * to determine the initial parametrization of a model (e.g. starting parameter for fitting). */ - class MITKFITMIDATA_EXPORT InitialParameterizationDelegateBase : public itk::Object + class MITKMODELFIT_EXPORT InitialParameterizationDelegateBase : public itk::Object { public: typedef InitialParameterizationDelegateBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(InitialParameterizationDelegateBase, itk::Object); typedef ModelBase ModelBaseType; typedef ModelBaseType::ParametersType ParametersType; typedef ::itk::Index<3> IndexType; /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ virtual ParametersType GetInitialParameterization() const = 0; virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const = 0; protected: InitialParameterizationDelegateBase(); virtual ~InitialParameterizationDelegateBase(); private: //No copy constructor allowed InitialParameterizationDelegateBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/FitMIData/include/mitkLevenbergMarquardtModelFitFunctor.h b/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h similarity index 96% rename from Modules/FitMIData/include/mitkLevenbergMarquardtModelFitFunctor.h rename to Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h index 436823510e..6b61c6bca5 100644 --- a/Modules/FitMIData/include/mitkLevenbergMarquardtModelFitFunctor.h +++ b/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef LEVENBERGMARQUARDTMODELFITFUNCTOR_H #define LEVENBERGMARQUARDTMODELFITFUNCTOR_H #include #include #include "mitkModelBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkMVConstrainedCostFunctionDecorator.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT LevenbergMarquardtModelFitFunctor : public ModelFitFunctorBase + class MITKMODELFIT_EXPORT LevenbergMarquardtModelFitFunctor : public ModelFitFunctorBase { public: typedef LevenbergMarquardtModelFitFunctor Self; typedef ModelFitFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); itkTypeMacro(LevenbergMarquardtModelFitFunctor, ModelFitFunctorBase); typedef Superclass::InputPixelArrayType InputPixelArrayType; typedef Superclass::OutputPixelArrayType OutputPixelArrayType; itkSetMacro(Epsilon, double); itkSetMacro(GradientTolerance, double); itkSetMacro(ValueTolerance, double); itkSetMacro(DerivativeStepLength, double); itkSetMacro(Iterations, unsigned int); itkSetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType); itkGetMacro(Epsilon, double); itkGetMacro(GradientTolerance, double); itkGetMacro(ValueTolerance, double); itkGetMacro(DerivativeStepLength, double); itkGetMacro(Iterations, unsigned int); itkGetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType); itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkSetMacro(ActivateFailureThreshold, bool); itkGetConstMacro(ActivateFailureThreshold, bool); virtual ParameterNamesType GetCriterionNames() const; protected: typedef Superclass::ParametersType ParametersType; typedef Superclass::SignalType SignalType; LevenbergMarquardtModelFitFunctor(); ~LevenbergMarquardtModelFitFunctor(); virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters, DebugParameterMapType& debugParameters) const; virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, const SignalType& sample) const; /** Generator function that instantiates and parameterizes the cost function that should be used by the fit functor*/ virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value, const ModelBase* model) const; virtual ParameterNamesType DefineDebugParameterNames() const; private: double m_Epsilon; double m_GradientTolerance; double m_ValueTolerance; unsigned int m_Iterations; double m_DerivativeStepLength; ::itk::LevenbergMarquardtOptimizer::ScalesType m_Scales; /**Constraint checker. If set it will be used by the optimization strategies to add additional constraints to the given cost function. */ ConstraintCheckerBase::ConstPointer m_ConstraintChecker; /**If set to true and an constraint checker is set. The cost function will allways fail if the penalty of the checker reaches the threshold. In this case no function evaluation will be done-*/ bool m_ActivateFailureThreshold; }; } #endif // MODEL_FIT_FUNCTOR_BASE_H diff --git a/Modules/FitMIData/include/mitkLinearModel.h b/Modules/ModelFit/include/mitkLinearModel.h similarity index 96% rename from Modules/FitMIData/include/mitkLinearModel.h rename to Modules/ModelFit/include/mitkLinearModel.h index f936522cf4..488f4fee79 100644 --- a/Modules/FitMIData/include/mitkLinearModel.h +++ b/Modules/ModelFit/include/mitkLinearModel.h @@ -1,93 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_LINEAR_MODEL_H_ #define __MITK_LINEAR_MODEL_H_ #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT LinearModel : public mitk::ModelBase + class MITKMODELFIT_EXPORT LinearModel : public mitk::ModelBase { public: typedef LinearModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(LinearModel, ModelBase); virtual std::string GetModelDisplayName() const override; virtual std::string GetModelType() const override; virtual FunctionStringType GetFunctionString() const override; virtual std::string GetXName() const override; virtual ParameterNamesType GetParameterNames() const override; virtual ParametersSizeType GetNumberOfParameters() const override; virtual ParameterNamesType GetStaticParameterNames() const override; virtual ParametersSizeType GetNumberOfStaticParameters() const override; virtual ParameterNamesType GetDerivedParameterNames() const override; virtual ParametersSizeType GetNumberOfDerivedParameters() const override; protected: LinearModel() {}; virtual ~LinearModel() {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ virtual itk::LightObject::Pointer InternalClone() const; virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& parameters) const; virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values); virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; private: //No copy constructor allowed LinearModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/FitMIData/include/mitkLinearModelFactory.h b/Modules/ModelFit/include/mitkLinearModelFactory.h similarity index 91% rename from Modules/FitMIData/include/mitkLinearModelFactory.h rename to Modules/ModelFit/include/mitkLinearModelFactory.h index 6e7bd8c101..6b686a24bb 100644 --- a/Modules/FitMIData/include/mitkLinearModelFactory.h +++ b/Modules/ModelFit/include/mitkLinearModelFactory.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __LINEAR_TEST_MODEL_FACTORY_H #define __LINEAR_TEST_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkLinearModel.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT LinearModelFactory : public ConcreteModelFactoryBase + class MITKMODELFIT_EXPORT LinearModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(LinearModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const; protected: virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const; LinearModelFactory(); virtual ~LinearModelFactory(); private: //No copy constructor allowed LinearModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__LINEAR_TEST_MODEL_FACTORY_H diff --git a/Modules/FitMIData/include/mitkLinearModelParameterizer.h b/Modules/ModelFit/include/mitkLinearModelParameterizer.h similarity index 100% rename from Modules/FitMIData/include/mitkLinearModelParameterizer.h rename to Modules/ModelFit/include/mitkLinearModelParameterizer.h diff --git a/Modules/FitMIData/include/mitkMVConstrainedCostFunctionDecorator.h b/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h similarity index 96% rename from Modules/FitMIData/include/mitkMVConstrainedCostFunctionDecorator.h rename to Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h index 31a2065227..71749c771a 100644 --- a/Modules/FitMIData/include/mitkMVConstrainedCostFunctionDecorator.h +++ b/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h @@ -1,104 +1,104 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MV_CONSTRAINED_COST_FUNCTION_DECORATOR_H #define MV_CONSTRAINED_COST_FUNCTION_DECORATOR_H #include #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** \class MVConstrainedCostFunctionDecorator * \brief This class is used to add constraints to any multi valued model fit cost function. * * MVConstrainedCostFunctionDecorator is used to extend a given cost function * with the functionality to regard given constraints for the measure. * To add this functionality to a cost function, instantiate the decorator, set * the wrapped cost function (that will be extended) and set a constraint checker * that defines the type of constraints.\n * The decorator has a failure threshold. An evaluation * can always be accounted as a failure if the sum of penalties given by the checker * is greater or equal to the threshold. If the evaluation is a failure the wrapped cost function * will not be evaluated. Otherwise the penalty will be added to every measure of the cost function. */ -class MITKFITMIDATA_EXPORT MVConstrainedCostFunctionDecorator : public mitk::MVModelFitCostFunction +class MITKMODELFIT_EXPORT MVConstrainedCostFunctionDecorator : public mitk::MVModelFitCostFunction { public: typedef MVConstrainedCostFunctionDecorator Self; typedef mitk::MVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; typedef ConstraintCheckerBase::PenaltyValueType PenaltyValueType; itkSetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction); itkGetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction); itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkSetMacro(FailureThreshold, PenaltyValueType); itkGetConstMacro(FailureThreshold, PenaltyValueType); itkSetMacro(ActivateFailureThreshold, bool); itkGetConstMacro(ActivateFailureThreshold, bool); /**Returns the number of evaluations done by the cost function instance since creation.*/ itkGetConstMacro(EvaluationCount, unsigned int); /**Returns the ration between evaluations that were penaltized and all evaluation since creation of the instance. 0.0 means no evaluation was penalized; 1.0 all evaluations were. (evaluations that hit the failure threshold count as penalized too.)*/ double GetPenaltyRatio() const; /**Returns the ration between evaluations that where beyond the failure thershold and all evaluation since creation of the instance. 0.0 means no evaluation was a failure (but some may be penalized); 1.0 all evaluations were failures.*/ double GetFailureRatio() const; /**Returns the index of the first (in terms of index position) failed parameter in the last failed evaluation.*/ ParametersType::size_type GetFailedParameter() const; protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; MVConstrainedCostFunctionDecorator() : m_FailureThreshold(1e6), m_ActivateFailureThreshold(true), m_EvaluationCount(0), m_PenaltyCount(0), m_FailureCount(0), m_LastFailedParameter(-1) { } ~MVConstrainedCostFunctionDecorator(){} ConstraintCheckerBase::ConstPointer m_ConstraintChecker; MVModelFitCostFunction::ConstPointer m_WrappedCostFunction; PenaltyValueType m_FailureThreshold; bool m_ActivateFailureThreshold; mutable unsigned int m_EvaluationCount; mutable unsigned int m_PenaltyCount; mutable unsigned int m_FailureCount; mutable ParametersType::size_type m_LastFailedParameter; }; } #endif diff --git a/Modules/FitMIData/include/mitkMVModelFitCostFunction.h b/Modules/ModelFit/include/mitkMVModelFitCostFunction.h similarity index 93% rename from Modules/FitMIData/include/mitkMVModelFitCostFunction.h rename to Modules/ModelFit/include/mitkMVModelFitCostFunction.h index c1d3508cf0..dc3a02a8e4 100644 --- a/Modules/FitMIData/include/mitkMVModelFitCostFunction.h +++ b/Modules/ModelFit/include/mitkMVModelFitCostFunction.h @@ -1,82 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MV_MODELFITCOSTFUNCTION_H #define MV_MODELFITCOSTFUNCTION_H #include #include #include "mitkModelFitCostFunctionInterface.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Base class for all model fit cost function that return a multiple cost value * It offers also a default implementation for the numerical computation of the * derivatives. Normaly you just have to (re)implement CalcMeasure(). */ -class MITKFITMIDATA_EXPORT MVModelFitCostFunction : public itk::MultipleValuedCostFunction, public ModelFitCostFunctionInterface +class MITKMODELFIT_EXPORT MVModelFitCostFunction : public itk::MultipleValuedCostFunction, public ModelFitCostFunctionInterface { public: typedef MVModelFitCostFunction Self; typedef itk::MultipleValuedCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef ModelFitCostFunctionInterface::SignalType SignalType; typedef Superclass::MeasureType MeasureType; typedef Superclass::DerivativeType DerivativeType; void SetSample(const SignalType &sampleSet); MeasureType GetValue(const ParametersType& parameter) const; void GetDerivative (const ParametersType ¶meters, DerivativeType &derivative) const; unsigned int GetNumberOfValues (void) const; unsigned int GetNumberOfParameters (void) const; itkSetConstObjectMacro(Model, ModelBase); itkGetConstObjectMacro(Model, ModelBase); itkSetMacro(DerivativeStepLength, double); itkGetConstMacro(DerivativeStepLength, double); protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const = 0; MVModelFitCostFunction() : m_DerivativeStepLength(1e-5) { } ~MVModelFitCostFunction(){} SignalType m_Sample; private: ModelBase::ConstPointer m_Model; /**value (delta of parameters) used to compute the derivatives numerically*/ double m_DerivativeStepLength; }; } #endif // MVModelFitCostFunction_H diff --git a/Modules/FitMIData/include/mitkMaskedDynamicImageStatisticsGenerator.h b/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h similarity index 95% rename from Modules/FitMIData/include/mitkMaskedDynamicImageStatisticsGenerator.h rename to Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h index 14622e69bf..4e02e9648e 100644 --- a/Modules/FitMIData/include/mitkMaskedDynamicImageStatisticsGenerator.h +++ b/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_MASKED_DYMAMIC_IMAGE_STATISTICS_GENERATOR_H #define __MITK_MASKED_DYMAMIC_IMAGE_STATISTICS_GENERATOR_H #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Simple mitk based wrapper for the itk::MaskedNaryStatisticsImageFilter. * takes an input image and a mask image (both mitk::Images) and calculates the statistic * of the input image within the given mask (every pixel != 0).\n * The class assumes that the mask image is 3D (only one time step), if this is not the case * *only* the first time step will be used as mask.\n * If the input image has multiple time steps, the statistics will be calculated for each time * step. This the result arrays will always have as many values as the input image * has time steps.*/ -class MITKFITMIDATA_EXPORT MaskedDynamicImageStatisticsGenerator : public itk::Object +class MITKMODELFIT_EXPORT MaskedDynamicImageStatisticsGenerator : public itk::Object { public: mitkClassMacroItkParent(MaskedDynamicImageStatisticsGenerator, itk::Object); itkNewMacro(Self); typedef itk::Array ResultType; itkSetConstObjectMacro(DynamicImage,Image); itkGetConstObjectMacro(DynamicImage,Image); itkSetConstObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); const ResultType& GetMaximum(); const ResultType& GetMinimum(); const ResultType& GetMean(); const ResultType& GetSigma(); const ResultType& GetVariance(); const ResultType& GetSum(); void Generate(); protected: MaskedDynamicImageStatisticsGenerator(); ~MaskedDynamicImageStatisticsGenerator(); template void DoCalculateStatistics(const itk::Image* image); virtual void CheckValidInputs() const; bool HasOutdatedResults() const; itk::TimeStamp m_GenerationTimeStamp; private: Image::ConstPointer m_DynamicImage; Image::ConstPointer m_Mask; typedef itk::Image InternalMaskType; InternalMaskType::ConstPointer m_InternalMask; ResultType m_Maximum; ResultType m_Minimum; ResultType m_Mean; ResultType m_Sigma; ResultType m_Variance; ResultType m_Sum; }; } #endif // ATERIALINPUTFUNCTIONGENERATOR_H diff --git a/Modules/FitMIData/include/mitkModelBase.h b/Modules/ModelFit/include/mitkModelBase.h similarity index 98% rename from Modules/FitMIData/include/mitkModelBase.h rename to Modules/ModelFit/include/mitkModelBase.h index 2d27af0610..939801627b 100644 --- a/Modules/FitMIData/include/mitkModelBase.h +++ b/Modules/ModelFit/include/mitkModelBase.h @@ -1,217 +1,217 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODELBASE_H #define MODELBASE_H #include #include #include #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" #include "mitkModelTraitsInterface.h" namespace mitk { /**@class ModelBase * @brief Base class for (dynamic) models. * A model can be used to calculate its signal given the discrete time grid of the signal * and the parameters of the model.\n * A model has 3 types of parameters:\n * - parameters * - static parameters * - derived parameters * . * "Parameters" and "static parameters" are used to compute the signal of the model. * "Parameters" are the ones that will be changed for/by model fitting. * "Static parameters" are used to configure the model for fitting but are itself not * part of the fitting scope (compare itk::Transform parameters and static parameters). * "Derived parameters" are model specific parameters computed from "Parameters" e.g. (DerivedParam1 = Param1/Param2). * It may be implemented if e.g. for practical usage not the fitted parameters are needed but * derivation of them. * @remark: If you implement your own model calls regard const correctness and do not change * or undermine the constness of this base class. It is important because in case of fitting * models are used in a multi threaded environment and must be thread safe. Thus the getter and * computation functions are implemented as const and thread safe methods.*/ - class MITKFITMIDATA_EXPORT ModelBase : public itk::Object, public ModelTraitsInterface + class MITKMODELFIT_EXPORT ModelBase : public itk::Object, public ModelTraitsInterface { public: typedef ModelBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelBase, itk::Object); typedef ModelTraitsInterface::ModelResultType ModelResultType; typedef ModelTraitsInterface::ParameterValueType ParameterValueType; typedef ModelTraitsInterface::ParametersType ParametersType; /** Type defining the time grid used be models. * @remark the model time grid has a resolution in sec and not like the time geometry which uses ms.*/ typedef itk::Array TimeGridType; typedef ModelTraitsInterface::ParameterNameType ParameterNameType; typedef ModelTraitsInterface::ParameterNamesType ParameterNamesType; typedef ModelTraitsInterface::ParametersSizeType ParametersSizeType; typedef ModelTraitsInterface::DerivedParameterNamesType DerivedParameterNamesType; typedef ModelTraitsInterface::DerivedParametersSizeType DerivedParametersSizeType; typedef double StaticParameterValueType; typedef std::vector StaticParameterValuesType; typedef std::map StaticParameterMapType; typedef double DerivedParameterValueType; typedef std::map DerivedParameterMapType; /**Default implementation returns a scale of 1.0 for every defined parameter.*/ virtual ParamterScaleMapType GetParameterScales() const; /**Default implementation returns no unit string ("") for every defined parameter.*/ virtual ParamterUnitMapType GetParameterUnits() const; /**Default implementation returns a scale of 1.0 for every defined derived parameter.*/ virtual DerivedParamterScaleMapType GetDerivedParameterScales() const; /**Default implementation returns no unit string ("") for every defined derived parameter.*/ virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const; /**Default implementation returns GetClassID as display name.*/ virtual std::string GetModelDisplayName() const; /**Default implementation returns "Unkown" as model type.*/ virtual std::string GetModelType() const; /**Default implementation returns an empty functions string.*/ virtual FunctionStringType GetFunctionString() const; /**Default implementation the class name of the concrete instance as ID.*/ virtual ModellClassIDType GetClassID() const; /**Default implementation returns an empty string.*/ virtual std::string GetXName() const; /**Default implementation returns an empty string.*/ virtual std::string GetXAxisName() const; /**Default implementation returns an empty string.*/ virtual std::string GetXAxisUnit() const; /**Default implementation returns an empty string.*/ virtual std::string GetYAxisName() const; /**Default implementation returns an empty string.*/ virtual std::string GetYAxisUnit() const; /** Returns the names of static parameters that will be used when using * the model to compute the signal (but are not defined via GetSignal()).*/ virtual ParameterNamesType GetStaticParameterNames() const = 0; /** Returns the number of static parameters that will be used when using * the model to compute the signal (but are not defined via GetSignal()).*/ virtual ParametersSizeType GetNumberOfStaticParameters() const = 0; /**Default implementation returns no unit string ("") for every defined parameter.*/ virtual ParamterUnitMapType GetStaticParameterUnits() const; /** Returns the names of derived parameters that can/will be computed by the model * given specific model parameters. * @remark Default implementation has no derived parameters*/ virtual DerivedParameterNamesType GetDerivedParameterNames() const; /** Returns the number of derived parameters that can/will be computed by the model * given specific model parameters. * @remark Default implementation has no derived parameters*/ virtual DerivedParametersSizeType GetNumberOfDerivedParameters() const; /** Generic interface method that can be used to set the static parameters of the model * before it is used. * It checks the validity of the passed map and uses SetStaticParameter to set the values. * @param parameters The map with the static parameters and their values. * @param allParameters If true an exception will be thrown if the keys of passed parameters do * not equal the return of GetStaticParameterNames. Thus if true, one must set all static * parameters of the model. * @pre Parameters must only contain keys that exist in GetStaticParameterNames() * @pre If allParameters == true, parameters must define all keys of GetStaticParameterNames()*/ void SetStaticParameters(const StaticParameterMapType& parameters, bool allParameters = true); /** Generic interface method that can be used to retrieve the static parameters of the model; * e.g. in order to serialize the model settings. * It calls GetStaticParameter for every name defined in GetStaticParameterNames().*/ StaticParameterMapType GetStaticParameters() const; /** Generic interface method that computes all derived parameters implemented for the given models. * To changed the derived parameter computation. ComputeDerivedParameters must be (re)implemented. * @pre parameters must have the right size. * @param parameters The parameters of the model for which the derived parameters should be computed. * It calls GetStaticParameter for every name defined in GetStaticParameterNames(). * @remark Default implementation has no derived parameters*/ DerivedParameterMapType GetDerivedParameters(const ParametersType& parameters) const; /** Sets the time grid of the model. It indicates the time points correlated with the signal the modell should produce. @remark The resolution of the time grid is in seconds. (Not in ms like the mitk::TimeGeometry)*/ virtual void SetTimeGrid(const TimeGridType& grid); /** Gets the time grid of the model. It indicates the time points correlated with the signal the modell should produce. @remark The resolution of the time grid is in seconds. (Not in ms like the mitk::TimeGeometry)*/ itkGetConstReferenceMacro(TimeGrid, TimeGridType); ModelResultType GetSignal(const ParametersType& parameters) const; protected: virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const = 0; /** Member is called by GetSignal() before ComputeModelfunction(). It indicates if model is in a valid state and * ready to compute the signal. The default implementation checks nothing and always returns true. * Reimplement to realize special behavior for derived classes. * @param [out] error Set internally to indicate the error reason if method returns false. Is used by GetSignal() for the * exception comment. * @return Returns true if the model is valid and can compute a signal. Otherwise it returns false.*/ virtual bool ValidateModel(std::string& error) const; /** Helper function called by GetDerivedParameters(). Implement in derived classes to realize * the concrete computation of derived parameters. * @remark Default implementation has no derived parameters*/ virtual DerivedParameterMapType ComputeDerivedParameters(const ParametersType& parameters) const; /** Helper function called by SetStaticParameters(). Implement in derived classes to realize * the concrete setting of static parameters.*/ virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) = 0; /** Helper function called by GetStaticParameters(). Implement in derived classes to realize * the concrete retrieval of static parameters.*/ virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const = 0; ModelBase(); virtual ~ModelBase(); virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; //timeGrid in seconds TimeGridType m_TimeGrid; private: //No copy constructor allowed ModelBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MODELBASE_H diff --git a/Modules/FitMIData/include/mitkModelBasedValueFunctorBase.h b/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h similarity index 93% rename from Modules/FitMIData/include/mitkModelBasedValueFunctorBase.h rename to Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h index dd2e4b5899..93be534fe5 100644 --- a/Modules/FitMIData/include/mitkModelBasedValueFunctorBase.h +++ b/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ModelBasedValueFunctorBase_H #define ModelBasedValueFunctorBase_H #include "mitkIndexedValueFunctorBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /**Functor base class for functors that are some how based on an model. This abstract class adds the possibility to query the signal grid of the model.*/ - class MITKFITMIDATA_EXPORT ModelBasedValueFunctorBase: public IndexedValueFunctorBase + class MITKMODELFIT_EXPORT ModelBasedValueFunctorBase: public IndexedValueFunctorBase { public: typedef ModelBasedValueFunctorBase Self; typedef IndexedValueFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelBasedValueFunctorBase, IndexedValueFunctorBase); typedef Superclass::InputImagePixelType InputImagePixelType; typedef Superclass::InputPixelVectorType InputPixelVectorType; typedef Superclass::OutputPixelVectorType OutputPixelVectorType; typedef Superclass::IndexType IndexType; typedef itk::Array GridArrayType; virtual GridArrayType GetGrid() const = 0; protected: ModelBasedValueFunctorBase() {}; ~ModelBasedValueFunctorBase() {}; }; } #endif // ModelBasedValueFunctorBase_H diff --git a/Modules/FitMIData/include/mitkModelDataGenerationFunctor.h b/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h similarity index 95% rename from Modules/FitMIData/include/mitkModelDataGenerationFunctor.h rename to Modules/ModelFit/include/mitkModelDataGenerationFunctor.h index e103446414..53706e577b 100644 --- a/Modules/FitMIData/include/mitkModelDataGenerationFunctor.h +++ b/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKMODELDATAGENERATIONFUNCTOR_H #define MITKMODELDATAGENERATIONFUNCTOR_H #include "mitkSimpleFunctorBase.h" #include "mitkModelBase.h" #include "mitkModelParameterizerBase.h" -#include +#include namespace mitk { /** Functor class that can be used to generate a model signal for each index. This class assumes that value parameter passed in the Compute() call, is the parameter vector that should be used to generate the model signal. The time grid and the parameterized model are provided by the model parameterizer. This this functor will generate a signal for each index position and return the signal as output.*/ - class MITKFITMIDATA_EXPORT ModelDataGenerationFunctor : public SimpleFunctorBase + class MITKMODELFIT_EXPORT ModelDataGenerationFunctor : public SimpleFunctorBase { public: typedef ModelDataGenerationFunctor Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkTypeMacro(ModelDataGenerationFunctor, SimpleFunctorBase); typedef std::vector ParameterNamesType; typedef ModelBase::ModelResultType SignalType; typedef itk::Array ModelParametersType; itkSetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); itkGetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); virtual SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override; virtual unsigned int GetNumberOfOutputs() const override; virtual GridArrayType GetGrid() const override; protected: ModelDataGenerationFunctor(); virtual ~ModelDataGenerationFunctor(); private: ModelParameterizerBase::ConstPointer m_ModelParameterizer; }; } #endif // MITKMODELDATAGENERATIONFUNCTOR_H diff --git a/Modules/FitMIData/include/mitkModelFactoryBase.h b/Modules/ModelFit/include/mitkModelFactoryBase.h similarity index 96% rename from Modules/FitMIData/include/mitkModelFactoryBase.h rename to Modules/ModelFit/include/mitkModelFactoryBase.h index 8f104f6b0e..8151746dfc 100644 --- a/Modules/FitMIData/include/mitkModelFactoryBase.h +++ b/Modules/ModelFit/include/mitkModelFactoryBase.h @@ -1,94 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MODEL_FACTORY_BASE_H #define __MODEL_FACTORY_BASE_H #include #include "mitkModelBase.h" #include "mitkModelTraitsInterface.h" #include "mitkModelParameterizerBase.h" #include "mitkModelFitInfo.h" #include "mitkConstraintCheckerBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /**Base class for model factories. * Default implementation just passes the model properties through from an instance created with add model. * To use the the base class, derive and at least implement the abstract member functions. */ - class MITKFITMIDATA_EXPORT ModelFactoryBase : public itk::Object, public ModelTraitsInterface + class MITKMODELFIT_EXPORT ModelFactoryBase : public itk::Object, public ModelTraitsInterface { public: /*typedef ModelFactoryBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; */ mitkClassMacroItkParent(ModelFactoryBase, itk::Object); typedef ModelBase ModelBaseType; typedef ModelBaseType::Pointer ModelBasePointer; typedef ModelTraitsInterface::ParameterNameType ParameterNameType; typedef ModelTraitsInterface::ParameterNamesType ParameterNamesType; typedef ModelTraitsInterface::ParametersSizeType ParametersSizeType; typedef ModelTraitsInterface::ParamterScaleMapType ParamterScaleMapType; typedef ModelTraitsInterface::ParamterUnitMapType ParamterUnitMapType; typedef ModelTraitsInterface::FunctionStringType FunctionStringType; typedef ModelTraitsInterface::ModellClassIDType ModellClassIDType; typedef ModelTraitsInterface::DerivedParameterNamesType DerivedParameterNamesType; typedef ModelTraitsInterface::DerivedParametersSizeType DerivedParametersSizeType; typedef ModelTraitsInterface::DerivedParamterScaleMapType DerivedParamterScaleMapType; typedef ModelTraitsInterface::DerivedParamterUnitMapType DerivedParamterUnitMapType; virtual ModelBasePointer CreateModel() const = 0; /** Created a model parameterizer set up according to the passed model fit info. @pre fit must point to a valid instance.*/ ModelParameterizerBase::Pointer CreateParameterizer(const modelFit::ModelFitInfo* fit) const; /** Create the default constraints that should/can be used for fitting if nothing else * is specified by the user. * @return Pointer to the constraint checker for default constraints. May return a NULL pointer * to indicated that the Model has no constraints by default. */ virtual ConstraintCheckerBase::Pointer CreateDefaultConstraints() const = 0; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const = 0; protected: virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const = 0; ModelFactoryBase(); virtual ~ModelFactoryBase(); private: //No copy constructor allowed ModelFactoryBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_FACTORY_BASE_H diff --git a/Modules/FitMIData/include/mitkModelFitCmdAppsHelper.h b/Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h similarity index 71% rename from Modules/FitMIData/include/mitkModelFitCmdAppsHelper.h rename to Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h index 6b36057310..948efb124a 100644 --- a/Modules/FitMIData/include/mitkModelFitCmdAppsHelper.h +++ b/Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_MODEL_FIT_CMD_APPS_HELPER_H_ #define _MITK_MODEL_FIT_CMD_APPS_HELPER_H_ // std includes #include // itk includes #include "itksys/SystemTools.hxx" // MITK includes #include #include #include #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Helper function that generates the file path that would be used to store an result image. The output path will be determined given the outputPathTemplate (which determines the directory, the basic file name and the file formate). The output file name is: _.*/ - MITKFITMIDATA_EXPORT std::string generateModelFitResultImagePath(const std::string& outputPathTemplate, const std::string& parameterName); + MITKMODELFIT_EXPORT std::string generateModelFitResultImagePath(const std::string& outputPathTemplate, const std::string& parameterName); /** Helper function that takes the given image and stores it based on a template path. The real output path will be determined given the outputPathTemplate (which determines the directory, the basic file name and the file formate). The output file name is: _.*/ - MITKFITMIDATA_EXPORT void storeParameterResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type parameterType = mitk::modelFit::Parameter::ParameterType); + MITKMODELFIT_EXPORT void storeParameterResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type parameterType = mitk::modelFit::Parameter::ParameterType); /** Helper function that takes the given image, sets its properties according to the fit session and stores it. The output path will be determined given the outputPathTemplate (which determines the directory, the basic file name and the file formate). The output file name is: _.*/ - MITKFITMIDATA_EXPORT void storeModelFitResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type nodeType, const mitk::modelFit::ModelFitInfo* modelFitInfo); + MITKMODELFIT_EXPORT void storeModelFitResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type nodeType, const mitk::modelFit::ModelFitInfo* modelFitInfo); /** Helper function that stores all results of the passed generator according to the passed outputPathTemplate. For further information regarding the output file path, please see storeModelFitResultImage().*/ - MITKFITMIDATA_EXPORT void storeModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitSession); + MITKMODELFIT_EXPORT void storeModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitSession); /** Helper function that outputs on the std::cout the result images the generator would produces.*/ - MITKFITMIDATA_EXPORT void previewModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator); + MITKMODELFIT_EXPORT void previewModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator); } #endif diff --git a/Modules/FitMIData/include/mitkModelFitConstants.h b/Modules/ModelFit/include/mitkModelFitConstants.h similarity index 98% rename from Modules/FitMIData/include/mitkModelFitConstants.h rename to Modules/ModelFit/include/mitkModelFitConstants.h index d622d51b42..ccc300e864 100644 --- a/Modules/FitMIData/include/mitkModelFitConstants.h +++ b/Modules/ModelFit/include/mitkModelFitConstants.h @@ -1,204 +1,204 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_MODEL_FIT_CONSTANTS_H_ #define _MITK_MODEL_FIT_CONSTANTS_H_ #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace mitk { - struct MITKFITMIDATA_EXPORT ModelFitConstants + struct MITKMODELFIT_EXPORT ModelFitConstants { /** * Name of the "root" property for all information concerning model fitting. */ static const std::string MODEL_FIT_PROPERTY_NAME(); /** * Name of the "uid" property for all data objects concerning model fitting. */ static const std::string UID_PROPERTY_NAME(); /** * modelfit.input.variables ist eine Map der Variablennamen, die einem Eingabebild zu eigen sind und * unabhängig von einem Fit sind. * Deren Wert ist ein Array, welches die Variablenwerte für die einzelnen Zeitschritte enthält. * Die Länge eines solchen Arrays muss entweder der Anzahl der Zeitschritte dieses Bildes entsprechen * oder genau 1 sein, wenn der Wert für alle Zeitschritte dieses Bildes gleich ist. * Beispiele: * ["x1":[580], "x2":[3060], "x3":[41]] (1 Zeitschritt, 3 Variablen) * ["TE":[2.47, 5.85, 9.23, 12.61], "TI":[10.3]] (4 Zeitschritte, 2 Variablen) */ static const std::string INPUT_VARIABLES_PROPERTY_NAME(); /** * modelfit.parameter.name ist der Bezeichner des Parameters, wie es im Funktions-String (modelfit.model.function) vorkommt. */ static const std::string PARAMETER_NAME_PROPERTY_NAME(); /** * modelfit.parameter.unit ist die Einheit des Parameters und dient nur der formatierten Ausgabe. Standardwert: "" */ static const std::string PARAMETER_UNIT_PROPERTY_NAME(); /** * modelfit.parameter.scale ist die Skalierung des Parameters. Standardwert: 1 */ static const std::string PARAMETER_SCALE_PROPERTY_NAME(); /** * modelfit.parameter.type ist der type des parameters. Standardwert: PARAMETER_TYPE_VALUE_PARAMETER */ static const std::string PARAMETER_TYPE_PROPERTY_NAME(); /** * modelfit.parameter.type Wert für normale Parameters. */ static const std::string PARAMETER_TYPE_VALUE_PARAMETER(); /** * modelfit.parameter.type Wert für derived Parameters. */ static const std::string PARAMETER_TYPE_VALUE_DERIVED_PARAMETER(); /** * modelfit.parameter.type Wert für Crtierion-Parameters. */ static const std::string PARAMETER_TYPE_VALUE_CRITERION(); /** * modelfit.parameter.type Wert für Evaluation-Parameters. */ static const std::string PARAMETER_TYPE_VALUE_EVALUATION_PARAMETER(); /** * modelfit.model.type ist der Bezeichner des Modelltyps und dient nur der formatierten Ausgabe */ static const std::string MODEL_TYPE_PROPERTY_NAME(); /** * modelfit.model.name ist der Bezeichner des Fits und dient nur der formatierten Ausgabe. */ static const std::string MODEL_NAME_PROPERTY_NAME(); /** * modelfit.model.function ist der Funktions-String, der geparsed wird, um die Kurve zu plotten. */ static const std::string MODEL_FUNCTION_PROPERTY_NAME(); /** * modelfit.model.functionClass ist die ID der Modellklasse. */ static const std::string MODEL_FUNCTION_CLASS_PROPERTY_NAME(); /** * modelfit.model.x ist der Name der Variable, die die x-Werte stellt, wie sie im Funktions-String vorkommt. Wird nur gebraucht wenn modelfit.model.function definiert ist. */ static const std::string MODEL_X_PROPERTY_NAME(); /** * Default value for MODEL_X_PROPERTY_NAME. */ static const std::string MODEL_X_VALUE_DEFAULT(); /** * modelfit.xaxis.name ist der Bezeichner der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "Time" */ static const std::string XAXIS_NAME_PROPERTY_NAME(); /** * Default value for XAXIS_NAME_PROPERTY_NAME. */ static const std::string XAXIS_NAME_VALUE_DEFAULT(); /** * modelfit.xaxis.unit ist die Einheit der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "ms" */ static const std::string XAXIS_UNIT_PROPERTY_NAME(); /** * modelfit.xaxis.name ist der Bezeichner der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "Intensity" */ static const std::string YAXIS_NAME_PROPERTY_NAME(); /** * Default value for YAXIS_NAME_PROPERTY_NAME. */ static const std::string YAXIS_NAME_VALUE_DEFAULT(); /** * modelfit.xaxis.unit ist die Einheit der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "" */ static const std::string YAXIS_UNIT_PROPERTY_NAME(); /** * modelfit.fit.uid ist eine einzigartige ID (unabhängig von Ausführungsrechner, Session oder Applikationsinstanz), * die einem Fit vergeben wird um alle zugehörigen Bilder eindeutig zu kennzeichnen. */ static const std::string FIT_UID_PROPERTY_NAME(); /** * modelfit.fit.type defines the type of model fitting; e.g. pixel based or ROI based. Thus it determines the meaning of other fit specific informations. */ static const std::string FIT_TYPE_PROPERTY_NAME(); static const std::string FIT_TYPE_VALUE_PIXELBASED(); static const std::string FIT_TYPE_VALUE_ROIBASED(); /** * modelfit.fit.input.imageUID defines the UID of the image that is used directly or indirectly (then it is source for input.data) to make the fit. */ static const std::string FIT_INPUT_IMAGEUID_PROPERTY_NAME(); /** * modelfit.fit.input.roiUID defines the UID of the ROI that is used to make the fit. If not set no Mask was used or specified. */ static const std::string FIT_INPUT_ROIUID_PROPERTY_NAME(); /** * modelfit.fit.input.data defines the data signal that is used to make the fit and was extracted from the input image (e.g. in ROIbased fit). */ static const std::string FIT_INPUT_DATA_PROPERTY_NAME(); /** * modelfit.fit.staticParameters ist eine Map der Variablennamen, die im Funktions-String vorkommen und * nicht mit modelfit.input.variables abgedeckt sind. Dies können z.B. Konstanten sein oder Variablen, * die sich (abhängig vom Fit) über den Zeitverlauf ändern, wie z.B. der Mittelwert einer Maske über einen Arterienquerschnitt. * (Entspricht den StaticParameters in mitk::ModelBase) * Der Wert der Variablen ist ein Array, welches die Variablenwerte enthält. * Beispiel: * ["AIF":[2, 8, 8, 4, 5], "tau":[0.42]] (insgesamt 5 Zeitschritte, 2 Variablen) */ static const std::string FIT_STATIC_PARAMETERS_PROPERTY_NAME(); }; } #ifdef _MSC_VER #pragma warning(pop) #endif #endif diff --git a/Modules/FitMIData/include/mitkModelFitCostFunctionInterface.h b/Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h similarity index 93% rename from Modules/FitMIData/include/mitkModelFitCostFunctionInterface.h rename to Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h index 168875034e..6ec81f39f0 100644 --- a/Modules/FitMIData/include/mitkModelFitCostFunctionInterface.h +++ b/Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODELFITCOSTFUNCTION_INTERFACE_H #define MODELFITCOSTFUNCTION_INTERFACE_H #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Interface class that is implemented by all cost functions that are used in the context of model fitting. */ -class MITKFITMIDATA_EXPORT ModelFitCostFunctionInterface +class MITKMODELFIT_EXPORT ModelFitCostFunctionInterface { public: typedef ModelFitCostFunctionInterface Self; typedef itk::Array SignalType; virtual void SetSample(const SignalType &sampleSet) = 0; virtual void SetModel(const ModelBase* model) = 0; virtual const ModelBase* GetModel() const = 0; protected: ModelFitCostFunctionInterface() { } virtual ~ModelFitCostFunctionInterface() {} private: ModelFitCostFunctionInterface(const ModelFitCostFunctionInterface& source); void operator=(const ModelFitCostFunctionInterface&); //purposely not implemented }; } #endif // MODELFITCOSTFUNCTION_H diff --git a/Modules/FitMIData/include/mitkModelFitException.h b/Modules/ModelFit/include/mitkModelFitException.h similarity index 92% rename from Modules/FitMIData/include/mitkModelFitException.h rename to Modules/ModelFit/include/mitkModelFitException.h index 354dc0d7fd..3b398cdcf0 100644 --- a/Modules/FitMIData/include/mitkModelFitException.h +++ b/Modules/ModelFit/include/mitkModelFitException.h @@ -1,37 +1,37 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkModelFitException_h #define mitkModelFitException_h #include "mitkExceptionMacro.h" namespace mitk { namespace modelFit { /** * @brief Class-specific exception for modelfits. */ - class MITKFITMIDATA_EXPORT ModelFitException : public Exception + class MITKMODELFIT_EXPORT ModelFitException : public Exception { public: mitkExceptionClassMacro(ModelFitException, Exception); }; } } #endif // mitkModelFitException_h diff --git a/Modules/FitMIData/include/mitkModelFitFunctorBase.h b/Modules/ModelFit/include/mitkModelFitFunctorBase.h similarity index 98% rename from Modules/FitMIData/include/mitkModelFitFunctorBase.h rename to Modules/ModelFit/include/mitkModelFitFunctorBase.h index 4fa780326c..6269111e28 100644 --- a/Modules/FitMIData/include/mitkModelFitFunctorBase.h +++ b/Modules/ModelFit/include/mitkModelFitFunctorBase.h @@ -1,141 +1,141 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODEL_FIT_FUNCTOR_BASE_H #define MODEL_FIT_FUNCTOR_BASE_H #include #include #include "mitkModelBase.h" #include "mitkSVModelFitCostFunction.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT ModelFitFunctorBase: public ::itk::Object + class MITKMODELFIT_EXPORT ModelFitFunctorBase: public ::itk::Object { public: typedef ModelFitFunctorBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelFitFunctorBase, itk::Object); typedef ScalarType ParameterImagePixelType; typedef std::vector InputPixelArrayType; typedef std::vector OutputPixelArrayType; /** Returns the values determined by fitting the passed model. The values in the returned vector are ordered in the * following sequence: * - model parameters (see also GetParameterNames()) * - derived model parameters (see also GetDerivedParameterNames()) * - criterion(s) (see also GetCriterionNames()) * - evaluation parameters (see also GetEvaluationParameterNames()) * @param value Signal the model should be fitted onto * @param model Pointer to the preconfigured/ready to use model instance for the fitting against the signal curve * @param initialParameters parameters of the model that should be used as starting point of the fitting process. * @pre model must point to a valid instance. * @pre Size of initialParameters must be equal to model->GetNumberOfParameters(). */ OutputPixelArrayType Compute(const InputPixelArrayType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters) const; /** Returns the number of outputs the fit functor will return if compute is called. * The number depends in parts on the passed model. * @exception Exception will be thrown if no valid model is passed.*/ unsigned int GetNumberOfOutputs(const ModelBase* model) const; typedef ModelBase::ParameterNamesType ParameterNamesType; /** Returns names of all evaluation parameters defined by the user*/ ParameterNamesType GetEvaluationParameterNames() const; void ResetEvaluationParameters(); void RegisterEvaluationParameter(const std::string& parameterName, SVModelFitCostFunction* evaluationCostFunction); const SVModelFitCostFunction* GetEvaluationParameterCostFunction(const std::string& parameterName) const; /** Returns names of the criterion used to fit the model. */ virtual ParameterNamesType GetCriterionNames() const = 0 ; /** Returns names of the depug parameters generated by the functor. Is empty, if debug is deactivated. */ ParameterNamesType GetDebugParameterNames() const; itkBooleanMacro(DebugParameterMaps); itkSetMacro(DebugParameterMaps, bool); itkGetConstMacro(DebugParameterMaps, bool); protected: typedef ModelBase::ParametersType ParametersType; typedef ModelFitCostFunctionInterface::SignalType SignalType; ModelFitFunctorBase(); ~ModelFitFunctorBase(); /**Internal Method called by Compute to get the final criterion values thar dove the fit. must be implemented be concrete functor classes.*/ virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, const SignalType& sample) const = 0; /** Internal Method called by Compute(). Gets all derived parameters of the models with the final found parameters of the fit.*/ OutputPixelArrayType GetDerivedParameters(const ModelBase* model, const ParametersType& parameters) const; /** Internal Method called by Compute(). Gets the evaluation parameters for all cost functions enlisted by the user, based on the model with the final found parameters of the fit and the input signal.*/ OutputPixelArrayType GetEvaluationParameters(const ModelBase* model, const ParametersType& parameters, const SignalType& sample) const; typedef std::map DebugParameterMapType; /** Internal Method called by Compute(). It does the real fit and returns the found parameters. Additionally it must return its debug parameter via debugParameters. @post If m_DebugParameterMaps is true, it must return all debug parameters defined by GetDebugParameterNames() via debugParameters. @param value Signal the Model should be fitted against @param model Pointer to the model that should be fitted @param initialParameters Initial modal parameters for the fit @param [out] debugParameters Map containing all debug parameters for the done fit (must only valid if m_DebugParameterMap is true)*/ virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters, DebugParameterMapType& debugParameters) const = 0; /** Returns names of the depug parameters generated by the functor. Will be called by GetDebugParameterNames, if debug is activated. */ virtual ParameterNamesType DefineDebugParameterNames()const = 0; private: typedef std::map CostFunctionMapType; CostFunctionMapType m_CostFunctionMap; bool m_DebugParameterMaps; ::itk::SimpleFastMutexLock m_Mutex; }; } #endif // MODEL_FIT_FUNCTOR_BASE_H diff --git a/Modules/FitMIData/include/mitkModelFitFunctorPolicy.h b/Modules/ModelFit/include/mitkModelFitFunctorPolicy.h similarity index 97% rename from Modules/FitMIData/include/mitkModelFitFunctorPolicy.h rename to Modules/ModelFit/include/mitkModelFitFunctorPolicy.h index abf966338b..8e57777686 100644 --- a/Modules/FitMIData/include/mitkModelFitFunctorPolicy.h +++ b/Modules/ModelFit/include/mitkModelFitFunctorPolicy.h @@ -1,121 +1,121 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODELFITFUNCTOR_POLICY_H #define MODELFITFUNCTOR_POLICY_H #include "itkIndex.h" #include "mitkModelFitFunctorBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT ModelFitFunctorPolicy + class MITKMODELFIT_EXPORT ModelFitFunctorPolicy { public: typedef ModelFitFunctorBase::InputPixelArrayType InputPixelArrayType; typedef ModelFitFunctorBase::InputPixelArrayType OutputPixelArrayType; typedef mitk::ModelParameterizerBase ParameterizerType; typedef ParameterizerType::ConstPointer ParameterizerConstPointer; typedef ModelFitFunctorBase FunctorType; typedef ModelFitFunctorBase::ConstPointer FunctorConstPointer; typedef itk::Index<3> IndexType; ModelFitFunctorPolicy() {}; ~ModelFitFunctorPolicy() {}; unsigned int GetNumberOfOutputs() const { unsigned int result = 0; if (m_Functor.IsNotNull() && m_ModelParameterizer.IsNotNull()) { ParameterizerType::ModelBasePointer tempModel = m_ModelParameterizer->GenerateParameterizedModel(); result = m_Functor->GetNumberOfOutputs(tempModel); } return result; } void SetModelFitFunctor(const mitk::ModelFitFunctorBase* functor) { if (!functor) { itkGenericExceptionMacro( << "Error. Functor is Null."); } m_Functor = functor; } void SetModelParameterizer(const ParameterizerType* parameterizer) { if (!parameterizer) { itkGenericExceptionMacro( << "Error. Parameterizer is Null."); } m_ModelParameterizer = parameterizer; } bool operator!=(const ModelFitFunctorPolicy& other) const { return !(*this == other); } bool operator==(const ModelFitFunctorPolicy& other) const { return (this->m_Functor == other.m_Functor) && (this->m_ModelParameterizer == other.m_ModelParameterizer); } inline OutputPixelArrayType operator()(const InputPixelArrayType& value, const IndexType& currentIndex) const { if (!m_Functor) { itkGenericExceptionMacro( << "Error. Cannot process operator(). Functor is Null."); } if (!m_ModelParameterizer) { itkGenericExceptionMacro( << "Error. Cannot process operator(). Parameterizer is Null."); } ParameterizerType::ModelBasePointer parameterizedModel = m_ModelParameterizer->GenerateParameterizedModel(currentIndex); ParameterizerType::ParametersType initialParams = m_ModelParameterizer->GetInitialParameterization( currentIndex); OutputPixelArrayType result = m_Functor->Compute(value, parameterizedModel, initialParams); return result; } private: FunctorConstPointer m_Functor; ParameterizerConstPointer m_ModelParameterizer; }; } #endif // LEVENBERGMARQUARDTMODELFITFUNCTOR_H diff --git a/Modules/FitMIData/include/mitkModelFitInfo.h b/Modules/ModelFit/include/mitkModelFitInfo.h similarity index 91% rename from Modules/FitMIData/include/mitkModelFitInfo.h rename to Modules/ModelFit/include/mitkModelFitInfo.h index bba822d8b9..ccf8b3bf39 100644 --- a/Modules/FitMIData/include/mitkModelFitInfo.h +++ b/Modules/ModelFit/include/mitkModelFitInfo.h @@ -1,200 +1,200 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkModelFitInfo_h #define mitkModelFitInfo_h #include #include #include #include "mitkModelFitConstants.h" #include "mitkModelFitParameter.h" #include "mitkModelFitStaticParameterMap.h" #include "mitkScalarListLookupTable.h" #include "mitkModelFitUIDHelper.h" #include "mitkModelParameterizerBase.h" #include "mitkModelTraitsInterface.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { namespace modelFit { /** * @brief Data class that stores all information about a modelfit that is relevant to the * visualization and stored as properties in the result nodes. */ - class MITKFITMIDATA_EXPORT ModelFitInfo : public itk::LightObject + class MITKMODELFIT_EXPORT ModelFitInfo : public itk::LightObject { public: typedef mitk::NodeUIDType UIDType; typedef std::vector ParamListType; typedef ParamListType::const_iterator ConstIterType; mitkClassMacroItkParent(ModelFitInfo, itk::LightObject) itkSimpleNewMacro(ModelFitInfo) ModelFitInfo() : x(mitk::ModelFitConstants::MODEL_X_VALUE_DEFAULT()), xAxisName(mitk::ModelFitConstants::XAXIS_NAME_VALUE_DEFAULT()), yAxisName(mitk::ModelFitConstants::YAXIS_NAME_VALUE_DEFAULT()) { } /** * @brief Adds the given parameter to this fit's parameter list if it doesn't * exist already. * @param p The param that should be added to this fit's parameter list. */ void AddParameter(Parameter::Pointer p); /** * @brief Searches for the parameter with the given name and type in the fit's * parameter list and returns it. * @param name The name of the desired parameter. * @param type The type of the desired parameter. * @return The parameter with the given name on success or NULL otherwise. */ Parameter::ConstPointer GetParameter(const std::string& name, const Parameter::Type& type) const; /** * @brief Searches for the parameter with the given name and type in the fit's * parameter list and deletes it if it exists. * @param name The name of the desired parameter. * @param type The type of the desired parameter. */ void DeleteParameter(const std::string& name, const Parameter::Type& type); /**Return const reference to the parameter list.*/ const ParamListType& GetParameters() const; /** ModelFitConstants::MODEL_NAME_PROPERTY_NAME */ std::string modelName; /** ModelFitConstants::MODEL_TYPE_PROPERTY_NAME */ std::string modelType; /** ModelFitConstants::MODEL_FUNCTION_PROPERTY_NAME */ std::string function; /** ModelFitConstants::MODEL_FUNCTION_CLASS_PROPERTY_NAME */ std::string functionClassID; /** ModelFitConstants::MODEL_X_PROPERTY_NAME */ std::string x; /** ModelFitConstants::XAXIS_NAME_PROPERTY_NAME */ std::string xAxisName; /** ModelFitConstants::XAXIS_UNIT_PROPERTY_NAME */ std::string xAxisUnit; /** ModelFitConstants::YAXIS_NAME_PROPERTY_NAME */ std::string yAxisName; /** ModelFitConstants::YAXIS_UNIT_PROPERTY_NAME */ std::string yAxisUnit; /** ModelFitConstants::FIT_UID_PROPERTY_NAME */ UIDType uid; /** ModelFitConstants::FIT_TYPE_PROPERTY_NAME */ std::string fitType; /** ModelFitConstants::FIT_STATIC_PARAMETERS_PROPERTY_NAME */ StaticParameterMap staticParamMap; /** ModelFitConstants::FIT_INPUT_ROIUID_PROPERTY_NAME */ UIDType roiUID; /** ModelFitConstants::FIT_INPUT_IMAGEUID_PROPERTY_NAME */ UIDType inputUID; /** ModelFitConstants::FIT_INPUT_DATA_PROPERTY_NAME */ ScalarListLookupTable inputData; mitk::Image::Pointer inputImage; private: typedef ParamListType::iterator IterType; typedef itk::MutexLockHolder LockType; ParamListType parameterList; itk::SimpleFastMutexLock mutex; }; /** * @brief Reads the string property with the given name from the data of the given node * and returns its value. Throws a ModelFitException if the property doesn't exist. * @param node The node whose property value should be returned. * @param prop The name of the property that should be read. * @return The value of the found property. * @throw ModelFitException If the property doesn't exist or returns an empty string. */ - MITKFITMIDATA_EXPORT const std::string GetMandatoryProperty(const mitk::DataNode* node, + MITKMODELFIT_EXPORT const std::string GetMandatoryProperty(const mitk::DataNode* node, const std::string& prop); /** * @brief Reads the string property with the given name from the given base data and * returns its value. Throws a ModelFitException if the property doesn't exist. * @param data The data whose property value should be returned. * @param prop The name of the property that should be read. * @return The value of the found property. * @throw ModelFitException If the property doesn't exist or returns an empty string. */ - MITKFITMIDATA_EXPORT const std::string GetMandatoryProperty(const mitk::BaseData* data, + MITKMODELFIT_EXPORT const std::string GetMandatoryProperty(const mitk::BaseData* data, const std::string& prop); /** * @brief Creates a new ModelFitInfo instance from the nodes in the passed storage. * The fit will be identified by the passed UID. Returns the instance on * success. * @param uid The uid of the fit that should get its ModelFitInfo created and which identifies the nodes in the storage. * @param storage Pointer to the data storage containing any potential relevantThe nodes. * @return The newly created modelfit on success or NULL otherwise. */ - MITKFITMIDATA_EXPORT ModelFitInfo::Pointer CreateFitInfoFromNode(const ModelFitInfo::UIDType& uid, + MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromNode(const ModelFitInfo::UIDType& uid, const mitk::DataStorage* storage); /** creates a new ModelFitInfo instance from a passed modal instance and his traits instance* * @param usedModel Pointer to a model which was used for a fit, which should get a fit info created. * @param modelTraits Pointer to traits interface for the model that was used for the fit. * @param inputImage Pointer to the input image. If it has no UID yet, a property will be added to the node. * @return The newly created modelfit on success or NULL otherwise.*/ - MITKFITMIDATA_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer( + MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer( const ModelParameterizerBase* usedParameterizer, mitk::BaseData* inputImage, const std::string& fitType, const NodeUIDType roiUID = ""); /** @overload Overloaded version that allows additional definition of optional input data for the fit.*/ - MITKFITMIDATA_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer( + MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer( const ModelParameterizerBase* usedParameterizer, mitk::BaseData* inputImage, const std::string& fitType, const ScalarListLookupTable& inputData, const NodeUIDType roiUID = ""); /** Returns all nodes that belong to the fit indicated by the passed UID. * @param fitUID The uid of the fit that is relevant for the query. * @param storage Pointer to the data storage containing any potential relevant nodes. * @return The set of found nodes or null if storage is not valid. */ - MITKFITMIDATA_EXPORT DataStorage::SetOfObjects::ConstPointer GetNodesOfFit( + MITKMODELFIT_EXPORT DataStorage::SetOfObjects::ConstPointer GetNodesOfFit( const ModelFitInfo::UIDType& fitUID, const mitk::DataStorage* storage); typedef std::set NodeUIDSetType; /** Returns the UIDs of all fits that are derived (directly or indirectly from the passed node). * @param node The node which defines the parent node. It will be searched in his derived nodes for fits. * @param storage Pointer to the data storage containing any potential relevant nodes. * @return The set of found uid will be returned. */ - MITKFITMIDATA_EXPORT NodeUIDSetType GetFitUIDsOfNode(const mitk::DataNode* node, + MITKMODELFIT_EXPORT NodeUIDSetType GetFitUIDsOfNode(const mitk::DataNode* node, const mitk::DataStorage* storage); } } #endif // mitkModelFit_h diff --git a/Modules/FitMIData/include/mitkModelFitInfoSignalGenerationFunctor.h b/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h similarity index 96% rename from Modules/FitMIData/include/mitkModelFitInfoSignalGenerationFunctor.h rename to Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h index 0f5fac2cb8..6cb6aec733 100644 --- a/Modules/FitMIData/include/mitkModelFitInfoSignalGenerationFunctor.h +++ b/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKModelFitInfoSignalGenerationFunctor_H #define MITKModelFitInfoSignalGenerationFunctor_H #include "mitkModelBasedValueFunctorBase.h" #include "mitkModelParameterizerBase.h" #include "mitkModelFitInfo.h" #include "mitkModelFitParameterValueExtraction.h" -#include +#include namespace mitk { /** Functor class that can be used to generate a model signal for each index. This class is similar to ModelDataGenerationFunctor. But instead of using the passed input value as model parameters in the compute function, the model fit info is used to deduce the parameters based on the index. The time grid and the parameterized model are provided by the model parameterizer. This this functor will generate a signal for each index position and return the signal as output.*/ - class MITKFITMIDATA_EXPORT ModelFitInfoSignalGenerationFunctor : public ModelBasedValueFunctorBase + class MITKMODELFIT_EXPORT ModelFitInfoSignalGenerationFunctor : public ModelBasedValueFunctorBase { public: typedef ModelFitInfoSignalGenerationFunctor Self; typedef ModelBasedValueFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkTypeMacro(ModelFitInfoSignalGenerationFunctor, ModelBasedValueFunctorBase); typedef std::vector ParameterNamesType; typedef ModelBase::ModelResultType SignalType; typedef itk::Array ModelParametersType; itkSetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); itkGetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); itkSetConstObjectMacro(FitInfo, mitk::modelFit::ModelFitInfo); itkGetConstObjectMacro(FitInfo, mitk::modelFit::ModelFitInfo); virtual IndexedValueFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const override; /** Convinient overload because this functor does not need the value */ virtual IndexedValueFunctorBase::OutputPixelVectorType Compute(const IndexType& currentIndex) const; virtual unsigned int GetNumberOfOutputs() const override; virtual GridArrayType GetGrid() const override; protected: /**Method is called by Compute() to specify the parameters used to generate the model signal for the current index. The default implementation just extracts the parameters out of the model fit info and maps it into the result vector. Reimplement the method to change this behavior.*/ virtual ModelBase::ParametersType CompileModelParameters(const IndexType& currentIndex, const ModelBase * model) const; ModelFitInfoSignalGenerationFunctor(); virtual ~ModelFitInfoSignalGenerationFunctor(); private: ModelParameterizerBase::ConstPointer m_ModelParameterizer; modelFit::ModelFitInfo::ConstPointer m_FitInfo; }; } #endif // MITKModelFitInfoSignalGenerationFunctor_H diff --git a/Modules/FitMIData/include/mitkModelFitParameter.h b/Modules/ModelFit/include/mitkModelFitParameter.h similarity index 89% rename from Modules/FitMIData/include/mitkModelFitParameter.h rename to Modules/ModelFit/include/mitkModelFitParameter.h index 45bfcd3d4c..2563978942 100644 --- a/Modules/FitMIData/include/mitkModelFitParameter.h +++ b/Modules/ModelFit/include/mitkModelFitParameter.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkModelFitParameter_h #define mitkModelFitParameter_h #include #include "mitkModelFitUIDHelper.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { namespace modelFit { /** * @brief Data class that stores all information about a modelfit parameter. * Such a parameter is going to be fitted for the according model. */ - class MITKFITMIDATA_EXPORT Parameter : public itk::LightObject + class MITKMODELFIT_EXPORT Parameter : public itk::LightObject { public: mitkClassMacroItkParent(Parameter, itk::LightObject) itkSimpleNewMacro(Parameter) enum Type { ParameterType, DerivedType, CriterionType, EvaluationType }; Parameter(); /** ModelFitConstants::PARAMETER_NAME_PROPERTY_NAME */ std::string name; /** ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME */ Type type; /** ModelFitConstants::PARAMETER_UNIT_PROPERTY_NAME */ std::string unit; /** ModelFitConstants::PARAMETER_SCALE_PROPERTY_NAME */ float scale; /** Corresponding image */ mitk::Image::ConstPointer image; }; /** Extracts the parameter information stored in the data instance and returns it as parameter instance. * If the data does not encode an parameter/fit result a Null pointer will be returned. * @param data The data instance that contains parameter information that should be extracted. * @return The newly created parameter instance on success or NULL otherwise. */ - MITKFITMIDATA_EXPORT Parameter::Pointer ExtractParameterFromData(const mitk::BaseData* data); + MITKMODELFIT_EXPORT Parameter::Pointer ExtractParameterFromData(const mitk::BaseData* data); } } #endif // mitkModelFitParameter_h \ No newline at end of file diff --git a/Modules/FitMIData/include/mitkModelFitParameterValueExtraction.h b/Modules/ModelFit/include/mitkModelFitParameterValueExtraction.h similarity index 81% rename from Modules/FitMIData/include/mitkModelFitParameterValueExtraction.h rename to Modules/ModelFit/include/mitkModelFitParameterValueExtraction.h index 2a3560f154..57028082a2 100644 --- a/Modules/FitMIData/include/mitkModelFitParameterValueExtraction.h +++ b/Modules/ModelFit/include/mitkModelFitParameterValueExtraction.h @@ -1,63 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkModelFitParameterValueExtraction_h #define mitkModelFitParameterValueExtraction_h #include #include "mitkModelFitInfo.h" #include "mitkModelTraitsInterface.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Helper function that gets the voxel value (as double) of an image (given an 3D position and a time step). Function is used in different contexts of model fit view. @param noThrow If set to false, function will throw exceptions. If set to true, exceptions will be blocked, an MITK_ERROR will be notified and the return is 0.0.*/ - MITKFITMIDATA_EXPORT ModelTraitsInterface::ParameterValueType ReadVoxel(const mitk::Image* image, + MITKMODELFIT_EXPORT ModelTraitsInterface::ParameterValueType ReadVoxel(const mitk::Image* image, const mitk::Point3D& position, unsigned int timestep = 0, bool noThrow = true); /** Helper function that gets the voxel value (as double) of an image (given an image index and a time step). Function is used in different contexts of model fit view. @param noThrow If set to false, function will throw exceptions.If set to true, exceptions will be blocked, an MITK_ERROR will be notified and the return is 0.0. */ - MITKFITMIDATA_EXPORT ModelTraitsInterface::ParameterValueType ReadVoxel(const mitk::Image* image, + MITKMODELFIT_EXPORT ModelTraitsInterface::ParameterValueType ReadVoxel(const mitk::Image* image, const ::itk::Index<3>& index, unsigned int timestep = 0, bool noThrow = true); using ParameterValueMapType = std::map; /** Helper function that extracts a map (keys are the parameter names, values are the associated parameter values) of parameter values for the specified 3D point given a model fit info instance. @pre fit must point to a valid instance. */ - MITKFITMIDATA_EXPORT ParameterValueMapType ExtractParameterValueMapFromModelFit(const mitk::modelFit::ModelFitInfo* fitInfo, + MITKMODELFIT_EXPORT ParameterValueMapType ExtractParameterValueMapFromModelFit(const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::Point3D& position); - MITKFITMIDATA_EXPORT ParameterValueMapType ExtractParameterValueMapFromModelFit(const mitk::modelFit::ModelFitInfo* fitInfo, + MITKMODELFIT_EXPORT ParameterValueMapType ExtractParameterValueMapFromModelFit(const mitk::modelFit::ModelFitInfo* fitInfo, const ::itk::Index<3>& index); /** Helper function that converts a parameter value map (like returned by ExtractParameterValueMapFromModelFit() into the ParametersType. the ordering will be deduced with the help of the passed trait interface. @pre pTraitInterface must point to a valid instance. @pre valueMap must contain all parameter names of pTraitsInterface*/ - MITKFITMIDATA_EXPORT ModelTraitsInterface::ParametersType + MITKMODELFIT_EXPORT ModelTraitsInterface::ParametersType ConvertParameterMapToParameterVector(const ParameterValueMapType &valueMap, const ModelTraitsInterface * pTraitInterface); } #endif diff --git a/Modules/FitMIData/include/mitkModelFitProviderBase.h b/Modules/ModelFit/include/mitkModelFitProviderBase.h similarity index 100% rename from Modules/FitMIData/include/mitkModelFitProviderBase.h rename to Modules/ModelFit/include/mitkModelFitProviderBase.h diff --git a/Modules/FitMIData/include/mitkModelFitProviderBase.tpp b/Modules/ModelFit/include/mitkModelFitProviderBase.tpp similarity index 100% rename from Modules/FitMIData/include/mitkModelFitProviderBase.tpp rename to Modules/ModelFit/include/mitkModelFitProviderBase.tpp diff --git a/Modules/FitMIData/include/mitkModelFitResultHelper.h b/Modules/ModelFit/include/mitkModelFitResultHelper.h similarity index 60% rename from Modules/FitMIData/include/mitkModelFitResultHelper.h rename to Modules/ModelFit/include/mitkModelFitResultHelper.h index c557a26c89..f73d9792fb 100644 --- a/Modules/FitMIData/include/mitkModelFitResultHelper.h +++ b/Modules/ModelFit/include/mitkModelFitResultHelper.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_MODEL_FIT_RESULT_HELPER_H_ #define __MITK_MODEL_FIT_RESULT_HELPER_H_ #include #include #include "mitkScalarListLookupTableProperty.h" #include "mitkModelBase.h" #include "mitkModelFitParameter.h" #include "mitkModelFitStaticParameterMap.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { class DataStorage; class ModelTraitsInterface; class ModelBase; namespace modelFit { class ModelFitInfo; typedef std::map ModelFitResultImageMapType; typedef std::vector ModelFitResultNodeVectorType; /**Helper function that sets the properties of the passed base data according to the given model fit info instance and parameter specification. @param data Instance that properties should be configured. @param name Name of the parameter this data instance represents. @param dataType Type of the parameter this data instance represents. @param fitInfo Instance to the fit info that containes the information of the fit that derived the parameter. @pre Data must point to a valid instance. @pre fitInfo must point to an valid instance. */ - MITKFITMIDATA_EXPORT void SetModelFitDataProperties(mitk::BaseData* data, const ModelBase::ParameterNameType& name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo* fitInfo); + MITKMODELFIT_EXPORT void SetModelFitDataProperties(mitk::BaseData* data, const ModelBase::ParameterNameType& name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo* fitInfo); - MITKFITMIDATA_EXPORT mitk::ScalarListLookupTableProperty::Pointer ConvertStaticParametersToProperty(const mitk::modelFit::StaticParameterMap& params); + MITKMODELFIT_EXPORT mitk::ScalarListLookupTableProperty::Pointer ConvertStaticParametersToProperty(const mitk::modelFit::StaticParameterMap& params); - MITKFITMIDATA_EXPORT DataNode::Pointer CreateResultNode(const ModelBase::ParameterNameType& name, modelFit::Parameter::Type nodeType, Image* parameterImage, const ModelFitInfo* modelFitInfo, const std::string& sessionName = ""); + MITKMODELFIT_EXPORT DataNode::Pointer CreateResultNode(const ModelBase::ParameterNameType& name, modelFit::Parameter::Type nodeType, Image* parameterImage, const ModelFitInfo* modelFitInfo, const std::string& sessionName = ""); - MITKFITMIDATA_EXPORT ModelFitResultNodeVectorType CreateResultNodeMap(const ModelFitResultImageMapType& results, const ModelFitResultImageMapType& derivedResults, const ModelFitResultImageMapType& criterionResults, const ModelFitResultImageMapType& evaluationResults, const ModelFitInfo* fitInfo, const std::string& sessionName = ""); + MITKMODELFIT_EXPORT ModelFitResultNodeVectorType CreateResultNodeMap(const ModelFitResultImageMapType& results, const ModelFitResultImageMapType& derivedResults, const ModelFitResultImageMapType& criterionResults, const ModelFitResultImageMapType& evaluationResults, const ModelFitInfo* fitInfo, const std::string& sessionName = ""); - MITKFITMIDATA_EXPORT void StoreResultsInDataStorage(DataStorage* storage, const ModelFitResultNodeVectorType& resultNodes, DataNode* parentNode = NULL); + MITKMODELFIT_EXPORT void StoreResultsInDataStorage(DataStorage* storage, const ModelFitResultNodeVectorType& resultNodes, DataNode* parentNode = NULL); } } #endif diff --git a/Modules/FitMIData/include/mitkModelFitStaticParameterMap.h b/Modules/ModelFit/include/mitkModelFitStaticParameterMap.h similarity index 98% rename from Modules/FitMIData/include/mitkModelFitStaticParameterMap.h rename to Modules/ModelFit/include/mitkModelFitStaticParameterMap.h index 72df06e7a8..a6a4f4a9fc 100644 --- a/Modules/FitMIData/include/mitkModelFitStaticParameterMap.h +++ b/Modules/ModelFit/include/mitkModelFitStaticParameterMap.h @@ -1,159 +1,159 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkModelFitStaticParameterMap_h #define mitkModelFitStaticParameterMap_h #include #include #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" #include "mitkModelBase.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace mitk { namespace modelFit { /** Data structure that is used to store information about the static parameters of a model fit*/ - class MITKFITMIDATA_EXPORT StaticParameterMap + class MITKMODELFIT_EXPORT StaticParameterMap { private: /** @brief Type of the map key */ typedef ModelBase::ParameterNameType KeyType; public: /** @brief Type of the map value */ typedef ModelBase::StaticParameterValuesType ValueType; /** @brief Type of a variable, consisting of name and value list */ typedef std::pair StaticParameterType; private: /** @brief Type of the map */ typedef ModelBase::StaticParameterMapType MapType; /* @brief Stores the variables with their value lists */ MapType m_map; /** * @brief Stores the number of values that each list (which contains more than one * value) contains. */ unsigned int m_numValues; public: /** @brief Needed for 'foreach' support */ typedef MapType::const_iterator const_iterator; StaticParameterMap() : m_numValues(1) {} /** * @brief Adds the given value list under the given variable name if the name * doesn't exist already. If it does exist, nothing is added. * @pre The given list must contain either 1 or n values, where n is the * amount of values that lists contain which are already part of the * map (and contain more than one value). That means if the map is * empty or contains only lists that have only one value each, this * rule doesn't apply. An exception is thrown otherwise. * @param name The name of the variable to which the values should be added. * @param newList The value list that should be added. * @throw ModelFitException If the given list contains an amount of values that is * greater than 1 and doesn't match the amount of values * of the lists that are already part of the map (see * pre-condition). */ void Add(const std::string& name, const ValueType& newList); /** * @brief Returns the values of the given variable name. * @param name The name of the variables whose values should be returned. * @return The values of the given variable name. * @throw std::range_error If the variable name doesn't exist. */ const ValueType& Get(const std::string& name) const; MapType::size_type Size() const { return m_map.size(); } const_iterator begin() const { return m_map.begin(); } const_iterator end() const { return m_map.end(); } /** * @brief Sorts the values of the given variable name in ascending order. The * values of all other variables will also be switched in that specific * order. If name is empty or the variable could not be found, the map is * ordered by the first variable that contains more than one value (also in * ascending order). * @details Example: *
  • Before sorting: * "A": [3, 2, 5, 1, 4] * "B": [0] * "C": [3, 4, 1, 5, 2] *
  • Sort(): * "A": [1, 2, 3, 4, 5] * "B": [0] * "C": [5, 4, 3, 2, 1] *
  • Sort("B"): * "A": [5, 4, 3, 2, 1] * "B": [0] * "C": [1, 2, 3, 4, 5] *
  • Sort("X"): * "A": [1, 2, 3, 4, 5] * "B": [0] * "C": [5, 4, 3, 2, 1] * @param name The name of the variable the map should be sorted by. */ void Sort(const std::string& name = ""); /** * @brief Resets the map, so it's empty. */ void Clear(); }; /** * @brief Compares two var lists and returns true if the first list's first item is * lower than the second one's. * @param a The first list to compare the other one to. * @param b The other list to compare the first one to. * @return True if the first list's first item is smaller than the second one's. */ inline bool operator<(const StaticParameterMap::ValueType& a, const StaticParameterMap::ValueType& b) { return (a.front() < b.front()); } } } #ifdef _MSC_VER #pragma warning(pop) #endif #endif // mitkModelFitStaticParameterMap_h diff --git a/Modules/FitMIData/include/mitkModelFitUIDHelper.h b/Modules/ModelFit/include/mitkModelFitUIDHelper.h similarity index 79% rename from Modules/FitMIData/include/mitkModelFitUIDHelper.h rename to Modules/ModelFit/include/mitkModelFitUIDHelper.h index ffa91b31ce..df88559d70 100644 --- a/Modules/FitMIData/include/mitkModelFitUIDHelper.h +++ b/Modules/ModelFit/include/mitkModelFitUIDHelper.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkModelFitUIDHelper_h #define mitkModelFitUIDHelper_h #include //MITK #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { class BaseData; class DataStorage; typedef std::string NodeUIDType; /** Helper that searches for the node in the storage that has a data object with the given uid. Returns NULL if no node was found.*/ - DataNode::Pointer MITKFITMIDATA_EXPORT GetNodeByModelFitUID(const mitk::DataStorage* storage, const NodeUIDType& uid); + DataNode::Pointer MITKMODELFIT_EXPORT GetNodeByModelFitUID(const mitk::DataStorage* storage, const NodeUIDType& uid); /** Gets the UID of the passed data. The UID is stored in the property "data.uid". If this property does not exist the method will check the existance of a property for the DICOM tag series instance UID (0x0020, 0x000e) and return the value as UID. If this does also not exist, a UID will generated, the property "data.uid" will be added with a new UID and the new UID will be returned. @pre Passed data is a valid pointer.*/ - NodeUIDType MITKFITMIDATA_EXPORT EnsureModelFitUID(mitk::BaseData* data); + NodeUIDType MITKMODELFIT_EXPORT EnsureModelFitUID(mitk::BaseData* data); /** Convinience function that calls the overloaded EnsureModelFitUID() with the data of the passed node. @pre Passed node is a valid pointer.*/ - NodeUIDType MITKFITMIDATA_EXPORT EnsureModelFitUID(mitk::DataNode* node); + NodeUIDType MITKMODELFIT_EXPORT EnsureModelFitUID(mitk::DataNode* node); /** Helper that checks if the data has the passed UID. Following strategy will be used for the check. 1. Checks existance of property "data.uid" and if its content equals the passed uid. 2. If 1 fails, it checks the existance of a property for the DICOM tag series instance UID (0x0020, 0x000e) and the equality of its value. 3. If 2 also fails, return will be false.*/ - bool MITKFITMIDATA_EXPORT CheckModelFitUID(const mitk::BaseData* data, const NodeUIDType& uid); + bool MITKMODELFIT_EXPORT CheckModelFitUID(const mitk::BaseData* data, const NodeUIDType& uid); /** Convinience helper function that calls the overloaded CheckModelFitUID() with the data of the passed node.*/ - bool MITKFITMIDATA_EXPORT CheckModelFitUID(const mitk::DataNode* node, const NodeUIDType& uid); + bool MITKMODELFIT_EXPORT CheckModelFitUID(const mitk::DataNode* node, const NodeUIDType& uid); } #endif diff --git a/Modules/FitMIData/include/mitkModelGenerator.h b/Modules/ModelFit/include/mitkModelGenerator.h similarity index 95% rename from Modules/FitMIData/include/mitkModelGenerator.h rename to Modules/ModelFit/include/mitkModelGenerator.h index 7a641373b8..fb6ef84c42 100644 --- a/Modules/FitMIData/include/mitkModelGenerator.h +++ b/Modules/ModelFit/include/mitkModelGenerator.h @@ -1,63 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODEL_GENERATOR_H #define MODEL_GENERATOR_H #include "mitkModelBase.h" #include "mitkModelFactoryBase.h" #include "mitkModelParameterizerBase.h" #include "mitkModelFitInfo.h" #include "mitkIModelFitProvider.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT ModelGenerator + class MITKMODELFIT_EXPORT ModelGenerator { public: typedef ModelFactoryBase::ModellClassIDType ModelClassIDType; /** Returns the pointer to a factory instance that is responsible for the given model class id. If no fitting factory can be found, a null pointer is returned. */ static ModelFactoryBase::Pointer GetModelFactory(const ModelClassIDType& id); /** Takes a fit instances and generates the corresponding ModelParameterizer. If no fitting factory can be found or no class id is specified in the fit, a null pointer is returned. */ static ModelParameterizerBase::Pointer GenerateModelParameterizer(const modelFit::ModelFitInfo& fit); static IModelFitProvider* GetProviderService(const ModelClassIDType& id); protected: ModelGenerator(); virtual ~ModelGenerator(); private: //No copy constructor allowed ModelGenerator(const ModelGenerator& source); void operator=(const ModelGenerator&); //purposely not implemented }; } #endif // MODEL_GENERATOR_H diff --git a/Modules/FitMIData/include/mitkModelParameterizerBase.h b/Modules/ModelFit/include/mitkModelParameterizerBase.h similarity index 96% rename from Modules/FitMIData/include/mitkModelParameterizerBase.h rename to Modules/ModelFit/include/mitkModelParameterizerBase.h index 2de4bbf54f..ddbeeca636 100644 --- a/Modules/FitMIData/include/mitkModelParameterizerBase.h +++ b/Modules/ModelFit/include/mitkModelParameterizerBase.h @@ -1,104 +1,104 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MODEL_PARAMETERIZER_BASE_H #define __MODEL_PARAMETERIZER_BASE_H #include #include #include "mitkModelBase.h" #include "mitkInitialParameterizationDelegateBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Base class for all model parameterizers * Model parameterizers are used to offer a generic api to generate/bind * models with specific global static and local static parameters in order to * utilize the model correctly.\n * - Global static parameter: parameters that are the same for a model independent * of the spatial position (in image space) that should be modeled (e.g. parameter "Tau" * for the DescriptivePharmacokineticBrixModel) * - Local static parameter: parameters that are specific for the spatial position (in image space) * that should be modeled (e.g. parameter "S0" for the DescriptivePharmacokineticBrixModel) */ - class MITKFITMIDATA_EXPORT ModelParameterizerBase : public itk::Object, public ModelTraitsInterface + class MITKMODELFIT_EXPORT ModelParameterizerBase : public itk::Object, public ModelTraitsInterface { public: typedef ModelParameterizerBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelParameterizerBase, itk::Object); typedef ModelBase ModelBaseType; typedef ModelBaseType::Pointer ModelBasePointer; typedef ModelBaseType::ParametersType ParametersType; typedef ModelBaseType::StaticParameterValueType StaticParameterValueType; typedef ModelBaseType::StaticParameterValuesType StaticParameterValuesType; typedef ModelBaseType::StaticParameterMapType StaticParameterMapType; typedef ModelBaseType::TimeGridType TimeGridType; typedef ::itk::Index<3> IndexType; virtual StaticParameterMapType GetGlobalStaticParameters() const = 0; virtual StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const = 0; /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ ParametersType GetInitialParameterization() const; ParametersType GetInitialParameterization(const IndexType& currentPosition) const; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const = 0; /** Possibility to set a custom strategy for defining the initial parameterization via a delegate.*/ void SetInitialParameterizationDelegate(const InitialParameterizationDelegateBase* delegate); virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const = 0; /** Generate model instance, only with global static parametrization. * Any local static parameter stay default.*/ virtual ModelBasePointer GenerateParameterizedModel() const = 0; itkSetMacro(DefaultTimeGrid, TimeGridType); itkGetConstReferenceMacro(DefaultTimeGrid, TimeGridType); protected: ModelParameterizerBase(); virtual ~ModelParameterizerBase(); InitialParameterizationDelegateBase::ConstPointer m_InitialDelegate; /** The default time grid that should be set to generated models.*/ TimeGridType m_DefaultTimeGrid; private: //No copy constructor allowed ModelParameterizerBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/FitMIData/include/mitkModelTraitsInterface.h b/Modules/ModelFit/include/mitkModelTraitsInterface.h similarity index 97% rename from Modules/FitMIData/include/mitkModelTraitsInterface.h rename to Modules/ModelFit/include/mitkModelTraitsInterface.h index 6e8716713e..f039246372 100644 --- a/Modules/FitMIData/include/mitkModelTraitsInterface.h +++ b/Modules/ModelFit/include/mitkModelTraitsInterface.h @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MODEL_TRAITS_INTERFACE_H #define __MODEL_TRAITS_INTERFACE_H -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" #include #include #include namespace mitk { - class MITKFITMIDATA_EXPORT ModelTraitsInterface + class MITKMODELFIT_EXPORT ModelTraitsInterface { public: typedef itk::Array ModelResultType; using ParameterValueType = double; typedef itk::Array ParametersType; typedef std::string ParameterNameType; typedef std::vector ParameterNamesType; typedef ParametersType::SizeValueType ParametersSizeType; typedef ParameterNamesType DerivedParameterNamesType; typedef ParametersSizeType DerivedParametersSizeType; typedef std::map ParamterScaleMapType; typedef std::map ParamterUnitMapType; typedef std::map DerivedParamterScaleMapType; typedef std::map DerivedParamterUnitMapType; typedef std::string FunctionStringType; typedef std::string ModellClassIDType; /** Returns the names of parameters that must be defined when using * the model to compute the signal (GetSignal()).*/ virtual ParameterNamesType GetParameterNames() const = 0; /** Returns the number of parameters that must be defined when using * the model to compute the signal (GetSignal()).*/ virtual ParametersSizeType GetNumberOfParameters() const = 0; virtual ParamterScaleMapType GetParameterScales() const = 0; virtual ParamterUnitMapType GetParameterUnits() const = 0; /** Returns the names of derived parameters that must be defined when using * the model to compute them (GetDerivedParameters()).*/ virtual DerivedParameterNamesType GetDerivedParameterNames() const = 0; /** Returns the number of derived parameters that must be defined when using * the model to compute them (GetDerivedParameters()).*/ virtual DerivedParametersSizeType GetNumberOfDerivedParameters() const = 0; virtual DerivedParamterScaleMapType GetDerivedParameterScales() const = 0; virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const = 0; virtual std::string GetModelDisplayName() const = 0; virtual std::string GetModelType() const = 0; virtual FunctionStringType GetFunctionString() const = 0; virtual ModellClassIDType GetClassID() const = 0; virtual std::string GetXName() const = 0; virtual std::string GetXAxisName() const = 0; virtual std::string GetXAxisUnit() const = 0; virtual std::string GetYAxisName() const = 0; virtual std::string GetYAxisUnit() const = 0; protected: ModelTraitsInterface() {}; virtual ~ModelTraitsInterface() {}; private: //No copy constructor allowed ModelTraitsInterface(const ModelTraitsInterface& source); void operator=(const ModelTraitsInterface&); //purposely not implemented }; } #endif // __MODEL_TRAITS_INTERFACE_H diff --git a/Modules/FitMIData/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h similarity index 90% rename from Modules/FitMIData/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h rename to Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h index 772f9ba780..ab65dc8720 100644 --- a/Modules/FitMIData/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h +++ b/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H #define MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the squared differences between the model output and the * signal. */ -class MITKFITMIDATA_EXPORT NormalizedSumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction +class MITKMODELFIT_EXPORT NormalizedSumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef NormalizedSumOfSquaredDifferencesFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; NormalizedSumOfSquaredDifferencesFitCostFunction() { } ~NormalizedSumOfSquaredDifferencesFitCostFunction(){} }; } #endif // MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H diff --git a/Modules/FitMIData/include/mitkParameterFitImageGeneratorBase.h b/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h similarity index 97% rename from Modules/FitMIData/include/mitkParameterFitImageGeneratorBase.h rename to Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h index d462db436f..4046ed1822 100644 --- a/Modules/FitMIData/include/mitkParameterFitImageGeneratorBase.h +++ b/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_PARAMETER_FIT_IMAGE_GENERATOR_BASE_H_ #define __MITK_PARAMETER_FIT_IMAGE_GENERATOR_BASE_H_ #include #include #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Base class for generators for parameter fits of a given model. * The generators creates 4 types of images: * - parameter images: The images that encode the results of each fitted parameter * - derived parameter images: Images that encode the results of derived parameters defined by the model * - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters * - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy) * . */ - class MITKFITMIDATA_EXPORT ParameterFitImageGeneratorBase: public ::itk::Object + class MITKMODELFIT_EXPORT ParameterFitImageGeneratorBase: public ::itk::Object { public: mitkClassMacroItkParent(ParameterFitImageGeneratorBase, ::itk::Object); using ParameterImagePixelType = ScalarType; using ModelBaseType = ModelBase; using ParameterNameType = ModelBaseType::ParameterNameType; using ParameterNamesType = ModelBaseType::ParameterNamesType; using ParameterImageMapType = std::map; /** Returns the progress of the current fit. e.g. 0 : none; 0.5 = 50%; 1: complete*/ virtual double GetProgress() const = 0; /** Commences the model fit over the dynamic image data. Stores the fitted parameter in * parameter images. After this method call is finished the parameter images can be retrieved via * GetParameterImages. * @pre Model must be set * @pre DynamicImage must be set * @post Parameter image map contains an image for every parameter of the model referenced by the parameter name.*/ void Generate(); /** Returns the fitted/generated parameter images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetParameterImages(); /** Returns the generated derived parameter images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetDerivedParameterImages(); /** Returns the generated criterion images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetCriterionImages(); /** Returns the generated evaluation parameter images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetEvaluationParameterImages(); /** Returns the names of the fitted/generated parameters, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetParameterNames() const = 0; /** Returns the names of the derived parameters, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetDerivedParameterNames() const = 0; /** Returns the names of the criteria, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetCriterionNames() const = 0; /** Returns the names of the evaluation parameters, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetEvaluationParameterNames() const = 0; protected: ParameterFitImageGeneratorBase() {}; virtual ~ParameterFitImageGeneratorBase() {}; virtual bool HasOutdatedResult() const; /** Check if the fit can be generated and all needed inputs are valid. * Throw an exception for a non valid or missing input.*/ virtual void CheckValidInputs() const; virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) = 0; itk::TimeStamp m_GenerationTimeStamp; private: ParameterImageMapType m_ParameterImageMap; ParameterImageMapType m_DerivedParameterImageMap; ParameterImageMapType m_CriterionImageMap; ParameterImageMapType m_EvaluationParameterImageMap; }; } #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_ diff --git a/Modules/FitMIData/include/mitkPixelBasedParameterFitImageGenerator.h b/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h similarity index 97% rename from Modules/FitMIData/include/mitkPixelBasedParameterFitImageGenerator.h rename to Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h index f272ac6c66..9f9e58aa65 100644 --- a/Modules/FitMIData/include/mitkPixelBasedParameterFitImageGenerator.h +++ b/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h @@ -1,134 +1,134 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_PIXEL_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #define __MITK_PIXEL_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #include #include #include "mitkModelParameterizerBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkParameterFitImageGeneratorBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Class for generators for pixel based parameter fits of a given model based on a given 4D mitk image. * The class uses a model fit functor (based on ModelFitFunctorBase) given by the use. * @remark This generator fits every pixel on its own. If you want to fit the mean value of the given mask use * ROIBasedParameterFitImageGenerator. * The generator creates 4 types of images: * - parameter images: The images that encode the results of each fitted parameter * - derived parameter images: Images that encode the results of derived parameters defined by the model * - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters * - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy) * . */ -class MITKFITMIDATA_EXPORT PixelBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase +class MITKMODELFIT_EXPORT PixelBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase { public: mitkClassMacro(PixelBasedParameterFitImageGenerator, ParameterFitImageGeneratorBase); itkNewMacro(Self); typedef ScalarType ParameterImagePixelType; typedef std::vector FunctorValueArrayType; typedef ModelFitFunctorBase FitFunctorType; typedef ModelParameterizerBase ParameterizerType; typedef ParameterFitImageGeneratorBase::ModelBaseType ModelBaseType; typedef ParameterFitImageGeneratorBase::ParameterNameType ParameterNameType; typedef ParameterFitImageGeneratorBase::ParameterImageMapType ParameterImageMapType; itkSetObjectMacro(DynamicImage, Image); itkGetConstObjectMacro(DynamicImage, Image); itkSetObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); itkSetObjectMacro(FitFunctor, FitFunctorType); itkGetObjectMacro(FitFunctor, FitFunctorType); itkSetObjectMacro(ModelParameterizer, ParameterizerType); itkGetObjectMacro(ModelParameterizer, ParameterizerType); itkSetMacro(TimeGridByParameterizer, bool); itkGetMacro(TimeGridByParameterizer, bool); itkBooleanMacro(TimeGridByParameterizer); virtual double GetProgress() const override; virtual ParameterNamesType GetParameterNames() const override; virtual ParameterNamesType GetDerivedParameterNames() const override; virtual ParameterNamesType GetCriterionNames() const override; virtual ParameterNamesType GetEvaluationParameterNames() const override; protected: PixelBasedParameterFitImageGenerator() : m_Progress(0), m_TimeGridByParameterizer(false) { m_InternalMask = nullptr; m_Mask = nullptr; m_DynamicImage = nullptr; }; ~PixelBasedParameterFitImageGenerator() = default; template void DoParameterFit(itk::Image* image); template void DoPrepareMask(itk::Image* image); void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject); virtual bool HasOutdatedResult() const; virtual void CheckValidInputs() const; virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages); private: Image::Pointer m_DynamicImage; Image::Pointer m_Mask; typedef itk::Image InternalMaskType; InternalMaskType::Pointer m_InternalMask; FitFunctorType::Pointer m_FitFunctor; ParameterizerType::Pointer m_ModelParameterizer; ParameterImageMapType m_TempResultMap; ParameterImageMapType m_TempDerivedResultMap; ParameterImageMapType m_TempEvaluationResultMap; ParameterImageMapType m_TempCriterionResultMap; double m_Progress; /**Indicates if the time grid defined in the parameterizer should be used (True) or if the filter should extract the time grid from the input image (False).*/ bool m_TimeGridByParameterizer; }; } #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_ diff --git a/Modules/FitMIData/include/mitkROIBasedParameterFitImageGenerator.h b/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h similarity index 97% rename from Modules/FitMIData/include/mitkROIBasedParameterFitImageGenerator.h rename to Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h index a0fb254fa6..783b8573c1 100644 --- a/Modules/FitMIData/include/mitkROIBasedParameterFitImageGenerator.h +++ b/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #define __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #include #include #include "mitkModelParameterizerBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkParameterFitImageGeneratorBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Class for generators for parameter fits of a given model based on one given signal and its time grid. * The class uses a model fit functor (based on ModelFitFunctorBase) given by the user. It will fit the model to the passed signal. * To produce the output/parameter images, the passed mask will be used as template. The geometry of the mask specifies the geometry * of the result images. Every pixel inside the mask (mask value > 0) will be filled with the fitting results. Every pixel outside the mask * (mask value == 0) will be set to 0.\n * The generators creates 4 types of images: * - parameter images: The images that encode the results of each fitted parameter * - derived parameter images: Images that encode the results of derived parameters defined by the model * - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters * - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy) * . */ -class MITKFITMIDATA_EXPORT ROIBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase +class MITKMODELFIT_EXPORT ROIBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase { public: mitkClassMacro(ROIBasedParameterFitImageGenerator, ParameterFitImageGeneratorBase); itkNewMacro(Self); using ParameterImagePixelType = ScalarType; using FunctorValueArrayType = std::vector; using FitFunctorType = ModelFitFunctorBase; using ParameterizerType = ModelParameterizerBase; using ModelBaseType = ParameterFitImageGeneratorBase::ModelBaseType; using ParameterNameType = ParameterFitImageGeneratorBase::ParameterNameType; using ParameterImageMapType = ParameterFitImageGeneratorBase::ParameterImageMapType; using TimeGridType = ModelBaseType::TimeGridType; using SignalType = ModelBaseType::ModelResultType; itkSetObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); itkGetConstReferenceMacro(Signal, SignalType); itkSetMacro(Signal, SignalType); itkGetConstReferenceMacro(TimeGrid, TimeGridType); itkSetMacro(TimeGrid, TimeGridType); itkSetObjectMacro(FitFunctor, FitFunctorType); itkGetObjectMacro(FitFunctor, FitFunctorType); itkSetObjectMacro(ModelParameterizer, ParameterizerType); itkGetObjectMacro(ModelParameterizer, ParameterizerType); virtual double GetProgress() const override; virtual ParameterNamesType GetParameterNames() const override; virtual ParameterNamesType GetDerivedParameterNames() const override; virtual ParameterNamesType GetCriterionNames() const override; virtual ParameterNamesType GetEvaluationParameterNames() const override; protected: ROIBasedParameterFitImageGenerator() : m_Progress(0) { m_Mask = nullptr; }; virtual ~ROIBasedParameterFitImageGenerator() override = default; template void DoImageGeneration(itk::Image* image, double value); void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject); virtual bool HasOutdatedResult() const override; virtual void CheckValidInputs() const override; virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override; private: Image::Pointer m_Mask; SignalType m_Signal; TimeGridType m_TimeGrid; FitFunctorType::Pointer m_FitFunctor; Image::Pointer m_TempResultImage; ParameterizerType::Pointer m_ModelParameterizer; double m_Progress; }; } #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_ diff --git a/Modules/FitMIData/include/mitkReducedChiSquareFitCostFunction.h b/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h similarity index 85% rename from Modules/FitMIData/include/mitkReducedChiSquareFitCostFunction.h rename to Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h index 9ce169f4c5..5195c71eb8 100644 --- a/Modules/FitMIData/include/mitkReducedChiSquareFitCostFunction.h +++ b/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h @@ -1,36 +1,36 @@ #ifndef REDUCED_CHI_SQUARE_FITCOSTFUNCTION_H #define REDUCED_CHI_SQUARE_FITCOSTFUNCTION_H #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT ReducedChiSquareFitCostFunction : public mitk::SVModelFitCostFunction + class MITKMODELFIT_EXPORT ReducedChiSquareFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef ReducedChiSquareFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; ReducedChiSquareFitCostFunction() { } ~ReducedChiSquareFitCostFunction(){} }; } #endif // REDUCEDCHISQUAREFITCOSTFUNCTION_H diff --git a/Modules/FitMIData/include/mitkSVModelFitCostFunction.h b/Modules/ModelFit/include/mitkSVModelFitCostFunction.h similarity index 92% rename from Modules/FitMIData/include/mitkSVModelFitCostFunction.h rename to Modules/ModelFit/include/mitkSVModelFitCostFunction.h index eabe4dda32..33e5363a70 100644 --- a/Modules/FitMIData/include/mitkSVModelFitCostFunction.h +++ b/Modules/ModelFit/include/mitkSVModelFitCostFunction.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SV_MODELFITCOSTFUNCTION_H #define SV_MODELFITCOSTFUNCTION_H #include #include #include "mitkModelFitCostFunctionInterface.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Base class for all model fit cost function that return a singel cost value*/ -class MITKFITMIDATA_EXPORT SVModelFitCostFunction : public itk::SingleValuedCostFunction, public ModelFitCostFunctionInterface +class MITKMODELFIT_EXPORT SVModelFitCostFunction : public itk::SingleValuedCostFunction, public ModelFitCostFunctionInterface { public: typedef SVModelFitCostFunction Self; typedef itk::SingleValuedCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef ModelFitCostFunctionInterface::SignalType SignalType; typedef Superclass::MeasureType MeasureType; typedef Superclass::DerivativeType DerivativeType; void SetSample(const SignalType &sampleSet); MeasureType GetValue(const ParametersType& parameter) const; void GetDerivative (const ParametersType ¶meters, DerivativeType &derivative) const; unsigned int GetNumberOfParameters (void) const; itkSetConstObjectMacro(Model, ModelBase); itkGetConstObjectMacro(Model, ModelBase); itkSetMacro(DerivativeStepLength, double); itkGetConstMacro(DerivativeStepLength, double); protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const = 0; SVModelFitCostFunction(): m_DerivativeStepLength(1e-5) { } ~SVModelFitCostFunction(){} SignalType m_Sample; private: ModelBase::ConstPointer m_Model; /**value (delta of parameters) used to compute the derivatives numerically*/ double m_DerivativeStepLength; }; } #endif // SV_MODELFITCOSTFUNCTION_H diff --git a/Modules/FitMIData/include/mitkScalarListLookupTable.h b/Modules/ModelFit/include/mitkScalarListLookupTable.h similarity index 95% rename from Modules/FitMIData/include/mitkScalarListLookupTable.h rename to Modules/ModelFit/include/mitkScalarListLookupTable.h index 55e28d2f0c..d5d419a197 100644 --- a/Modules/FitMIData/include/mitkScalarListLookupTable.h +++ b/Modules/ModelFit/include/mitkScalarListLookupTable.h @@ -1,104 +1,104 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkScalarListLookupTable_h #define mitkScalarListLookupTable_h #include #include #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) #endif namespace mitk { /** * @brief Data class for modelfit properties that store a map of lists (e.g. static * parameters). */ - class MITKFITMIDATA_EXPORT ScalarListLookupTable + class MITKMODELFIT_EXPORT ScalarListLookupTable { public: typedef std::string KeyType; typedef std::vector ValueType; typedef std::map LookupTableType; typedef std::pair EntryType; ScalarListLookupTable() {} virtual ~ScalarListLookupTable() {} virtual const char* GetNameOfClass() const; /** * @brief Sets the list at the given map key to the given value. * @param key The name of the list (i.e. map key). * @param value The list to be added (i.e. map value). */ void SetTableValue(const KeyType& key, const ValueType& value); /** * @brief Returns true if the list with the given name exists. * @param key The name of the desired list (i.e. map key) * @return true if the list exists or false otherwise. */ bool ValueExists(const KeyType& key) const; /** * @brief Returns the list with the given name. * @param key The name (i.e. map key) of the desired list. * @return The list with the given name. * @throw std::range_error If the list doesn't exist. */ const ValueType& GetTableValue(const KeyType& key) const; /** * @brief Returns the map of lists. * @return The map of lists. */ const LookupTableType& GetLookupTable() const; void SetLookupTable(const LookupTableType& table); bool operator==(const ScalarListLookupTable& lookupTable) const; bool operator!=(const ScalarListLookupTable& lookupTable) const; virtual ScalarListLookupTable& operator=(const ScalarListLookupTable& other); protected: LookupTableType m_LookupTable; }; /** * @brief Adds the string representation of the given ScalarListLookupTable to the * given stream. * @param stream The stream to which the map's string representation should be added. * @param l The map whose string representation should be added to the stream. * @return The given stream with the added string representation of the map. */ - MITKFITMIDATA_EXPORT std::ostream& operator<<(std::ostream& stream, + MITKMODELFIT_EXPORT std::ostream& operator<<(std::ostream& stream, const ScalarListLookupTable& l); } #ifdef _MSC_VER #pragma warning(pop) #endif #endif // mitkScalarListLookupTable_h diff --git a/Modules/FitMIData/include/mitkScalarListLookupTableProperty.h b/Modules/ModelFit/include/mitkScalarListLookupTableProperty.h similarity index 90% rename from Modules/FitMIData/include/mitkScalarListLookupTableProperty.h rename to Modules/ModelFit/include/mitkScalarListLookupTableProperty.h index f5c49b0ab2..16009c7a98 100644 --- a/Modules/FitMIData/include/mitkScalarListLookupTableProperty.h +++ b/Modules/ModelFit/include/mitkScalarListLookupTableProperty.h @@ -1,31 +1,31 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkScalarListLookupTableProperty_h #define mitkScalarListLookupTableProperty_h -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" #include "mitkGenericProperty.h" #include "mitkScalarListLookupTable.h" namespace mitk { mitkDeclareGenericProperty(ScalarListLookupTableProperty, ScalarListLookupTable, - MITKFITMIDATA_EXPORT); + MITKMODELFIT_EXPORT); } #endif // mitkScalarListLookupTableProperty_h diff --git a/Modules/FitMIData/include/mitkScalarListLookupTablePropertySerializer.h b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h similarity index 85% rename from Modules/FitMIData/include/mitkScalarListLookupTablePropertySerializer.h rename to Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h index 1f939a1d75..8fce7fef5a 100644 --- a/Modules/FitMIData/include/mitkScalarListLookupTablePropertySerializer.h +++ b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkScalarListLookupTablePropertySerializer_h #define mitkScalarListLookupTablePropertySerializer_h #include "mitkBasePropertySerializer.h" #include "mitkBaseProperty.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** * @brief Serializer for the ScalarListLookupTableProperty so it can be written and read from * file. */ class ScalarListLookupTablePropertySerializer : public BasePropertySerializer { public: mitkClassMacro(ScalarListLookupTablePropertySerializer, BasePropertySerializer); itkNewMacro(Self); virtual TiXmlElement* Serialize(); virtual BaseProperty::Pointer Deserialize(TiXmlElement* element); protected: ScalarListLookupTablePropertySerializer() {} virtual ~ScalarListLookupTablePropertySerializer() {} }; namespace PropertyPersistenceSerialization { /** Serialization of a ScalarListLookupTableProperty into a XML string.*/ - MITKFITMIDATA_EXPORT ::std::string serializeScalarListLookupTablePropertyToXML(const mitk::BaseProperty *prop); + MITKMODELFIT_EXPORT ::std::string serializeScalarListLookupTablePropertyToXML(const mitk::BaseProperty *prop); } namespace PropertyPersistenceDeserialization { /**Deserialize a passed XML string into a ScalarListLookupTableProperty.*/ - MITKFITMIDATA_EXPORT mitk::BaseProperty::Pointer deserializeXMLToScalarListLookupTableProperty(const std::string &value); + MITKMODELFIT_EXPORT mitk::BaseProperty::Pointer deserializeXMLToScalarListLookupTableProperty(const std::string &value); } } #endif // mitkScalarListLookupTablePropertySerializer_h diff --git a/Modules/FitMIData/include/mitkSimpleBarrierConstraintChecker.h b/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h similarity index 97% rename from Modules/FitMIData/include/mitkSimpleBarrierConstraintChecker.h rename to Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h index 763918f69f..93d18f07e8 100644 --- a/Modules/FitMIData/include/mitkSimpleBarrierConstraintChecker.h +++ b/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h @@ -1,130 +1,130 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SIMPLE_BARRIER_CONSTRAINT_CHECKER_H #define SIMPLE_BARRIER_CONSTRAINT_CHECKER_H #include "mitkConstraintCheckerBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** \class SimpleBarrierConstraintChecker * \brief This class implements constraints as simple barrier functions. * * SimpleBarrierConstraintChecker is used to check parameters against inequality * constraints realized as simple barrier functions.\n * Inequality constraints will be transformed to an inequality greater * or equal zero (c(x)>= 0). The BarrierSize indicates the size of the * region in front of the border of the legal value range. The barrier * function is modelled by log(c(x)/BarrierSize).\n * Example:\n * The given constraint is 500<= param_1. Its barriersize is 50, so * the barrier region is between 500 and 550.\n * The constraint will be transformed in 0 <= param_1 - 500. * The barrier function will 0 for any param_1 > 550 and * min(-log((param_1 - 500)/50), MaxConstraintPenalty) * for any other value of param_1.\n * If you have set a sum barrier, it will be checked against the value sum of the * specified parameters. */ - class MITKFITMIDATA_EXPORT SimpleBarrierConstraintChecker : public ConstraintCheckerBase + class MITKMODELFIT_EXPORT SimpleBarrierConstraintChecker : public ConstraintCheckerBase { public: typedef SimpleBarrierConstraintChecker Self; typedef ConstraintCheckerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); typedef Superclass::PenaltyValueType PenaltyValueType; typedef Superclass::PenaltyArrayType PenaltyArrayType; typedef Superclass::SignalType SignalType; typedef Superclass::ParametersType ParametersType; typedef double BarrierValueType; typedef double BarrierWidthType; typedef ParametersType::SizeValueType ParameterIndexType; typedef std::vector ParameterIndexVectorType; struct Constraint { ParameterIndexVectorType parameters; BarrierValueType barrier; BarrierWidthType width; bool upperBarrier; Constraint(): barrier(0), width(0), upperBarrier(true) {}; }; virtual PenaltyArrayType GetPenalties(const ParametersType& parameters) const override; virtual unsigned int GetNumberOfConstraints() const override; virtual PenaltyValueType GetFailedConstraintValue() const override; /** Sets a lower barrier for one parameter*/ void SetLowerBarrier(ParameterIndexType parameterID, BarrierValueType barrier, BarrierWidthType width = 0.0); /** Sets an upper barrier for one parameter*/ void SetUpperBarrier(ParameterIndexType parameterID, BarrierValueType barrier, BarrierWidthType width = 0.0); /** Sets a lower sum barrier for a set of parameter*/ void SetLowerSumBarrier(const ParameterIndexVectorType& parameterIDs, BarrierValueType barrier, BarrierWidthType width = 0.0); /** Sets an upper sum barrier for a set of parameter*/ void SetUpperSumBarrier(const ParameterIndexVectorType& parameterIDs, BarrierValueType barrier, BarrierWidthType width = 0.0); /*returns the constraint with the given index. @pre The index must exist.*/ Constraint& GetConstraint(unsigned int index); /*returns the constraint with the given index. @pre The index must exist.*/ const Constraint& GetConstraint(unsigned int index) const; /*removes a constraint. Indicated by the index. If the index does not exist, nothing will be removed and the state of the checker stays untouched.*/ void DeleteConstraint(unsigned int index); void ResetConstraints(); itkSetMacro(MaxConstraintPenalty, PenaltyValueType); itkGetConstMacro(MaxConstraintPenalty, PenaltyValueType); protected: typedef std::vector ConstraintVectorType; ConstraintVectorType m_Constraints; PenaltyValueType CalcPenalty(const ParametersType& parameters, const Constraint& constraint) const; SimpleBarrierConstraintChecker() : m_MaxConstraintPenalty(1e15) { } ~SimpleBarrierConstraintChecker() {} private: PenaltyValueType m_MaxConstraintPenalty; }; } #endif // SimpleBarrierConstraintChecker_H diff --git a/Modules/FitMIData/include/mitkSimpleFunctorBase.h b/Modules/ModelFit/include/mitkSimpleFunctorBase.h similarity index 94% rename from Modules/FitMIData/include/mitkSimpleFunctorBase.h rename to Modules/ModelFit/include/mitkSimpleFunctorBase.h index b22482c01b..5d12fec810 100644 --- a/Modules/FitMIData/include/mitkSimpleFunctorBase.h +++ b/Modules/ModelFit/include/mitkSimpleFunctorBase.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SIMPLEFUNCTORBASE_H #define SIMPLEFUNCTORBASE_H #include #include #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /**Simple functor base class for the itkMultiOutputNaryFunctorImageFilter. */ - class MITKFITMIDATA_EXPORT SimpleFunctorBase: public ::itk::Object + class MITKMODELFIT_EXPORT SimpleFunctorBase: public ::itk::Object { public: typedef SimpleFunctorBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(SimpleFunctorBase, itk::Object); typedef ScalarType InputImagePixelType; typedef std::vector InputPixelVectorType; typedef std::vector OutputPixelVectorType; typedef itk::Array GridArrayType; virtual GridArrayType GetGrid() const = 0; virtual OutputPixelVectorType Compute(const InputPixelVectorType & value) const = 0; /** @todo #3 Function needs to be implemented in every derived Functor * The function is already declared here to ensure that derived models give feedback on how many output parameters they produce * This is requested by several generators */ virtual unsigned int GetNumberOfOutputs() const = 0; protected: SimpleFunctorBase(); virtual ~SimpleFunctorBase(); }; } #endif // SIMPLEFUNCTORBASE_H diff --git a/Modules/FitMIData/include/mitkSimpleFunctorPolicy.h b/Modules/ModelFit/include/mitkSimpleFunctorPolicy.h similarity index 95% rename from Modules/FitMIData/include/mitkSimpleFunctorPolicy.h rename to Modules/ModelFit/include/mitkSimpleFunctorPolicy.h index b178f1a328..27d5827cca 100644 --- a/Modules/FitMIData/include/mitkSimpleFunctorPolicy.h +++ b/Modules/ModelFit/include/mitkSimpleFunctorPolicy.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SIMPLEFUNCTOR_POLICY_H #define SIMPLEFUNCTOR_POLICY_H #include "itkIndex.h" #include "mitkSimpleFunctorBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT SimpleFunctorPolicy + class MITKMODELFIT_EXPORT SimpleFunctorPolicy { public: typedef std::vector InputPixelArrayType; typedef std::vector OutputPixelArrayType; typedef SimpleFunctorBase FunctorType; typedef SimpleFunctorBase::ConstPointer FunctorConstPointer; typedef itk::Index<3> IndexType; SimpleFunctorPolicy(); ~SimpleFunctorPolicy(); unsigned int GetNumberOfOutputs() const; void SetFunctor(const mitk::SimpleFunctorBase *functor); bool operator!=(const SimpleFunctorPolicy & other) const; bool operator==(const SimpleFunctorPolicy & other) const; inline OutputPixelArrayType operator()( const InputPixelArrayType & value, const IndexType& /*currentIndex*/ ) const { if (!m_Functor) { itkGenericExceptionMacro(<< "Error. Cannot process operator(). Functor is Null."); } OutputPixelArrayType result = m_Functor->Compute(value); return result; } private: FunctorConstPointer m_Functor; }; } #endif // SIMPLEFUNCTORPOLICY_H diff --git a/Modules/FitMIData/include/mitkSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h similarity index 91% rename from Modules/FitMIData/include/mitkSquaredDifferencesFitCostFunction.h rename to Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h index e8f98a3128..df9a201591 100644 --- a/Modules/FitMIData/include/mitkSquaredDifferencesFitCostFunction.h +++ b/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #define SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the squared differences between the model output and the * signal. */ -class MITKFITMIDATA_EXPORT SquaredDifferencesFitCostFunction : public mitk::MVModelFitCostFunction +class MITKMODELFIT_EXPORT SquaredDifferencesFitCostFunction : public mitk::MVModelFitCostFunction { public: typedef SquaredDifferencesFitCostFunction Self; typedef mitk::MVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; SquaredDifferencesFitCostFunction() { } ~SquaredDifferencesFitCostFunction(){} }; } #endif // SquaredDifferencesFitCostFunction_H diff --git a/Modules/FitMIData/include/mitkSumOfSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h similarity index 91% rename from Modules/FitMIData/include/mitkSumOfSquaredDifferencesFitCostFunction.h rename to Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h index 6ddc3a8bd6..e40cb0450e 100644 --- a/Modules/FitMIData/include/mitkSumOfSquaredDifferencesFitCostFunction.h +++ b/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SUM_OF_SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #define SUM_OF_SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #include -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the squared differences between the model output and the * signal. */ -class MITKFITMIDATA_EXPORT SumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction +class MITKMODELFIT_EXPORT SumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef SumOfSquaredDifferencesFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; SumOfSquaredDifferencesFitCostFunction() { } ~SumOfSquaredDifferencesFitCostFunction(){} }; } #endif // SumOfSquaredDifferencesFitCostFunction_H diff --git a/Modules/FitMIData/include/mitkT2DecayModel.h b/Modules/ModelFit/include/mitkT2DecayModel.h similarity index 96% rename from Modules/FitMIData/include/mitkT2DecayModel.h rename to Modules/ModelFit/include/mitkT2DecayModel.h index a35945d8a0..47faefaf46 100644 --- a/Modules/FitMIData/include/mitkT2DecayModel.h +++ b/Modules/ModelFit/include/mitkT2DecayModel.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_T2_DECAY_MODEL_H_ #define __MITK_T2_DECAY_MODEL_H_ #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Simple model of the MR T2 signal decay. */ - class MITKFITMIDATA_EXPORT T2DecayModel : public mitk::ModelBase + class MITKMODELFIT_EXPORT T2DecayModel : public mitk::ModelBase { public: typedef T2DecayModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(T2DecayModel, ModelBase); virtual std::string GetModelDisplayName() const override; virtual std::string GetModelType() const override; virtual FunctionStringType GetFunctionString() const override; virtual std::string GetXName() const override; virtual ParameterNamesType GetParameterNames() const override; virtual ParametersSizeType GetNumberOfParameters() const override; virtual ParameterNamesType GetStaticParameterNames() const override; virtual ParametersSizeType GetNumberOfStaticParameters() const override; protected: T2DecayModel() {}; virtual ~T2DecayModel() {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ virtual itk::LightObject::Pointer InternalClone() const; virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values); virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; private: //No copy constructor allowed T2DecayModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/FitMIData/include/mitkT2DecayModelFactory.h b/Modules/ModelFit/include/mitkT2DecayModelFactory.h similarity index 91% rename from Modules/FitMIData/include/mitkT2DecayModelFactory.h rename to Modules/ModelFit/include/mitkT2DecayModelFactory.h index 78b8007dbe..b9b815ad55 100644 --- a/Modules/FitMIData/include/mitkT2DecayModelFactory.h +++ b/Modules/ModelFit/include/mitkT2DecayModelFactory.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __T2_DECAY_TEST_MODEL_FACTORY_H #define __T2_DECAY_TEST_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkT2DecayModel.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT T2DecayModelFactory : public ConcreteModelFactoryBase + class MITKMODELFIT_EXPORT T2DecayModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(T2DecayModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); virtual ParametersType GetDefaultInitialParameterization() const override; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; protected: virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const; T2DecayModelFactory(); virtual ~T2DecayModelFactory(); private: //No copy constructor allowed T2DecayModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__LINEAR_TEST_MODEL_FACTORY_H diff --git a/Modules/FitMIData/include/mitkT2DecayModelParameterizer.h b/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h similarity index 95% rename from Modules/FitMIData/include/mitkT2DecayModelParameterizer.h rename to Modules/ModelFit/include/mitkT2DecayModelParameterizer.h index 0ba4ee3de2..aeb62bc389 100644 --- a/Modules/FitMIData/include/mitkT2DecayModelParameterizer.h +++ b/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __T2_DECAY_MODEL_PARAMETERIZER_H #define __T2_DECAY_MODEL_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkT2DecayModel.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT T2DecayModelParameterizer : public + class MITKMODELFIT_EXPORT T2DecayModelParameterizer : public mitk::ConcreteModelParameterizerBase { public: typedef T2DecayModelParameterizer Self; typedef mitk::ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(T2DecayModelParameterizer, mitk::ConcreteModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; virtual ParametersType GetDefaultInitialParameterization() const override; protected: T2DecayModelParameterizer(); virtual ~T2DecayModelParameterizer(); private: //No copy constructor allowed T2DecayModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __LINEAR_MODEL_PARAMETERIZER_H diff --git a/Modules/FitMIData/include/mitkTestArtifactGenerator.h b/Modules/ModelFit/include/mitkTestArtifactGenerator.h similarity index 67% rename from Modules/FitMIData/include/mitkTestArtifactGenerator.h rename to Modules/ModelFit/include/mitkTestArtifactGenerator.h index 66013a1942..e5e3334662 100644 --- a/Modules/FitMIData/include/mitkTestArtifactGenerator.h +++ b/Modules/ModelFit/include/mitkTestArtifactGenerator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __TEST_ARTIFACT_GENERATOR_H #define __TEST_ARTIFACT_GENERATOR_H #include "itkImage.h" #include "itkImageRegionIterator.h" #include "mitkImage.h" #include "mitkImagePixelReadAccessor.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { typedef itk::Image TestImageType; typedef itk::Image TestMaskType; - TestImageType::Pointer MITKFITMIDATA_EXPORT GenerateTestImage(int factor = 1); + TestImageType::Pointer MITKMODELFIT_EXPORT GenerateTestImage(int factor = 1); - TestMaskType::Pointer MITKFITMIDATA_EXPORT GenerateTestMask(); + TestMaskType::Pointer MITKMODELFIT_EXPORT GenerateTestMask(); - Image::Pointer MITKFITMIDATA_EXPORT GenerateTestFrame(double timePoint); + Image::Pointer MITKMODELFIT_EXPORT GenerateTestFrame(double timePoint); - Image::Pointer MITKFITMIDATA_EXPORT GenerateTestMaskMITK(); + Image::Pointer MITKMODELFIT_EXPORT GenerateTestMaskMITK(); - Image::Pointer MITKFITMIDATA_EXPORT GenerateDynamicTestImageMITK(); + Image::Pointer MITKMODELFIT_EXPORT GenerateDynamicTestImageMITK(); } #endif diff --git a/Modules/FitMIData/include/mitkTestModel.h b/Modules/ModelFit/include/mitkTestModel.h similarity index 97% rename from Modules/FitMIData/include/mitkTestModel.h rename to Modules/ModelFit/include/mitkTestModel.h index c3053bc875..ac4abf2048 100644 --- a/Modules/FitMIData/include/mitkTestModel.h +++ b/Modules/ModelFit/include/mitkTestModel.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_TEST_MODEL_H_ #define __MITK_TEST_MODEL_H_ #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /**Simple (linear) test model that is used to check functionality of default implementations in factories and stuff.*/ - class MITKFITMIDATA_EXPORT TestModel : public mitk::ModelBase + class MITKMODELFIT_EXPORT TestModel : public mitk::ModelBase { public: typedef TestModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(TestModel, ModelBase); virtual ParamterScaleMapType GetParameterScales() const override; virtual ParamterUnitMapType GetParameterUnits() const override; virtual std::string GetModelDisplayName() const override; virtual std::string GetModelType() const override; virtual FunctionStringType GetFunctionString() const override; virtual std::string GetXName() const override; virtual std::string GetXAxisName() const override; virtual std::string GetXAxisUnit() const override; virtual std::string GetYAxisName() const override; virtual std::string GetYAxisUnit() const override; virtual ParameterNamesType GetParameterNames() const override; virtual ParametersSizeType GetNumberOfParameters() const override; virtual ParameterNamesType GetStaticParameterNames() const override; virtual ParametersSizeType GetNumberOfStaticParameters() const override; virtual ParameterNamesType GetDerivedParameterNames() const override; virtual ParametersSizeType GetNumberOfDerivedParameters() const override; protected: TestModel() {}; virtual ~TestModel() {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ virtual itk::LightObject::Pointer InternalClone() const; virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& parameters) const override; virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values); virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; private: //No copy constructor allowed TestModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/FitMIData/include/mitkTestModelFactory.h b/Modules/ModelFit/include/mitkTestModelFactory.h similarity index 90% rename from Modules/FitMIData/include/mitkTestModelFactory.h rename to Modules/ModelFit/include/mitkTestModelFactory.h index 4ccbf4c1f5..162c8d7512 100644 --- a/Modules/FitMIData/include/mitkTestModelFactory.h +++ b/Modules/ModelFit/include/mitkTestModelFactory.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __TEST_MODEL_FACTORY_H #define __TEST_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkTestModel.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { - class MITKFITMIDATA_EXPORT TestModelFactory : public ConcreteModelFactoryBase + class MITKMODELFIT_EXPORT TestModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacro(TestModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); virtual ParametersType GetDefaultInitialParameterization() const; protected: virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const; TestModelFactory(); virtual ~TestModelFactory(); private: //No copy constructor allowed TestModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__LINEAR_TEST_MODEL_FACTORY_H diff --git a/Modules/FitMIData/include/mitkTimeGridHelper.h b/Modules/ModelFit/include/mitkTimeGridHelper.h similarity index 73% rename from Modules/FitMIData/include/mitkTimeGridHelper.h rename to Modules/ModelFit/include/mitkTimeGridHelper.h index 146eb1a0fd..2f4e7fdbfd 100644 --- a/Modules/FitMIData/include/mitkTimeGridHelper.h +++ b/Modules/ModelFit/include/mitkTimeGridHelper.h @@ -1,35 +1,35 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_TIME_GRID_HELPER_H_ #define __MITK_TIME_GRID_HELPER_H_ #include "mitkModelBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /* Checks if the time grid is monotone increasing (timeGrid[n] <= timeGrid[n+1]). * It is a precondition for the helper interpolate time grid.*/ - MITKFITMIDATA_EXPORT bool TimeGridIsMonotonIncreasing(const ModelBase::TimeGridType timeGrid); + MITKMODELFIT_EXPORT bool TimeGridIsMonotonIncreasing(const ModelBase::TimeGridType timeGrid); /* Helper function that interpolates a passed signal to a new time grid. * @pre The time grids must be monotone increasing. Use TimeGridIsMonotonIncreasing() to verify that.*/ - MITKFITMIDATA_EXPORT ModelBase::ModelResultType InterpolateSignalToNewTimeGrid(const ModelBase::ModelResultType& inputSignal, const ModelBase::TimeGridType& inputGrid, const ModelBase::TimeGridType& outputGrid); + MITKMODELFIT_EXPORT ModelBase::ModelResultType InterpolateSignalToNewTimeGrid(const ModelBase::ModelResultType& inputSignal, const ModelBase::TimeGridType& inputGrid, const ModelBase::TimeGridType& outputGrid); } #endif diff --git a/Modules/FitMIData/include/mitkValueBasedParameterizationDelegate.h b/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h similarity index 95% rename from Modules/FitMIData/include/mitkValueBasedParameterizationDelegate.h rename to Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h index 1407ac08d9..bed752876c 100644 --- a/Modules/FitMIData/include/mitkValueBasedParameterizationDelegate.h +++ b/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h @@ -1,76 +1,76 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __VALUE_BASED_PARAMETERIZATION_DELEGATE_H #define __VALUE_BASED_PARAMETERIZATION_DELEGATE_H #include #include #include "mitkInitialParameterizationDelegateBase.h" -#include "MitkFitMIDataExports.h" +#include "MitkModelFitExports.h" namespace mitk { /** Parameterization delegate that always use parameters defined by the users. */ - class MITKFITMIDATA_EXPORT ValueBasedParameterizationDelegate : public + class MITKMODELFIT_EXPORT ValueBasedParameterizationDelegate : public InitialParameterizationDelegateBase { public: typedef ValueBasedParameterizationDelegate Self; typedef InitialParameterizationDelegateBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); itkTypeMacro(ValueBasedParameterizationDelegate, InitialParameterizationDelegateBase); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ParametersType ParametersType; typedef Superclass::IndexType IndexType; void SetInitialParameterization(ParametersType params); /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ virtual ParametersType GetInitialParameterization() const; virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const; protected: ParametersType m_Parameterization; ValueBasedParameterizationDelegate(); virtual ~ValueBasedParameterizationDelegate(); private: //No copy constructor allowed ValueBasedParameterizationDelegate(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/FitMIData/src/Common/mitkBinaryImageToLabelSetImageFilter.cpp b/Modules/ModelFit/src/Common/mitkBinaryImageToLabelSetImageFilter.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkBinaryImageToLabelSetImageFilter.cpp rename to Modules/ModelFit/src/Common/mitkBinaryImageToLabelSetImageFilter.cpp diff --git a/Modules/FitMIData/src/Common/mitkExtractTimeGrid.cpp b/Modules/ModelFit/src/Common/mitkExtractTimeGrid.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkExtractTimeGrid.cpp rename to Modules/ModelFit/src/Common/mitkExtractTimeGrid.cpp diff --git a/Modules/FitMIData/src/Common/mitkFormulaParser.cpp b/Modules/ModelFit/src/Common/mitkFormulaParser.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkFormulaParser.cpp rename to Modules/ModelFit/src/Common/mitkFormulaParser.cpp diff --git a/Modules/FitMIData/src/Common/mitkFresnel.cpp b/Modules/ModelFit/src/Common/mitkFresnel.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkFresnel.cpp rename to Modules/ModelFit/src/Common/mitkFresnel.cpp diff --git a/Modules/FitMIData/src/Common/mitkIModelFitProvider.cpp b/Modules/ModelFit/src/Common/mitkIModelFitProvider.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkIModelFitProvider.cpp rename to Modules/ModelFit/src/Common/mitkIModelFitProvider.cpp diff --git a/Modules/FitMIData/src/Common/mitkMaskedDynamicImageStatisticsGenerator.cpp b/Modules/ModelFit/src/Common/mitkMaskedDynamicImageStatisticsGenerator.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkMaskedDynamicImageStatisticsGenerator.cpp rename to Modules/ModelFit/src/Common/mitkMaskedDynamicImageStatisticsGenerator.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelFitCmdAppsHelper.cpp b/Modules/ModelFit/src/Common/mitkModelFitCmdAppsHelper.cpp similarity index 83% rename from Modules/FitMIData/src/Common/mitkModelFitCmdAppsHelper.cpp rename to Modules/ModelFit/src/Common/mitkModelFitCmdAppsHelper.cpp index 907e6d733f..ed0319d98b 100644 --- a/Modules/FitMIData/src/Common/mitkModelFitCmdAppsHelper.cpp +++ b/Modules/ModelFit/src/Common/mitkModelFitCmdAppsHelper.cpp @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include std::string sanitizeString(const std::string& path) { auto result = path; std::string illegalChars = "\\/:?\"<>|%* "; for (auto &c : result) { bool found = illegalChars.find(c) != std::string::npos; if (found){ c = '_'; } } return result; } -MITKFITMIDATA_EXPORT std::string mitk::generateModelFitResultImagePath(const std::string& outputPathTemplate, const std::string& parameterName) +MITKMODELFIT_EXPORT std::string mitk::generateModelFitResultImagePath(const std::string& outputPathTemplate, const std::string& parameterName) { std::string ext = ::itksys::SystemTools::GetFilenameLastExtension(outputPathTemplate); std::string dir = itksys::SystemTools::GetFilenamePath(outputPathTemplate); dir = itksys::SystemTools::ConvertToOutputPath(dir); std::string rootName = itksys::SystemTools::GetFilenameWithoutLastExtension(outputPathTemplate); std::string fileName = rootName + "_" + sanitizeString(parameterName) + ext; std::string fullOutPath = itksys::SystemTools::ConvertToOutputPath(dir + "/" + fileName); return fullOutPath; } std::string convertParameterTypeToStr(mitk::modelFit::Parameter::Type type) { switch (type) { case mitk::modelFit::Parameter::ParameterType: return "parameter"; case mitk::modelFit::Parameter::DerivedType: return "derived"; case mitk::modelFit::Parameter::CriterionType: return "criterion"; case mitk::modelFit::Parameter::EvaluationType: return "evaluation"; default: return "unkown"; } } -MITKFITMIDATA_EXPORT void mitk::storeModelFitResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type nodeType, const mitk::modelFit::ModelFitInfo* modelFitInfo) +MITKMODELFIT_EXPORT void mitk::storeModelFitResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type nodeType, const mitk::modelFit::ModelFitInfo* modelFitInfo) { mitk::modelFit::SetModelFitDataProperties(image, parameterName, nodeType, modelFitInfo); storeParameterResultImage(outputPathTemplate, parameterName, image, nodeType); } -MITKFITMIDATA_EXPORT void mitk::storeParameterResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type parameterType) +MITKMODELFIT_EXPORT void mitk::storeParameterResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type parameterType) { std::string fullOutPath = generateModelFitResultImagePath(outputPathTemplate, parameterName); mitk::IOUtil::Save(image, fullOutPath); std::cout << "Store result " << convertParameterTypeToStr(parameterType) << ": " << parameterName << " -> " << fullOutPath << std::endl; } -MITKFITMIDATA_EXPORT void mitk::storeModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitSession) +MITKMODELFIT_EXPORT void mitk::storeModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitSession) { if (generator) { for (auto imageIterator : generator->GetParameterImages()) { storeModelFitResultImage(outputPathTemplate, imageIterator.first, imageIterator.second, mitk::modelFit::Parameter::ParameterType, fitSession); } for (auto imageIterator : generator->GetDerivedParameterImages()) { storeModelFitResultImage(outputPathTemplate, imageIterator.first, imageIterator.second, mitk::modelFit::Parameter::DerivedType, fitSession); } for (auto imageIterator : generator->GetCriterionImages()) { storeModelFitResultImage(outputPathTemplate, imageIterator.first, imageIterator.second, mitk::modelFit::Parameter::CriterionType, fitSession); } for (auto imageIterator : generator->GetEvaluationParameterImages()) { storeModelFitResultImage(outputPathTemplate, imageIterator.first, imageIterator.second, mitk::modelFit::Parameter::EvaluationType, fitSession); } } } -MITKFITMIDATA_EXPORT void mitk::previewModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator) +MITKMODELFIT_EXPORT void mitk::previewModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator) { if (generator) { for (auto aName : generator->GetParameterNames()) { std::cout << "Store result " << convertParameterTypeToStr(modelFit::Parameter::ParameterType) << ": " << aName << " -> " << generateModelFitResultImagePath(outputPathTemplate, aName) << std::endl; } for (auto aName : generator->GetDerivedParameterNames()) { std::cout << "Store result " << convertParameterTypeToStr(modelFit::Parameter::DerivedType) << ": " << aName << " -> " << generateModelFitResultImagePath(outputPathTemplate, aName) << std::endl; } for (auto aName : generator->GetCriterionNames()) { std::cout << "Store result " << convertParameterTypeToStr(modelFit::Parameter::CriterionType) << ": " << aName << " -> " << generateModelFitResultImagePath(outputPathTemplate, aName) << std::endl; } for (auto aName : generator->GetEvaluationParameterNames()) { std::cout << "Store result " << convertParameterTypeToStr(modelFit::Parameter::EvaluationType) << ": " << aName << " -> " << generateModelFitResultImagePath(outputPathTemplate, aName) << std::endl; } std::cout << "Preview done." << std::endl; } } diff --git a/Modules/FitMIData/src/Common/mitkModelFitConstants.cpp b/Modules/ModelFit/src/Common/mitkModelFitConstants.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelFitConstants.cpp rename to Modules/ModelFit/src/Common/mitkModelFitConstants.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelFitInfo.cpp b/Modules/ModelFit/src/Common/mitkModelFitInfo.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelFitInfo.cpp rename to Modules/ModelFit/src/Common/mitkModelFitInfo.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelFitParameter.cpp b/Modules/ModelFit/src/Common/mitkModelFitParameter.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelFitParameter.cpp rename to Modules/ModelFit/src/Common/mitkModelFitParameter.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelFitParameterValueExtraction.cpp b/Modules/ModelFit/src/Common/mitkModelFitParameterValueExtraction.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelFitParameterValueExtraction.cpp rename to Modules/ModelFit/src/Common/mitkModelFitParameterValueExtraction.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelFitResultHelper.cpp b/Modules/ModelFit/src/Common/mitkModelFitResultHelper.cpp similarity index 90% rename from Modules/FitMIData/src/Common/mitkModelFitResultHelper.cpp rename to Modules/ModelFit/src/Common/mitkModelFitResultHelper.cpp index c3eff09abb..ea751791fd 100644 --- a/Modules/FitMIData/src/Common/mitkModelFitResultHelper.cpp +++ b/Modules/ModelFit/src/Common/mitkModelFitResultHelper.cpp @@ -1,273 +1,273 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkModelFitResultHelper.h" #include #include #include "mitkModelTraitsInterface.h" #include "mitkModelFitConstants.h" #include "mitkModelFitInfo.h" namespace mitk { namespace modelFit { void AdaptDataPropertyToParameter(mitk::BaseData* data, const ModelBase::ParameterNameType& name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo* fitInfo) { assert(data); if (!data) { mitkThrow() << "Cannot add model or fit properties to data instance. Passed data instance is null. parameter name:" << name; } if (!fitInfo) { mitkThrow() << "Cannot add model or fit properties to data. Passed fit info instance is null. parameter name:" << name; } data->GetPropertyList()->SetStringProperty(ModelFitConstants::PARAMETER_NAME_PROPERTY_NAME().c_str(),name.c_str()); if (dataType == modelFit::Parameter::ParameterType) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME().c_str(), ModelFitConstants::PARAMETER_TYPE_VALUE_PARAMETER().c_str()); } else if (dataType == modelFit::Parameter::DerivedType) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME().c_str(), ModelFitConstants::PARAMETER_TYPE_VALUE_DERIVED_PARAMETER().c_str()); } else if (dataType == modelFit::Parameter::CriterionType) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME().c_str(), ModelFitConstants::PARAMETER_TYPE_VALUE_CRITERION().c_str()); } else if (dataType == modelFit::Parameter::EvaluationType) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME().c_str(), ModelFitConstants::PARAMETER_TYPE_VALUE_EVALUATION_PARAMETER().c_str()); } if (dataType == modelFit::Parameter::ParameterType || dataType == modelFit::Parameter::DerivedType) { modelFit::Parameter::ConstPointer param = fitInfo->GetParameter(name,dataType); if (param.IsNull()) { mitkThrow() << "Cannot generate model fit result data. Parameter name is not part of the model fit info. Parameter name: "<unit.empty()) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::PARAMETER_UNIT_PROPERTY_NAME().c_str(), param->unit.c_str()); } if (param->scale != 1.0) { data->GetPropertyList()->SetFloatProperty(ModelFitConstants::PARAMETER_SCALE_PROPERTY_NAME().c_str(), param->scale); } } }; void AdaptDataPropertyToModelFit(mitk::BaseData* data, const modelFit::ModelFitInfo* fitInfo) { assert(data); if (!data) { mitkThrow() << "Cannot add model or fit properties to data. Passed data instance is null."; } if (!fitInfo) { mitkThrow() << "Cannot add model or fit properties to data. Passed model traits instance is null."; } //model section data->GetPropertyList()->SetStringProperty(ModelFitConstants::MODEL_TYPE_PROPERTY_NAME().c_str(), fitInfo->modelType.c_str()); data->GetPropertyList()->SetStringProperty(ModelFitConstants::MODEL_NAME_PROPERTY_NAME().c_str(), fitInfo->modelName.c_str()); data->GetPropertyList()->SetStringProperty(ModelFitConstants::MODEL_FUNCTION_CLASS_PROPERTY_NAME().c_str(), fitInfo->functionClassID.c_str()); if(!(fitInfo->function.empty())) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::MODEL_FUNCTION_PROPERTY_NAME().c_str(), fitInfo->function.c_str()); data->GetPropertyList()->SetStringProperty(ModelFitConstants::MODEL_X_PROPERTY_NAME().c_str(), fitInfo->x.c_str()); } //axis section if (!fitInfo->xAxisName.empty()) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::XAXIS_NAME_PROPERTY_NAME().c_str(), fitInfo->xAxisName.c_str()); } if (!fitInfo->xAxisUnit.empty()) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::XAXIS_UNIT_PROPERTY_NAME().c_str(), fitInfo->xAxisUnit.c_str()); } if (!fitInfo->yAxisName.empty()) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::YAXIS_NAME_PROPERTY_NAME().c_str(), fitInfo->yAxisName.c_str()); } if (!fitInfo->yAxisUnit.empty()) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::YAXIS_UNIT_PROPERTY_NAME().c_str(), fitInfo->yAxisUnit.c_str()); } //fit section data->GetPropertyList()->SetStringProperty(ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str(), fitInfo->uid.c_str()); data->GetPropertyList()->SetStringProperty(ModelFitConstants::FIT_TYPE_PROPERTY_NAME().c_str(), fitInfo->fitType.c_str()); data->GetPropertyList()->SetStringProperty(ModelFitConstants::FIT_INPUT_IMAGEUID_PROPERTY_NAME().c_str(), fitInfo->inputUID.c_str()); if (fitInfo->inputData.GetLookupTable().size() > 0) { mitk::ScalarListLookupTableProperty::Pointer inputDataProp = mitk::ScalarListLookupTableProperty::New(); inputDataProp->SetValue(fitInfo->inputData); data->SetProperty(ModelFitConstants::FIT_INPUT_DATA_PROPERTY_NAME().c_str(), inputDataProp); } if (!fitInfo->roiUID.empty()) { data->GetPropertyList()->SetStringProperty(ModelFitConstants::FIT_INPUT_ROIUID_PROPERTY_NAME().c_str(), fitInfo->roiUID.c_str()); } data->SetProperty(ModelFitConstants::FIT_STATIC_PARAMETERS_PROPERTY_NAME().c_str(), ConvertStaticParametersToProperty(fitInfo->staticParamMap)); }; mitk::DataNode::Pointer CreateNode(const ModelBase::ParameterNameType& name, Image* parameterImage, const ModelFitInfo* fitInfo, const std::string& sessionName) { if (!parameterImage) { mitkThrow() << "Cannot generate model fit result node. Passed parameterImage is null. parameter name: "<SetData(parameterImage); std::string nodeName = name; if (!sessionName.empty()) { nodeName = sessionName+"_"+nodeName; } result->SetName(nodeName); result->SetVisibility(false); return result; }; } } mitk::ScalarListLookupTableProperty::Pointer mitk::modelFit::ConvertStaticParametersToProperty(const mitk::modelFit::StaticParameterMap& params) { mitk::ScalarListLookupTableProperty::Pointer result = mitk::ScalarListLookupTableProperty::New(); ScalarListLookupTable table; for(mitk::modelFit::StaticParameterMap::const_iterator pos = params.begin(); pos != params.end(); ++pos) { table.SetTableValue(pos->first,pos->second); } result->SetValue(table); return result; }; -MITKFITMIDATA_EXPORT void mitk::modelFit::SetModelFitDataProperties(mitk::BaseData* data, const ModelBase::ParameterNameType& name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo* fitInfo) +MITKMODELFIT_EXPORT void mitk::modelFit::SetModelFitDataProperties(mitk::BaseData* data, const ModelBase::ParameterNameType& name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo* fitInfo) { AdaptDataPropertyToModelFit(data, fitInfo); AdaptDataPropertyToParameter(data, name, dataType, fitInfo); }; -MITKFITMIDATA_EXPORT mitk::DataNode::Pointer mitk::modelFit::CreateResultNode( const ModelBase::ParameterNameType& name, modelFit::Parameter::Type nodeType, Image* parameterImage, const ModelFitInfo* modelFitInfo, const std::string& sessionName ) +MITKMODELFIT_EXPORT mitk::DataNode::Pointer mitk::modelFit::CreateResultNode( const ModelBase::ParameterNameType& name, modelFit::Parameter::Type nodeType, Image* parameterImage, const ModelFitInfo* modelFitInfo, const std::string& sessionName ) { if (!parameterImage) { mitkThrow() << "Cannot generate model fit result node. Passed parameterImage is null. parameter name: "<first, modelFit::Parameter::ParameterType, pos->second, fitInfo, sessionName); nodes.push_back(newNode); } for (ModelFitResultImageMapType::const_iterator pos = derivedResults.begin(); pos!=derivedResults.end(); ++pos) { DataNode::Pointer newNode = CreateResultNode(pos->first, modelFit::Parameter::DerivedType, pos->second, fitInfo, sessionName); nodes.push_back(newNode); } for (ModelFitResultImageMapType::const_iterator pos = criterionResults.begin(); pos!=criterionResults.end(); ++pos) { DataNode::Pointer newNode = CreateResultNode(pos->first, modelFit::Parameter::CriterionType, pos->second, fitInfo, sessionName); nodes.push_back(newNode); } for (ModelFitResultImageMapType::const_iterator pos = evaluationResults.begin(); pos!=evaluationResults.end(); ++pos) { DataNode::Pointer newNode = CreateResultNode(pos->first, modelFit::Parameter::EvaluationType, pos->second, fitInfo, sessionName); nodes.push_back(newNode); } return nodes; }; -MITKFITMIDATA_EXPORT void mitk::modelFit::StoreResultsInDataStorage(DataStorage* storage, const ModelFitResultNodeVectorType& resultNodes, DataNode* parentNode) +MITKMODELFIT_EXPORT void mitk::modelFit::StoreResultsInDataStorage(DataStorage* storage, const ModelFitResultNodeVectorType& resultNodes, DataNode* parentNode) { if (!storage) { mitkThrow() << "Cannot store model fit results in data storage. Passed storage is null."; } for (ModelFitResultNodeVectorType::const_iterator pos = resultNodes.begin(); pos!=resultNodes.end(); ++pos) { storage->Add(*pos,parentNode); } }; diff --git a/Modules/FitMIData/src/Common/mitkModelFitStaticParameterMap.cpp b/Modules/ModelFit/src/Common/mitkModelFitStaticParameterMap.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelFitStaticParameterMap.cpp rename to Modules/ModelFit/src/Common/mitkModelFitStaticParameterMap.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelFitUIDHelper.cpp b/Modules/ModelFit/src/Common/mitkModelFitUIDHelper.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelFitUIDHelper.cpp rename to Modules/ModelFit/src/Common/mitkModelFitUIDHelper.cpp diff --git a/Modules/FitMIData/src/Common/mitkModelGenerator.cpp b/Modules/ModelFit/src/Common/mitkModelGenerator.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkModelGenerator.cpp rename to Modules/ModelFit/src/Common/mitkModelGenerator.cpp diff --git a/Modules/FitMIData/src/Common/mitkParameterFitImageGeneratorBase.cpp b/Modules/ModelFit/src/Common/mitkParameterFitImageGeneratorBase.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkParameterFitImageGeneratorBase.cpp rename to Modules/ModelFit/src/Common/mitkParameterFitImageGeneratorBase.cpp diff --git a/Modules/FitMIData/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp b/Modules/ModelFit/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp rename to Modules/ModelFit/src/Common/mitkPixelBasedParameterFitImageGenerator.cpp diff --git a/Modules/FitMIData/src/Common/mitkROIBasedParameterFitImageGenerator.cpp b/Modules/ModelFit/src/Common/mitkROIBasedParameterFitImageGenerator.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkROIBasedParameterFitImageGenerator.cpp rename to Modules/ModelFit/src/Common/mitkROIBasedParameterFitImageGenerator.cpp diff --git a/Modules/FitMIData/src/Common/mitkScalarListLookupTable.cpp b/Modules/ModelFit/src/Common/mitkScalarListLookupTable.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkScalarListLookupTable.cpp rename to Modules/ModelFit/src/Common/mitkScalarListLookupTable.cpp diff --git a/Modules/FitMIData/src/Common/mitkScalarListLookupTableProperty.cpp b/Modules/ModelFit/src/Common/mitkScalarListLookupTableProperty.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkScalarListLookupTableProperty.cpp rename to Modules/ModelFit/src/Common/mitkScalarListLookupTableProperty.cpp diff --git a/Modules/FitMIData/src/Common/mitkScalarListLookupTablePropertySerializer.cpp b/Modules/ModelFit/src/Common/mitkScalarListLookupTablePropertySerializer.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkScalarListLookupTablePropertySerializer.cpp rename to Modules/ModelFit/src/Common/mitkScalarListLookupTablePropertySerializer.cpp diff --git a/Modules/FitMIData/src/Common/mitkTimeGridHelper.cpp b/Modules/ModelFit/src/Common/mitkTimeGridHelper.cpp similarity index 100% rename from Modules/FitMIData/src/Common/mitkTimeGridHelper.cpp rename to Modules/ModelFit/src/Common/mitkTimeGridHelper.cpp diff --git a/Modules/FitMIData/src/Functors/mitkChiSquareFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkChiSquareFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkChiSquareFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkChiSquareFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Functors/mitkConstraintCheckerBase.cpp b/Modules/ModelFit/src/Functors/mitkConstraintCheckerBase.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkConstraintCheckerBase.cpp rename to Modules/ModelFit/src/Functors/mitkConstraintCheckerBase.cpp diff --git a/Modules/FitMIData/src/Functors/mitkDummyModelFitFunctor.cpp b/Modules/ModelFit/src/Functors/mitkDummyModelFitFunctor.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkDummyModelFitFunctor.cpp rename to Modules/ModelFit/src/Functors/mitkDummyModelFitFunctor.cpp diff --git a/Modules/FitMIData/src/Functors/mitkIndexedValueFunctorPolicy.cpp b/Modules/ModelFit/src/Functors/mitkIndexedValueFunctorPolicy.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkIndexedValueFunctorPolicy.cpp rename to Modules/ModelFit/src/Functors/mitkIndexedValueFunctorPolicy.cpp diff --git a/Modules/FitMIData/src/Functors/mitkLevenbergMarquardtModelFitFunctor.cpp b/Modules/ModelFit/src/Functors/mitkLevenbergMarquardtModelFitFunctor.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkLevenbergMarquardtModelFitFunctor.cpp rename to Modules/ModelFit/src/Functors/mitkLevenbergMarquardtModelFitFunctor.cpp diff --git a/Modules/FitMIData/src/Functors/mitkMVConstrainedCostFunctionDecorator.cpp b/Modules/ModelFit/src/Functors/mitkMVConstrainedCostFunctionDecorator.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkMVConstrainedCostFunctionDecorator.cpp rename to Modules/ModelFit/src/Functors/mitkMVConstrainedCostFunctionDecorator.cpp diff --git a/Modules/FitMIData/src/Functors/mitkMVModelFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkMVModelFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkMVModelFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkMVModelFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Functors/mitkModelDataGenerationFunctor.cpp b/Modules/ModelFit/src/Functors/mitkModelDataGenerationFunctor.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkModelDataGenerationFunctor.cpp rename to Modules/ModelFit/src/Functors/mitkModelDataGenerationFunctor.cpp diff --git a/Modules/FitMIData/src/Functors/mitkModelFitFunctorBase.cpp b/Modules/ModelFit/src/Functors/mitkModelFitFunctorBase.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkModelFitFunctorBase.cpp rename to Modules/ModelFit/src/Functors/mitkModelFitFunctorBase.cpp diff --git a/Modules/FitMIData/src/Functors/mitkModelFitInfoSignalGenerationFunctor.cpp b/Modules/ModelFit/src/Functors/mitkModelFitInfoSignalGenerationFunctor.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkModelFitInfoSignalGenerationFunctor.cpp rename to Modules/ModelFit/src/Functors/mitkModelFitInfoSignalGenerationFunctor.cpp diff --git a/Modules/FitMIData/src/Functors/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Functors/mitkReducedChiSquareFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkReducedChiSquareFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkReducedChiSquareFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkReducedChiSquareFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Functors/mitkSVModelFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkSVModelFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkSVModelFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkSVModelFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Functors/mitkSimpleBarrierConstraintChecker.cpp b/Modules/ModelFit/src/Functors/mitkSimpleBarrierConstraintChecker.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkSimpleBarrierConstraintChecker.cpp rename to Modules/ModelFit/src/Functors/mitkSimpleBarrierConstraintChecker.cpp diff --git a/Modules/FitMIData/src/Functors/mitkSimpleFunctorBase.cpp b/Modules/ModelFit/src/Functors/mitkSimpleFunctorBase.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkSimpleFunctorBase.cpp rename to Modules/ModelFit/src/Functors/mitkSimpleFunctorBase.cpp diff --git a/Modules/FitMIData/src/Functors/mitkSimpleFunctorPolicy.cpp b/Modules/ModelFit/src/Functors/mitkSimpleFunctorPolicy.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkSimpleFunctorPolicy.cpp rename to Modules/ModelFit/src/Functors/mitkSimpleFunctorPolicy.cpp diff --git a/Modules/FitMIData/src/Functors/mitkSquaredDifferencesFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkSquaredDifferencesFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkSquaredDifferencesFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkSquaredDifferencesFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Functors/mitkSumOfSquaredDifferencesFitCostFunction.cpp b/Modules/ModelFit/src/Functors/mitkSumOfSquaredDifferencesFitCostFunction.cpp similarity index 100% rename from Modules/FitMIData/src/Functors/mitkSumOfSquaredDifferencesFitCostFunction.cpp rename to Modules/ModelFit/src/Functors/mitkSumOfSquaredDifferencesFitCostFunction.cpp diff --git a/Modules/FitMIData/src/Models/mitkGenericParamModel.cpp b/Modules/ModelFit/src/Models/mitkGenericParamModel.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkGenericParamModel.cpp rename to Modules/ModelFit/src/Models/mitkGenericParamModel.cpp diff --git a/Modules/FitMIData/src/Models/mitkGenericParamModelFactory.cpp b/Modules/ModelFit/src/Models/mitkGenericParamModelFactory.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkGenericParamModelFactory.cpp rename to Modules/ModelFit/src/Models/mitkGenericParamModelFactory.cpp diff --git a/Modules/FitMIData/src/Models/mitkGenericParamModelParameterizer.cpp b/Modules/ModelFit/src/Models/mitkGenericParamModelParameterizer.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkGenericParamModelParameterizer.cpp rename to Modules/ModelFit/src/Models/mitkGenericParamModelParameterizer.cpp diff --git a/Modules/FitMIData/src/Models/mitkImageBasedParameterizationDelegate.cpp b/Modules/ModelFit/src/Models/mitkImageBasedParameterizationDelegate.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkImageBasedParameterizationDelegate.cpp rename to Modules/ModelFit/src/Models/mitkImageBasedParameterizationDelegate.cpp diff --git a/Modules/FitMIData/src/Models/mitkInitialParameterizationDelegateBase.cpp b/Modules/ModelFit/src/Models/mitkInitialParameterizationDelegateBase.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkInitialParameterizationDelegateBase.cpp rename to Modules/ModelFit/src/Models/mitkInitialParameterizationDelegateBase.cpp diff --git a/Modules/FitMIData/src/Models/mitkLinearModel.cpp b/Modules/ModelFit/src/Models/mitkLinearModel.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkLinearModel.cpp rename to Modules/ModelFit/src/Models/mitkLinearModel.cpp diff --git a/Modules/FitMIData/src/Models/mitkLinearModelFactory.cpp b/Modules/ModelFit/src/Models/mitkLinearModelFactory.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkLinearModelFactory.cpp rename to Modules/ModelFit/src/Models/mitkLinearModelFactory.cpp diff --git a/Modules/FitMIData/src/Models/mitkModelBase.cpp b/Modules/ModelFit/src/Models/mitkModelBase.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkModelBase.cpp rename to Modules/ModelFit/src/Models/mitkModelBase.cpp diff --git a/Modules/FitMIData/src/Models/mitkModelFactoryBase.cpp b/Modules/ModelFit/src/Models/mitkModelFactoryBase.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkModelFactoryBase.cpp rename to Modules/ModelFit/src/Models/mitkModelFactoryBase.cpp diff --git a/Modules/FitMIData/src/Models/mitkModelParameterizerBase.cpp b/Modules/ModelFit/src/Models/mitkModelParameterizerBase.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkModelParameterizerBase.cpp rename to Modules/ModelFit/src/Models/mitkModelParameterizerBase.cpp diff --git a/Modules/FitMIData/src/Models/mitkT2DecayModel.cpp b/Modules/ModelFit/src/Models/mitkT2DecayModel.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkT2DecayModel.cpp rename to Modules/ModelFit/src/Models/mitkT2DecayModel.cpp diff --git a/Modules/FitMIData/src/Models/mitkT2DecayModelFactory.cpp b/Modules/ModelFit/src/Models/mitkT2DecayModelFactory.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkT2DecayModelFactory.cpp rename to Modules/ModelFit/src/Models/mitkT2DecayModelFactory.cpp diff --git a/Modules/FitMIData/src/Models/mitkT2DecayModelParameterizer.cpp b/Modules/ModelFit/src/Models/mitkT2DecayModelParameterizer.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkT2DecayModelParameterizer.cpp rename to Modules/ModelFit/src/Models/mitkT2DecayModelParameterizer.cpp diff --git a/Modules/FitMIData/src/Models/mitkValueBasedParameterizationDelegate.cpp b/Modules/ModelFit/src/Models/mitkValueBasedParameterizationDelegate.cpp similarity index 100% rename from Modules/FitMIData/src/Models/mitkValueBasedParameterizationDelegate.cpp rename to Modules/ModelFit/src/Models/mitkValueBasedParameterizationDelegate.cpp diff --git a/Modules/FitMIData/src/TestingHelper/mitkTestArtifactGenerator.cpp b/Modules/ModelFit/src/TestingHelper/mitkTestArtifactGenerator.cpp similarity index 100% rename from Modules/FitMIData/src/TestingHelper/mitkTestArtifactGenerator.cpp rename to Modules/ModelFit/src/TestingHelper/mitkTestArtifactGenerator.cpp diff --git a/Modules/FitMIData/src/TestingHelper/mitkTestModel.cpp b/Modules/ModelFit/src/TestingHelper/mitkTestModel.cpp similarity index 100% rename from Modules/FitMIData/src/TestingHelper/mitkTestModel.cpp rename to Modules/ModelFit/src/TestingHelper/mitkTestModel.cpp diff --git a/Modules/FitMIData/src/TestingHelper/mitkTestModelFactory.cpp b/Modules/ModelFit/src/TestingHelper/mitkTestModelFactory.cpp similarity index 100% rename from Modules/FitMIData/src/TestingHelper/mitkTestModelFactory.cpp rename to Modules/ModelFit/src/TestingHelper/mitkTestModelFactory.cpp diff --git a/Modules/FitMIData/test/CMakeLists.txt b/Modules/ModelFit/test/CMakeLists.txt similarity index 100% rename from Modules/FitMIData/test/CMakeLists.txt rename to Modules/ModelFit/test/CMakeLists.txt diff --git a/Modules/FitMIData/test/files.cmake b/Modules/ModelFit/test/files.cmake similarity index 100% rename from Modules/FitMIData/test/files.cmake rename to Modules/ModelFit/test/files.cmake diff --git a/Modules/FitMIData/test/itkMaskedNaryStatisticsImageFilterTest.cpp b/Modules/ModelFit/test/itkMaskedNaryStatisticsImageFilterTest.cpp similarity index 100% rename from Modules/FitMIData/test/itkMaskedNaryStatisticsImageFilterTest.cpp rename to Modules/ModelFit/test/itkMaskedNaryStatisticsImageFilterTest.cpp diff --git a/Modules/FitMIData/test/itkMaskedStatisticsImageFilterTest.cpp b/Modules/ModelFit/test/itkMaskedStatisticsImageFilterTest.cpp similarity index 100% rename from Modules/FitMIData/test/itkMaskedStatisticsImageFilterTest.cpp rename to Modules/ModelFit/test/itkMaskedStatisticsImageFilterTest.cpp diff --git a/Modules/FitMIData/test/itkMultiOutputNaryFunctorImageFilterTest.cpp b/Modules/ModelFit/test/itkMultiOutputNaryFunctorImageFilterTest.cpp similarity index 100% rename from Modules/FitMIData/test/itkMultiOutputNaryFunctorImageFilterTest.cpp rename to Modules/ModelFit/test/itkMultiOutputNaryFunctorImageFilterTest.cpp diff --git a/Modules/FitMIData/test/mitkConcreteModelFactoryBaseTest.cpp b/Modules/ModelFit/test/mitkConcreteModelFactoryBaseTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkConcreteModelFactoryBaseTest.cpp rename to Modules/ModelFit/test/mitkConcreteModelFactoryBaseTest.cpp diff --git a/Modules/FitMIData/test/mitkFormulaParserTest.cpp b/Modules/ModelFit/test/mitkFormulaParserTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkFormulaParserTest.cpp rename to Modules/ModelFit/test/mitkFormulaParserTest.cpp diff --git a/Modules/FitMIData/test/mitkLevenbergMarquardtModelFitFunctorTest.cpp b/Modules/ModelFit/test/mitkLevenbergMarquardtModelFitFunctorTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkLevenbergMarquardtModelFitFunctorTest.cpp rename to Modules/ModelFit/test/mitkLevenbergMarquardtModelFitFunctorTest.cpp diff --git a/Modules/FitMIData/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp b/Modules/ModelFit/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp rename to Modules/ModelFit/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp diff --git a/Modules/FitMIData/test/mitkMaskedDynamicImageStatisticsGeneratorTest.cpp b/Modules/ModelFit/test/mitkMaskedDynamicImageStatisticsGeneratorTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkMaskedDynamicImageStatisticsGeneratorTest.cpp rename to Modules/ModelFit/test/mitkMaskedDynamicImageStatisticsGeneratorTest.cpp diff --git a/Modules/FitMIData/test/mitkModelFitInfoTest.cpp b/Modules/ModelFit/test/mitkModelFitInfoTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkModelFitInfoTest.cpp rename to Modules/ModelFit/test/mitkModelFitInfoTest.cpp diff --git a/Modules/FitMIData/test/mitkModelFitStaticParameterMapTest.cpp b/Modules/ModelFit/test/mitkModelFitStaticParameterMapTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkModelFitStaticParameterMapTest.cpp rename to Modules/ModelFit/test/mitkModelFitStaticParameterMapTest.cpp diff --git a/Modules/FitMIData/test/mitkModelFitUIDHelperTest.cpp b/Modules/ModelFit/test/mitkModelFitUIDHelperTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkModelFitUIDHelperTest.cpp rename to Modules/ModelFit/test/mitkModelFitUIDHelperTest.cpp diff --git a/Modules/FitMIData/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp b/Modules/ModelFit/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp rename to Modules/ModelFit/test/mitkPixelBasedParameterFitImageGeneratorTest.cpp diff --git a/Modules/FitMIData/test/mitkROIBasedParameterFitImageGeneratorTest.cpp b/Modules/ModelFit/test/mitkROIBasedParameterFitImageGeneratorTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkROIBasedParameterFitImageGeneratorTest.cpp rename to Modules/ModelFit/test/mitkROIBasedParameterFitImageGeneratorTest.cpp diff --git a/Modules/FitMIData/test/mitkSimpleBarrierConstraintCheckerTest.cpp b/Modules/ModelFit/test/mitkSimpleBarrierConstraintCheckerTest.cpp similarity index 100% rename from Modules/FitMIData/test/mitkSimpleBarrierConstraintCheckerTest.cpp rename to Modules/ModelFit/test/mitkSimpleBarrierConstraintCheckerTest.cpp diff --git a/Modules/FitMIDataUI/CMakeLists.txt b/Modules/ModelFitUI/CMakeLists.txt similarity index 53% rename from Modules/FitMIDataUI/CMakeLists.txt rename to Modules/ModelFitUI/CMakeLists.txt index ea89086dd2..9eb1272a99 100644 --- a/Modules/FitMIDataUI/CMakeLists.txt +++ b/Modules/ModelFitUI/CMakeLists.txt @@ -1,6 +1,6 @@ -MITK_CREATE_MODULE(FitMIDataUI +MITK_CREATE_MODULE(ModelFitUI INCLUDE_DIRS Common Qmitk - DEPENDS MitkFitMIData MitkQtWidgets MitkQtWidgetsExt + DEPENDS MitkModelFit MitkQtWidgets MitkQtWidgetsExt PACKAGE_DEPENDS Qt5|Core CTK|CTKWidgets Boost WARNINGS_NO_ERRORS ) diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesDelegate.cpp b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesDelegate.cpp rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h similarity index 94% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesDelegate.h rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h index 009c9d65e4..0016eacecc 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkInitialValuesDelegate_h #define QmitkInitialValuesDelegate_h /// Toolkit includes. #include #include #include -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" /** \class QmitkInitialValuesDelegate \brief An item delegate for rendering and editing the initial value (source) for a parameter. The delegate assumes the following: 1) the data requested with the edit role, will be an double if it is an simple scalar type. If the type is image, it will be a pointer to the currently selected data node. If nothing is selected now it will be a nullptr.*/ -class MITKFITMIDATAUI_EXPORT QmitkInitialValuesDelegate : public QStyledItemDelegate +class MITKMODELFITUI_EXPORT QmitkInitialValuesDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkInitialValuesDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option , const QModelIndex& index) const; void setEditorData(QWidget* editor, const QModelIndex& index) const; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; void setDataStorage(mitk::DataStorage* storage); void setNodePredicate(mitk::NodePredicateBase* predicate); protected: int valueType(const QModelIndex& index) const; /**Storage is used as source for potantial initial value images.*/ mitk::DataStorage::Pointer m_Storage; /**Predicates that is used to filter for potential/allowed images in the data storage*/ mitk::NodePredicateBase::Pointer m_Predicate; }; #endif diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.cpp b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.cpp rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h similarity index 95% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.h rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h index e9a3bd0e96..fc2c2c813d 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_INITIAL_VALUES_MANAGER_WIDGET_H #define QMITK_INITIAL_VALUES_MANAGER_WIDGET_H -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" #include "ui_QmitkInitialValuesManagerWidget.h" #include #include "mitkModelTraitsInterface.h" #include "mitkInitialParameterizationDelegateBase.h" /*forward declarations*/ class QmitkInitialValuesModel; class QmitkInitialValuesTypeDelegate; class QmitkInitialValuesDelegate; namespace mitk { class DataStorage; class BaseGeometry; } /** * \class QmitkInitialValuesManagerWidget * \brief Widget that allows to edit the initial values of an model. */ -class MITKFITMIDATAUI_EXPORT QmitkInitialValuesManagerWidget : public QWidget +class MITKMODELFITUI_EXPORT QmitkInitialValuesManagerWidget : public QWidget { Q_OBJECT public: QmitkInitialValuesManagerWidget(QWidget* parent = 0); ~QmitkInitialValuesManagerWidget(); /** Returns the current set initial values of the model.*/ mitk::ModelTraitsInterface::ParametersType getInitialValues() const; mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const; bool hasValidInitialValues() const; signals: void initialValuesChanged(); public Q_SLOTS: /** Sets the names and the values of the initial parameter set for the model. @param names List 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. @values Default values to start with.*/ void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names, const mitk::ModelTraitsInterface::ParametersType values); void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names); void setDataStorage(mitk::DataStorage* storage); void setReferenceImageGeometry(mitk::BaseGeometry* refgeo); protected: QmitkInitialValuesModel* m_InternalModel; QmitkInitialValuesTypeDelegate* m_TypeDelegate; QmitkInitialValuesDelegate* m_ValuesDelegate; Ui::QmitkInitialValuesManagerWidget m_Controls; protected Q_SLOTS: void OnModelReset(); }; #endif // QmitkInitialValuesManagerWidget_H diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.ui b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.ui similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesManagerWidget.ui rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.ui diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesModel.cpp b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesModel.cpp rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesModel.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h similarity index 97% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesModel.h rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h index b22434b82e..a7f2440c74 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesModel.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkInitialValuesModel_h #define QmitkInitialValuesModel_h #include #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkModelTraitsInterface.h" #include "mitkDataNode.h" #include "mitkInitialParameterizationDelegateBase.h" -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" /*! \class QmitkInitialValuesModel Model that handles the definition of inital model values. */ -class MITKFITMIDATAUI_EXPORT QmitkInitialValuesModel : public QAbstractTableModel +class MITKMODELFITUI_EXPORT QmitkInitialValuesModel : public QAbstractTableModel { Q_OBJECT public: QmitkInitialValuesModel(QObject* parent = NULL); virtual ~QmitkInitialValuesModel() {}; /** Sets the names and the values of the initial parameter set for the model. @param names List 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. @values Default values to start with.*/ void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names, const mitk::ModelTraitsInterface::ParametersType values); /**@overload Convinience method that sets the default initial values always to zero.*/ void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names); /** Adds an image as a source for the initial value of a parameter. * @param node Pointer to the image that is the value source. * @param paramIndex Indicates which parameter is defined by the source image. * It equals the position of the vector defined by setInitialValues(). * @remark setting an image for an index overwrites the value for this index set by * SetInitialParameterization. * @pre paramIndex must be in bound of the initial parametrization vector. * @pre node must be a valid image instance*/ void addInitialParameterImage(const mitk::DataNode* node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex); bool hasValidInitialValues() const; void resetInitialParameterImage(); /** Returns a pointer to a delegate instance that represents the parameterization of the model.*/ mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const; /** Returns the current set initial values of the model. * @Remark: 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.*/ mitk::ModelTraitsInterface::ParametersType getInitialValues() const; virtual Qt::ItemFlags flags(const QModelIndex& index) const; virtual QVariant data(const QModelIndex& index, int role) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); /**Indicates if the content of the model was modified since the data was set via setInitialValues()*/ bool isModified(); private: int valueType(const QModelIndex& index) const; mitk::ModelTraitsInterface::ParametersType m_Values; mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames; typedef std::map ImageMapType; ImageMapType m_ParameterImageMap; /** Indicates if the data of the model was modified, since the model was set. */ bool m_modified; }; #endif // QmitkInitialValuesModel_h diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesTypeDelegate.cpp b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesTypeDelegate.cpp rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesTypeDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h similarity index 90% rename from Modules/FitMIDataUI/Qmitk/QmitkInitialValuesTypeDelegate.h rename to Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h index 548f84f382..29850b7bb8 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkInitialValuesTypeDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkInitialValuesTypeDelegate_h #define QmitkInitialValuesTypeDelegate_h #include -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" /** \class QmitkInitialValuesTypeDelegate \brief An item delegate for rendering and editing the type of a initial value. It assumes that the type is encoded as int. 0: simple scalar, 1: image.*/ -class MITKFITMIDATAUI_EXPORT QmitkInitialValuesTypeDelegate : public QStyledItemDelegate +class MITKMODELFITUI_EXPORT QmitkInitialValuesTypeDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkInitialValuesTypeDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option , const QModelIndex& index) const; void setEditorData(QWidget* editor, const QModelIndex& index) const; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; #endif diff --git a/Modules/FitMIDataUI/Qmitk/QmitkParameterFitBackgroundJob.cpp b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkParameterFitBackgroundJob.cpp rename to Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkParameterFitBackgroundJob.h b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h similarity index 94% rename from Modules/FitMIDataUI/Qmitk/QmitkParameterFitBackgroundJob.h rename to Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h index d07ab9e13e..5a320840e8 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkParameterFitBackgroundJob.h +++ b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h @@ -1,81 +1,81 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Software Development for Integrated Diagnostic and Therapy. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __QMITK_PARAMETER_FIT_BACKGROUND_JOB_H #define __QMITK_PARAMETER_FIT_BACKGROUND_JOB_H //QT #include #include //MITK #include #include #include #include // ITK #include -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" -class MITKFITMIDATAUI_EXPORT ParameterFitBackgroundJob : public QObject, public QRunnable +class MITKMODELFITUI_EXPORT ParameterFitBackgroundJob : public QObject, public QRunnable { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: ParameterFitBackgroundJob(mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitInfo, const std::string& fitName ="", mitk::DataNode* parentNode = NULL); ~ParameterFitBackgroundJob(); void run(); /**Returns the node (if defined), that is the parent object for the results of the job. May be null.*/ mitk::DataNode* GetParentNode() const; signals: void Finished(); void Error(QString err); void ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType resultMap, const ParameterFitBackgroundJob* pJob); void JobProgress(double progress); void JobStatusChanged(QString info); protected: //Inputs mitk::ParameterFitImageGeneratorBase::Pointer m_Generator; mitk::modelFit::ModelFitInfo::ConstPointer m_ModelFitInfo; mitk::DataNode::Pointer m_ParentNode; //job settings std::string m_FitName; // Results mitk::modelFit::ModelFitResultNodeVectorType m_Results; ::itk::MemberCommand::Pointer m_spCommand; unsigned long m_ObserverID; void OnFitEvent(::itk::Object *, const itk::EventObject &event); }; #endif diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.cpp b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.cpp rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h similarity index 95% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.h rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h index 7d93bb4d03..4f079d7a28 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_SIMPLE_BARRIER_MANAGER_WIDGET_H #define QMITK_SIMPLE_BARRIER_MANAGER_WIDGET_H -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" #include "ui_QmitkSimpleBarrierManagerWidget.h" #include #include "mitkSimpleBarrierConstraintChecker.h" /*forward declarations*/ class QmitkSimpleBarrierParametersDelegate; class QmitkSimpleBarrierTypeDelegate; class QmitkSimpleBarrierModel; /** * \class QmitkSimpleBarrierManagerWidget * \brief Widget that allows to edit the constraints of SimpleBarrierConstraintChecker. */ -class MITKFITMIDATAUI_EXPORT QmitkSimpleBarrierManagerWidget : public QWidget +class MITKMODELFITUI_EXPORT QmitkSimpleBarrierManagerWidget : public QWidget { Q_OBJECT public: QmitkSimpleBarrierManagerWidget(QWidget* parent = 0); ~QmitkSimpleBarrierManagerWidget(); signals: void ConstraintChanged(mitk::SimpleBarrierConstraintChecker::Constraint constraint); public Q_SLOTS: /** Sets the data handled by the model and resets the modified flag @param pChecker Pointer to the checker instance that should be managed. @param names List of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model.*/ void setChecker(mitk::SimpleBarrierConstraintChecker* pChecker, const mitk::ModelTraitsInterface::ParameterNamesType& names); protected Q_SLOTS: void OnShowContextMenuIsoSet(const QPoint& pos); void OnAddConstraint(bool checked); void OnDelConstraint(bool checked); protected: /** * \brief Updates the widget according to its current settings. */ void update(); mitk::SimpleBarrierConstraintChecker::Pointer m_Checker; mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames; QmitkSimpleBarrierModel* m_InternalModel; QmitkSimpleBarrierTypeDelegate* m_TypeDelegate; QmitkSimpleBarrierParametersDelegate* m_ParametersDelegate; bool m_InternalUpdate; Ui::QmitkSimpleBarrierManagerWidget m_Controls; }; #endif // QmitkSimpleBarrierManagerWidget_H diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.ui b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.ui similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierManagerWidget.ui rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.ui diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierModel.cpp b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierModel.cpp rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierModel.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h similarity index 95% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierModel.h rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h index 9b5888bf13..8ba77c9dff 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierModel.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSimpleBarrierModel_h #define QmitkSimpleBarrierModel_h #include #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkModelTraitsInterface.h" -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" /*! \class QmitkSimpleBarrierModel Model that handles a SimpleBarrierConstraintChecker and his defined constraints. It allows to couple a SimpleBarrierConstraintChecker with a Qt table view in Order to view and edit its contents. E.g. used in the QmitkSimpleBarrierManagerWidget. */ -class MITKFITMIDATAUI_EXPORT QmitkSimpleBarrierModel : public QAbstractTableModel +class MITKMODELFITUI_EXPORT QmitkSimpleBarrierModel : public QAbstractTableModel { Q_OBJECT public: QmitkSimpleBarrierModel(QObject* parent = NULL); virtual ~QmitkSimpleBarrierModel() {}; /** Sets the data handled by the model and resets the modified flag @param pChecker Pointer to the checker instance that should be managed. @param names List of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model.*/ void setChecker(mitk::SimpleBarrierConstraintChecker* pChecker, const mitk::ModelTraitsInterface::ParameterNamesType& names); virtual Qt::ItemFlags flags(const QModelIndex& index) const; virtual QVariant data(const QModelIndex& index, int role) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); void addConstraint(); void deleteConstraint(const QModelIndex& index); /**Indicates if the content of the model was modified since the data was set via setChecker()*/ bool isModified(); private: mitk::SimpleBarrierConstraintChecker::Pointer m_Checker; mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames; /** Indicates if the data of the model was modified, since the model was set. */ bool m_modified; }; #endif // QmitkSimpleBarrierModel_h diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierParametersDelegate.cpp b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierParametersDelegate.cpp rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h similarity index 92% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h index 298c88c2c3..8489fbd412 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSimpleBarrierParametersDelegate_h #define QmitkSimpleBarrierParametersDelegate_h /// Toolkit includes. #include -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" /** \class QmitkSimpleBarrierParametersDelegate \brief An item delegate for rendering and editing the parameters relevant for a barrier constraint. The delegate assumes the following: 1) if the data is requested with the edit role, it gets a string list of all possible options. 2) if the data is requested with the display role it gets only a list of all currently selected options. If the data is transfered back to the model it contains all selected parameter names in a string list.*/ -class MITKFITMIDATAUI_EXPORT QmitkSimpleBarrierParametersDelegate : public QStyledItemDelegate +class MITKMODELFITUI_EXPORT QmitkSimpleBarrierParametersDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkSimpleBarrierParametersDelegate(QObject* parent = 0); void paint(QPainter* painter, const QStyleOptionViewItem& option , const QModelIndex& index) const; QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option , const QModelIndex& index) const; void setEditorData(QWidget* editor, const QModelIndex& index) const; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; #endif diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierTypeDelegate.cpp b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.cpp similarity index 100% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierTypeDelegate.cpp rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.cpp diff --git a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h similarity index 90% rename from Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h rename to Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h index 3aa6f961c2..8bab74cee0 100644 --- a/Modules/FitMIDataUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSimpleBarrierTypeDelegate_h #define QmitkSimpleBarrierTypeDelegate_h #include -#include "MitkFitMIDataUIExports.h" +#include "MitkModelFitUIExports.h" /** \class QmitkSimpleBarrierTypeDelegate \brief An item delegate for rendering and editing the type of a simple barrier constraint. It assumes that the type is encoded as int. 0: lower border, 1: upper border.*/ -class MITKFITMIDATAUI_EXPORT QmitkSimpleBarrierTypeDelegate : public QStyledItemDelegate +class MITKMODELFITUI_EXPORT QmitkSimpleBarrierTypeDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkSimpleBarrierTypeDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option , const QModelIndex& index) const; void setEditorData(QWidget* editor, const QModelIndex& index) const; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; }; #endif diff --git a/Modules/FitMIDataUI/files.cmake b/Modules/ModelFitUI/files.cmake similarity index 100% rename from Modules/FitMIDataUI/files.cmake rename to Modules/ModelFitUI/files.cmake diff --git a/Modules/ModuleList.cmake b/Modules/ModuleList.cmake index f9c90325b7..9b3f86f668 100644 --- a/Modules/ModuleList.cmake +++ b/Modules/ModuleList.cmake @@ -1,81 +1,81 @@ # The entries in the mitk_modules list must be # ordered according to their dependencies. set(MITK_MODULES Core CommandLine AppUtil RDF LegacyIO DataTypesExt Annotation LegacyGL AlgorithmsExt MapperExt DICOMReader DICOMReaderServices DICOMTesting SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction SceneSerialization Gizmo GraphAlgorithms Multilabel ImageStatistics ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation QtWidgets QtWidgetsExt Chart SegmentationUI MatchPointRegistration MatchPointRegistrationUI Classification GPGPU OpenIGTLink IGTBase IGT CameraCalibration OpenCL OpenCVVideoSupport QtOverlays ToFHardware ToFProcessing ToFUI PhotoacousticsHardware PhotoacousticsAlgorithms PhotoacousticsLib US USUI DicomUI Remeshing Python QtPython Persistence OpenIGTLinkUI IGTUI DicomRT RTUI IOExt XNAT TubeGraph BiophotonicsHardware DiffusionImaging TumorInvasionAnalysis BoundingShape RenderWindowManager RenderWindowManagerUI CEST - FitMIData - FitMIDataUI + ModelFit + ModelFitUI Pharmacokinetics PharmacokineticsUI ) if(MITK_ENABLE_PIC_READER) list(APPEND MITK_MODULES IpPicSupportIO) endif() diff --git a/Modules/Pharmacokinetics/CMakeLists.txt b/Modules/Pharmacokinetics/CMakeLists.txt index ca39765a91..9c725c7550 100644 --- a/Modules/Pharmacokinetics/CMakeLists.txt +++ b/Modules/Pharmacokinetics/CMakeLists.txt @@ -1,19 +1,19 @@ MITK_CREATE_MODULE(Pharmacokinetics INCLUDE_DIRS PUBLIC ${MITK_BINARY_DIR} PRIVATE src/Common src/Functors src/Models src/DescriptionParameters src/SimulationFramework DEPENDS - PUBLIC MitkCore MitkFitMIData + PUBLIC MitkCore MitkModelFit PRIVATE MitkMultilabel PACKAGE_DEPENDS PUBLIC ITK|ITKOptimizers PRIVATE Boost WARNINGS_NO_ERRORS ) if(BUILD_TESTING) ADD_SUBDIRECTORY(test) endif(BUILD_TESTING) ADD_SUBDIRECTORY(autoload/Models) ADD_SUBDIRECTORY(cmdapps) \ No newline at end of file diff --git a/Modules/Pharmacokinetics/cmdapps/CMakeLists.txt b/Modules/Pharmacokinetics/cmdapps/CMakeLists.txt index 8e0922b524..bbb4b7341c 100644 --- a/Modules/Pharmacokinetics/cmdapps/CMakeLists.txt +++ b/Modules/Pharmacokinetics/cmdapps/CMakeLists.txt @@ -1,77 +1,77 @@ option(BUILD_PerfusionMiniApps "Build commandline tools for the perfusion module" OFF) if(BUILD_PerfusionMiniApps) # needed include directories include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) # list of miniapps # if an app requires additional dependencies # they are added after a "^^" and separated by "_" set( miniapps CurveDescriptorMiniApp^^ MRPerfusionMiniApp^^ MRSignal2ConcentrationMiniApp^^ ) foreach(miniapp ${miniapps}) # extract mini app name and dependencies string(REPLACE "^^" "\\;" miniapp_info ${miniapp}) set(miniapp_info_list ${miniapp_info}) list(GET miniapp_info_list 0 appname) list(GET miniapp_info_list 1 raw_dependencies) string(REPLACE "_" "\\;" dependencies "${raw_dependencies}") set(dependencies_list ${dependencies}) mitk_create_executable(${appname} - DEPENDS MitkFitMIData MitkPharmacokinetics MitkCommandLine ${dependencies_list} + DEPENDS MitkModelFit MitkPharmacokinetics MitkCommandLine ${dependencies_list} PACKAGE_DEPENDS ITK CPP_FILES ${appname}.cpp ) if(EXECUTABLE_IS_ENABLED) # On Linux, create a shell script to start a relocatable application if(UNIX AND NOT APPLE) install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh) endif() get_target_property(_is_bundle ${EXECUTABLE_TARGET} MACOSX_BUNDLE) if(APPLE) if(_is_bundle) set(_target_locations ${EXECUTABLE_TARGET}.app) set(${_target_locations}_qt_plugins_install_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_bundle_dest_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_qt_plugins_for_current_bundle ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_qt_conf_install_dirs ${EXECUTABLE_TARGET}.app/Contents/Resources) install(TARGETS ${EXECUTABLE_TARGET} BUNDLE DESTINATION . ) else() if(NOT MACOSX_BUNDLE_NAMES) set(_qt_conf_install_dirs bin) set(_target_locations bin/${EXECUTABLE_TARGET}) set(${_target_locations}_qt_plugins_install_dir bin) install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) else() foreach(bundle_name ${MACOSX_BUNDLE_NAMES}) list(APPEND _qt_conf_install_dirs ${bundle_name}.app/Contents/Resources) set(_current_target_location ${bundle_name}.app/Contents/MacOS/${EXECUTABLE_TARGET}) list(APPEND _target_locations ${_current_target_location}) set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) message( " set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) ") install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION ${bundle_name}.app/Contents/MacOS/) endforeach() endif() endif() else() set(_target_locations bin/${EXECUTABLE_TARGET}${CMAKE_EXECUTABLE_SUFFIX}) set(${_target_locations}_qt_plugins_install_dir bin) set(_qt_conf_install_dirs bin) install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) endif() endif() endforeach() endif() diff --git a/Plugins/org.mitk.gui.qt.fit.demo/CMakeLists.txt b/Plugins/org.mitk.gui.qt.fit.demo/CMakeLists.txt index b57cdf95c4..c4a48e7ffc 100644 --- a/Plugins/org.mitk.gui.qt.fit.demo/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.fit.demo/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_fit_demo) mitk_create_plugin( EXPORT_DIRECTIVE FitGeneratorDemo_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkFitMIData MitkFitMIDataUI + MODULE_DEPENDS MitkQtWidgetsExt MitkModelFit MitkModelFitUI ) diff --git a/Plugins/org.mitk.gui.qt.fit.demo/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.fit.demo/documentation/UserManual/Manual.dox index 9c7221407d..e6ce7d7afa 100644 --- a/Plugins/org.mitk.gui.qt.fit.demo/documentation/UserManual/Manual.dox +++ b/Plugins/org.mitk.gui.qt.fit.demo/documentation/UserManual/Manual.dox @@ -1,9 +1,9 @@ /** \page org_mitk_gui_qt_fit_demo The Fit Demo View \li \ref FDEMO_Introduction \section FDEMO_Introduction Introduction -This is a very simple view that demonstrates how a fit generator can be implemented using the module FitMIData. +This is a very simple view that demonstrates how a fit generator can be implemented using the module ModelFit. In addition the view can be used to generate a demo fit to explore other components like the fit explorer. */ \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.fit.demo/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.fit.demo/documentation/doxygen/modules.dox index 3319562eed..497d73b1ef 100644 --- a/Plugins/org.mitk.gui.qt.fit.demo/documentation/doxygen/modules.dox +++ b/Plugins/org.mitk.gui.qt.fit.demo/documentation/doxygen/modules.dox @@ -1,16 +1,16 @@ /** \defgroup org_mitk_gui_qt_fit_demo org.mitk.gui.qt.fit.demo \ingroup MITKPlugins - \brief Plugin to demonstrate the fitting module FitMIData and a simple fit generator. + \brief Plugin to demonstrate the fitting module ModelFit and a simple fit generator. */ /** \defgroup org_mitk_gui_qt_fit_demo_internal Internal \ingroup org_mitk_gui_qt_fit_demo \brief This subcategory includes the internal classes of the org.mitk.gui.qt.fit.demo plugin. Other plugins must not rely on these classes. They contain implementation details and their interface may change at any time. We mean it. */ diff --git a/Plugins/org.mitk.gui.qt.fit.genericfitting/CMakeLists.txt b/Plugins/org.mitk.gui.qt.fit.genericfitting/CMakeLists.txt index a16a7be187..5727a1f439 100644 --- a/Plugins/org.mitk.gui.qt.fit.genericfitting/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.fit.genericfitting/CMakeLists.txt @@ -1,9 +1,9 @@ project(org_mitk_gui_qt_fit_genericfitting) mitk_create_plugin( EXPORT_DIRECTIVE MRPERFUSION_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkFitMIData MitkFitMIDataUI + MODULE_DEPENDS MitkQtWidgetsExt MitkModelFit MitkModelFitUI PACKAGE_DEPENDS PRIVATE Boost ) diff --git a/Plugins/org.mitk.gui.qt.fit.inspector/CMakeLists.txt b/Plugins/org.mitk.gui.qt.fit.inspector/CMakeLists.txt index 51e2691229..a3af7cd4ef 100644 --- a/Plugins/org.mitk.gui.qt.fit.inspector/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.fit.inspector/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_fit_inspector) mitk_create_plugin( EXPORT_DIRECTIVE MODELFIT_INSPECTOR_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkFitMIData MitkFitMIDataUI + MODULE_DEPENDS MitkQtWidgetsExt MitkModelFit MitkModelFitUI ) diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/CMakeLists.txt b/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/CMakeLists.txt index 25ffc25f99..6ce35d9cd8 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/CMakeLists.txt @@ -1,8 +1,8 @@ project(org_mitk_gui_qt_pharmacokinetics_curvedescriptor) mitk_create_plugin( EXPORT_DIRECTIVE CURVEDESCRIPTORS_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS - PRIVATE MitkQtWidgetsExt MitkPharmacokinetics MitkFitMIDataUI MitkPharmacokineticsUI + PRIVATE MitkQtWidgetsExt MitkPharmacokinetics MitkModelFitUI MitkPharmacokineticsUI ) diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/CMakeLists.txt b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/CMakeLists.txt index dbe09d95dc..b0d7d47b86 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/CMakeLists.txt @@ -1,9 +1,9 @@ project(org_mitk_gui_qt_pharmacokinetics_mri) mitk_create_plugin( EXPORT_DIRECTIVE MRPERFUSION_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkPharmacokinetics MitkFitMIDataUI + MODULE_DEPENDS MitkQtWidgetsExt MitkPharmacokinetics MitkModelFitUI PACKAGE_DEPENDS PRIVATE Boost ) diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/CMakeLists.txt b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/CMakeLists.txt index 7fc3f1427a..713e3fedb7 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_pharmacokinetics_pet) mitk_create_plugin( EXPORT_DIRECTIVE MRPERFUSION_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkFitMIDataUI MitkPharmacokinetics + MODULE_DEPENDS MitkQtWidgetsExt MitkModelFitUI MitkPharmacokinetics )