Medical Imaging Interaction Toolkit  2022.04.99-e36380da
Medical Imaging Interaction Toolkit
mitkLabelSetIOHelper.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef __mitkLabelSetIOHelper_h
14 #define __mitkLabelSetIOHelper_h
15 
16 #include <MitkMultilabelExports.h>
17 #include <itkSmartPointer.h>
18 
19 namespace tinyxml2
20 {
21  class XMLDocument;
22  class XMLElement;
23 }
24 
25 namespace mitk
26 {
27  class BaseProperty;
28  class LabelSetImage;
29  class Label;
30 
38  {
39  public:
47  static bool SaveLabelSetImagePreset(const std::string &presetFilename,
48  const mitk::LabelSetImage *inputImage);
49 
56  static bool LoadLabelSetImagePreset(const std::string &presetFilename,
57  mitk::LabelSetImage *inputImage);
58 
64  static itk::SmartPointer<mitk::Label> LoadLabelFromXMLDocument(const tinyxml2::XMLElement *labelElem);
65 
72  static tinyxml2::XMLElement *GetLabelAsXMLElement(tinyxml2::XMLDocument &doc, Label *label);
73 
82  static tinyxml2::XMLElement *PropertyToXMLElement(tinyxml2::XMLDocument& doc, const std::string &key, const BaseProperty *property);
83 
91  static bool PropertyFromXMLElement(std::string &key, itk::SmartPointer<mitk::BaseProperty> &prop, const tinyxml2::XMLElement *elem);
92 
93  private:
95  };
96 }
97 
98 #endif // __mitkLabelSetIOHelper_h
MITKMULTILABEL_EXPORT
#define MITKMULTILABEL_EXPORT
Definition: MitkMultilabelExports.h:15
mitk::BaseProperty
Abstract base class for properties.
Definition: mitkBaseProperty.h:35
itk::SmartPointer
Definition: mitkIFileReader.h:30
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::Label
A data structure describing a label.
Definition: mitkLabel.h:28
mitk::LabelSetIOHelper
The LabelSetIOHelper is a static helper class that supports serialization of mitk::LabelSetImage.
Definition: mitkLabelSetIOHelper.h:37
tinyxml2
Definition: mitkXMLSerializable.h:20
mitk::LabelSetImage
LabelSetImage class for handling labels and layers in a segmentation session.
Definition: mitkLabelSetImage.h:29
MitkMultilabelExports.h