DataStorage
DataStorage wrapper — Pythonic access to the MITK DataStorage.
- class mitk_workbench_remote.storage.DataStorage(transport)
Bases:
objectCRUD interface for DataNode objects.
Obtained from a
Workbenchinstance viaworkbench.storage. Do not construct directly.- Parameters:
transport (
RestTransport) – The REST transport used for all HTTP calls.
- list(*, data_type=None, toplevel=False)
Return all nodes, optionally filtered.
- filter(*, data_type=None, toplevel=False, parent_uid=None, properties=None, scope=PropertyScope.ALL, context=None)
Return nodes matching the given filters.
- Parameters:
data_type (
str|None(default:None)) – If given, only return nodes whose MITK data type matches this string (e.g."Image").toplevel (
bool(default:False)) – IfTrue, only return root-level nodes (no parent).parent_uid (
str|None(default:None)) – If given, only return direct children of this node.properties (
dict[str,Any] |None(default:None)) – If given, only return nodes whose properties match all entries. Values are serialized with the same rules asset_property(): simple types pass through,coloris wrapped as aColorPropertywire dict. Wildcard characters*and?are supported for string values.scope (
PropertyScope(default:<PropertyScope.ALL: 'all'>)) – Property scope for the property filters ("all","node", or"data"). Only used whenpropertiesis given.context (
str|None(default:None)) – Renderer context for the property filters. Only used whenpropertiesis given.
- Return type:
- Returns:
List of
DataNodeobjects.
- get(uid)
Fetch a single node by UID.
- Parameters:
uid (
str) – Node identifier.- Return type:
- Returns:
The matching
DataNode.- Raises:
NodeNotFoundError – If no node with this UID exists.
- create(name, *, parent=None)
Create a new empty node in the DataStorage.