tiled.client.container.Container.register#
- Container.register(*uris: str | Path, key: str | None = None, structure: Any | None = None, mimetype: str | None = None, parameters: dict[str, Any] | None = None, metadata: dict[str, Any] | None = None, specs: list[Spec] | None = None, access_tags: list[str] | None = None)[source]#
Register externally-managed file(s) as a single dataset in this Container.
This method registers exactly the URIs (or file paths) provided as a single node (array, table, etc.) – it does not walk the subdirectories, if any, and never creates a container of sub-nodes.
Multiple URIs are treated as a single dataset assembled from several files (for example, a stack of TIFF images). A single URI pointing at a directory (for example, a Zarr store) is registered as one dataset backed by that directory.
It is assumed that the URIs are accessible from both the client (to infer the structure) and the server (to serve the data).
- Parameters:
- *urisstr or Path
One or more URIs or file paths. Multiple files are combined into a single dataset (e.g. an image stack).
- keystr, optional
The key (name) for the new node. If not provided, the server assigns a random key (consistent with write_array, write_table, etc.), avoiding collisions with existing nodes.
- structureoptional
Override the structure inferred from the file(s). For example, provide an ArrayStructure with a different shape to have the server reshape the data when it is served. The override is checked for compatibility with the file(s) (matching dtype and element count for arrays; matching column count and dtypes for tables) and a ValueError is raised if it cannot be used.
- mimetypestr, optional
Override the mimetype. By default it is inferred from the file extension.
- parametersdict, optional
Extra keyword arguments for opening the file(s), forwarded to the adapter both when inferring the structure client-side and when the server re-opens the file(s) to serve the data. For example, parameters={“sep”: “;”} for a semicolon-delimited CSV.
- metadatadict, optional
Metadata for the node. Merged on top of any metadata read from the file(s), with these values taking precedence.
- specslist, optional
Specs to assign to the new node.
- access_tagslist, optional
Access tags to apply to the new node.
- Returns:
- The client for the newly-registered node.