Sethealth is not only a medical data visualization tool. In fact, Sethealth API makes it very easy and safe to share medical data, allowing its users to upload it to the cloud.
In this section you can see how to do it.
First of all, in order to upload data and use the cloud services, it's required an access token. This access token allows the SDK to upload and download data in a safe and controlled way.
Once you generate a token, it must be passed to the SDK using the
Notice that access tokens are short-lived, meaning it expires few hours after its creation, so they must be generated on-demand in your own backend.
Uploading data with
This method can be called from the
workspace API and it uploads data only when strictly necesary. This method returns
SerializableWorkspace as under the hood calls to
This method can be called from
geometry too, thus avoiding creating a
Under the hood, calling this method form
Geometry have a source yet, the method will skip.
Serializing a Workspace with
workspace.serialize() returns a
SerializableWorkspace given a
SerializableWorkspace is a
JSON-safe serializable object created in order to share a workspace or store it for persistence.
medSource is not required in order serialize a
Workspace. If it is not used, the
MedHandler contained by the
Workspace must have a
MedSource (it can be achive with the
ensureSources() method). Althought, if you want to serialize
Workspace without a
MedSource is possible too, specifying a null value in
opts.medSource that will overwrite the actual
MedHandler value. For further information check out the docs.
workspace.ensureSources() will return a
SerializableWorkspace, but it is not uploaded yet. As mentioned,
SerializableWorkspace is a JSON-safe serializable object so it could be uploaded to sethealth with the
uploadMetadata() method of the
secret is a string that contains an URL to share all the files attached.
After uploading data, let's see how to download it. With the secret generated before, we will be able to download the
that represents a
SerializableWorkspace now it is possible to create again the same
workspace as before as it contains all the
sources needed to download MedHandler and Geometries attached. To see how check out to the next fragment
Now let's see how to use a
SerializableWorkspace to create the
MedHandler should be created as will be used to create the workspace. Then the
Workspace can be restored by using
MedHandler and the previously serialized
SerializableWorkspace. For further information check out the docs.