diff --git a/Modules/Pharmacokinetics/include/mitkParamapPresets.h b/Modules/Pharmacokinetics/include/mitkParamapPresets.h index 01c21e107b..cb7b114a6f 100644 --- a/Modules/Pharmacokinetics/include/mitkParamapPresets.h +++ b/Modules/Pharmacokinetics/include/mitkParamapPresets.h @@ -1,74 +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 PARAMAPRPRESETS_H_HEADER #define PARAMAPPRESETS_H_HEADER #include #include #include #include #include namespace mitk { class MITKPHARMACOKINETICS_EXPORT ParamapPresets : public vtkXMLParser { public: struct Type { std::string codeValue; std::string codeScheme; Type() = default; Type(std::string value, std::string scheme) : codeValue(value), codeScheme(scheme){} }; static ParamapPresets *New(); vtkTypeMacro(ParamapPresets,vtkXMLParser); bool LoadPreset(); bool LoadPreset(const std::string& fileName); Type GetType(const std::string& name); std::map const GetTypePresets(); void NewPresets(std::map& newType); protected: ParamapPresets() = default; ~ParamapPresets() override = default; private: //##Documentation //## @brief method used in XLM-Reading; gets called when a start-tag is read void StartElement (const char *elementName, const char **atts) override; - void Save(); //##Documentation //## @brief reads an XML-String-Attribute std::string ReadXMLStringAttribute(const std::string& name, const char **atts); static const std::string PRESET; static const std::string TYPE; static const std::string CODE_VALUE; static const std::string CODE_SCHEME; std::string m_presetName; std::map m_Type; std::string m_XmlFileName; }; } #endif diff --git a/Modules/Pharmacokinetics/src/Common/mitkParamapPresets.cpp b/Modules/Pharmacokinetics/src/Common/mitkParamapPresets.cpp index ef10be3c89..ce0cc294df 100644 --- a/Modules/Pharmacokinetics/src/Common/mitkParamapPresets.cpp +++ b/Modules/Pharmacokinetics/src/Common/mitkParamapPresets.cpp @@ -1,132 +1,129 @@ /*=================================================================== 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 "mitkParamapPresets.h" #include #include "usGetModuleContext.h" #include "usModuleContext.h" #include "usModule.h" #include "usModuleResource.h" #include "usModuleResourceStream.h" namespace mitk { const std::string ParamapPresets::PRESET = "preset"; const std::string ParamapPresets::TYPE = "type"; const std::string ParamapPresets::CODE_VALUE = "code_value"; const std::string ParamapPresets::CODE_SCHEME = "coding_scheme"; vtkStandardNewMacro(ParamapPresets); bool ParamapPresets::LoadPreset() { us::ModuleResource presetResource = us::GetModuleContext()->GetModule()->GetResource("mitkParamapPresets.xml"); if (!presetResource) return false; us::ModuleResourceStream presetStream(presetResource); vtkXMLParser::SetStream(&presetStream); if (!vtkXMLParser::Parse()) { #ifdef INTERDEBUG MITK_INFO<<"ParamapPresets::LoadPreset xml file cannot parse!"< const ParamapPresets::GetTypePresets() { return m_Type; } - void ParamapPresets::Save() - { - //Not yet implemented - } + void ParamapPresets::NewPresets(std::map& newType) { m_Type = newType; this->Save(); } }