The MultiLabelIOHelper is a static helper class that supports serialization of mitk::LabelSetImage.
More...
#include <mitkMultiLabelIOHelper.h>
The MultiLabelIOHelper is a static helper class that supports serialization of mitk::LabelSetImage.
This class provides static functions for converting mitk::Label into XML and also allows the serialization of mitk::LabelSet as presets
Definition at line 50 of file mitkMultiLabelIOHelper.h.
◆ LabelGroupMetaData
◆ DeserializeLabelFromJSON()
◆ DeserializeMultiLabelGroupsFromJSON()
◆ GetIntByKey()
static int mitk::MultiLabelIOHelper::GetIntByKey |
( |
const itk::MetaDataDictionary & |
dic, |
|
|
const std::string & |
key |
|
) |
| |
|
static |
Helper that extracts the value of a key in a meta dictionary as int. If the key does not exist 0 is returned.
◆ GetLabelAsXMLElement()
static tinyxml2::XMLElement* mitk::MultiLabelIOHelper::GetLabelAsXMLElement |
( |
tinyxml2::XMLDocument & |
doc, |
|
|
const Label * |
label |
|
) |
| |
|
static |
Creates an XML element from a mitk::Label.
- Parameters
-
doc | |
label | the mitk::Label from which the xml element will be created |
- Returns
- the created XML element
◆ GetStringByKey()
static std::string mitk::MultiLabelIOHelper::GetStringByKey |
( |
const itk::MetaDataDictionary & |
dic, |
|
|
const std::string & |
key |
|
) |
| |
|
static |
Helper that extracts the value of a key in a meta dictionary as string. If the key does not exist an empty string is returned.
◆ LoadLabelFromXMLDocument()
◆ LoadLabelSetImagePreset()
static bool mitk::MultiLabelIOHelper::LoadLabelSetImagePreset |
( |
const std::string & |
presetFilename, |
|
|
mitk::LabelSetImage * |
inputImage |
|
) |
| |
|
static |
Loads an existing preset for a mitk::LabelSetImage from presetFilename and applies it to inputImage.
- Parameters
-
presetFilename | the filename of the preset including the filesystem path |
inputImage | the image to which the loaded preset will be applied |
- Returns
- true if the deserilization was successful and false otherwise
◆ PropertyFromXMLElement()
Since a mitk::Label is basically a mitk::PropertyList this function converts an XML element into a property.
- Parameters
-
key | the property's key |
prop | the mitk::BaseProperty that will be created |
elem | the XML elem from which the property will be created |
- Returns
- true if the conversion was successful and false otherwise
◆ PropertyToXMLElement()
static tinyxml2::XMLElement* mitk::MultiLabelIOHelper::PropertyToXMLElement |
( |
tinyxml2::XMLDocument & |
doc, |
|
|
const std::string & |
key, |
|
|
const BaseProperty * |
property |
|
) |
| |
|
static |
Since a mitk::Label is basically a mitk::PropertyList this function converts the label's properties into XML.
- Parameters
-
doc | |
key | the property's key which will be used in the XML element |
property | the mitk::BaseProperty that should be converted |
- Returns
- the created XML element
◆ SaveLabelSetImagePreset()
static bool mitk::MultiLabelIOHelper::SaveLabelSetImagePreset |
( |
const std::string & |
presetFilename, |
|
|
const mitk::LabelSetImage * |
inputImage |
|
) |
| |
|
static |
Saves the mitk::LabelSet configuration of inputImage to presetFilename. The preset is stored as "*.lsetp".
- Parameters
-
presetFilename | the filename including the filesystem path |
inputImage | the input image from which the preset should be generated |
- Returns
- true if the serialization was successful and false otherwise
◆ SerializeLabelToJSON()
◆ SerializeMultLabelGroupsToJSON()
The documentation for this class was generated from the following file: