Skip to main content

Workspace Module

import * as sethealth from '@sethealth/core';

API reference#

workspace.create( med?: MedHandler, opts: WorkspaceOptions )

Creates a brand new workspace given the specified VolumeHandler, optionally, it can apply different initial values of the workspace by pasing a SerializableWorkspace as second argument.


Destroys all previously created workspaces.

workspace.ensureSources( workspaces: undefined, opts: EnsureSourcesWorkspaceOptions, onProgress: undefined )

Given an array of workspaces and a couple of other options specified in `EnsureWorkspaceSourcesOptions`, this method ensure all the passed workspace have sources for their volumes and geometries.

Uploading data only when strictly necesary. Under the hood, this method uses `volume.ensureSources()` and `geometry.ensureSources()`.

workspace.get( id: string )

Returns the workspace handler given its `ID`.

workspace.loadFromSerialization( workspaces: undefined, onProgress: undefined )