|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Provides functionality to load and save MITK scene files (.mitk). More...
#include <mitkSceneIO.h>


Public Types | |
| typedef DataStorage::SetOfObjects | FailedBaseDataListType |
| Type for a list of DataNodes whose BaseData failed to serialize/deserialize. More... | |
Public Member Functions | |
| mitkClassMacroItkParent (SceneIO, itk::Object) | |
| Pointer | Clone () const |
| virtual DataStorage::Pointer | LoadScene (const std::string &filename, DataStorage *storage=nullptr, bool clearStorageFirst=false) |
| Loads a scene from an MITK scene file. More... | |
| virtual DataStorage::Pointer | LoadSceneUnzipped (const std::string &indexfilename, DataStorage *storage=nullptr, bool clearStorageFirst=false) |
| Loads a scene from an already-unpacked directory. More... | |
| virtual bool | SaveScene (DataStorage::SetOfObjects::ConstPointer sceneNodes, const DataStorage *storage, const std::string &filename) |
| Saves a scene of DataNodes to a .mitk scene file (ZIP archive). More... | |
| const FailedBaseDataListType * | GetFailedNodes () |
| Returns DataNodes whose BaseData failed to be written during the most recent SaveScene() call. More... | |
| const PropertyList * | GetFailedProperties () |
| Returns properties that failed to be written during the most recent SaveScene() call. More... | |
Static Public Member Functions | |
| static Pointer | New () |
Protected Member Functions | |
| SceneIO () | |
| ~SceneIO () override | |
| std::string | CreateEmptyTempDirectory () |
| tinyxml2::XMLElement * | SaveBaseData (tinyxml2::XMLDocument &doc, BaseData *data, const std::string &filenamehint, bool &error) |
| tinyxml2::XMLElement * | SavePropertyList (tinyxml2::XMLDocument &doc, const IPropertyTransience *transience, PropertyList *propertyList, const BaseData *nodeData, const std::string &filenamehint) |
| void | OnUnzipError (const void *pSender, std::pair< const Poco::Zip::ZipLocalFileHeader, const std::string > &info) |
| void | OnUnzipOk (const void *pSender, std::pair< const Poco::Zip::ZipLocalFileHeader, const Poco::Path > &info) |
Protected Attributes | |
| FailedBaseDataListType::Pointer | m_FailedNodes |
| PropertyList::Pointer | m_FailedProperties |
| std::string | m_WorkingDirectory |
| unsigned int | m_UnzipErrors |
Provides functionality to load and save MITK scene files (.mitk).
SceneIO handles the complete scene serialization pipeline:
Scene files (.mitk) are ZIP archives containing:
After loading or saving, failed nodes and properties can be queried to determine what could not be processed.
Definition at line 56 of file mitkSceneIO.h.
Type for a list of DataNodes whose BaseData failed to serialize/deserialize.
Definition at line 64 of file mitkSceneIO.h.
|
protected |
|
overrideprotected |
| Pointer mitk::SceneIO::Clone | ( | ) | const |
|
protected |
| const FailedBaseDataListType* mitk::SceneIO::GetFailedNodes | ( | ) |
Returns DataNodes whose BaseData failed to be written during the most recent SaveScene() call.
| const PropertyList* mitk::SceneIO::GetFailedProperties | ( | ) |
Returns properties that failed to be written during the most recent SaveScene() call.
The properties may originate from:
|
virtual |
Loads a scene from an MITK scene file.
Accepts either a .mitk ZIP archive (unpacked to a temporary directory, then dispatched via index.json if present, else index.xml) or a standalone .mitkscene.json file.
| [in] | filename | Full path to the scene file. |
| [in] | storage | If non-null, this DataStorage is populated instead of creating a new StandaloneDataStorage. |
| [in] | clearStorageFirst | If true, the provided DataStorage is cleared before loading new objects into it. For the JSON path, clearing is deferred until after the scene descriptor has been validated so that a malformed file does not wipe the caller's session. |
|
virtual |
Loads a scene from an already-unpacked directory.
Similar to LoadScene(), but operates on an unpacked scene directory rather than a ZIP archive. Assumes the given file is the index.xml of the scene and uses its parent directory as the working directory.
| [in] | indexfilename | Full path to the scene's index.xml file. |
| [in] | storage | If non-null, this DataStorage is populated instead of creating a new StandaloneDataStorage. |
| [in] | clearStorageFirst | If true, the provided DataStorage is cleared before loading new objects into it. |
| mitk::SceneIO::mitkClassMacroItkParent | ( | SceneIO | , |
| itk::Object | |||
| ) |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
Saves a scene of DataNodes to a .mitk scene file (ZIP archive).
Serializes the given set of DataNodes (including their data, properties, and parent/child relationships from the DataStorage) into a temporary directory, creates an index.xml, and packages everything into a ZIP archive at the specified filename.
| [in] | sceneNodes | The set of DataNodes to save. |
| [in] | storage | The DataStorage containing the nodes and their relationships. |
| [in] | filename | Full path for the output .mitk scene file. |
sceneNodes must not be null. storage must not be null. filename must not be empty.
|
protected |
Definition at line 189 of file mitkSceneIO.h.
|
protected |
Definition at line 190 of file mitkSceneIO.h.
|
protected |
Definition at line 193 of file mitkSceneIO.h.
|
protected |
Definition at line 192 of file mitkSceneIO.h.