webknossos.annotation.annotation
Annotations can contain annotated data in two forms:
- skeleton data, as provided by the
Skeleton
class, and - volume annotation layers (or volume layers short),
which can be exported as a
SegmentationLayer
, seeexport_volume_layer_to_dataset()
andtemporary_volume_layer_copy()
.
Usually, annotations should be created manually in the WEBKNOSSOS interface and can be downloaded using
Annotation.download()
. The downloaded instance is not persisted to disk automatically, please use save()
for this purpose. The general purpose file format is .zip
files containing an .nml
file with
meta-information and the skeleton data and also containing inner .zip
files for the volume layers.
For skeleton-only annotations without volume layers .nml
files can be used directly. Both formats
are compatible with the WEBKNOSSOS up- and downloads.
To prepare volume annotations in the code for correction of segmentation data in the WEBKNOSSOS interface,
please use add_volume_layer()
with the fallback_layer
argument, referencing a segmentation layer that
is available on WEBKNOSSOS (e.g. using the Dataset
upload before).
Correcting segmentations using fallback layers is much more efficient, adding volume
annotation data programmatically is discouraged therefore.
Method generated by attrs for class SegmentInformation.
To initialize a local annotation, please provide the name
argument, and either
the skeleton
argument, or a dataset_name
and voxel_size
.
When supplying skeleton
passing dataset_name
, voxel_size
, organization_id
or
description
is not allowed as the attributes of the skeleton are used in this case.
Deprecated, use owner_name
instead.
This attribute is a proxy for skeleton.dataset_name
.
This attribute is a proxy for skeleton.voxel_size
.
Deprecated, please use voxel_size
.
This attribute is a proxy for skeleton.organization_id
.
This attribute is a proxy for skeleton.description
.
Loads a .nml
file or a .zip
file containing an NML and possibly also volume
layers. Returns the Annotation
object.
annotation_id_or_url
may be an annotation id or a full URL to an annotation, e.g.https://webknossos.org/annotations/6114d9410100009f0096c640
annotation_type
is no longer required and therefore deprecated and ignoredwebknossos_url
may be supplied if an annotation id was used and allows to specifiy in which webknossos instance to search for the annotation. It defaults to the url from your currentwebknossos_context
, using https://webknossos.org as a fallback.skip_volume_data
can be set toTrue
to omit downloading annotated volume data. They can still be streamed from WEBKNOSSOS usingannotation.get_remote_annotation_dataset()
._return_context
should not be set.
Stores the annotation as a zip or nml at the given path.
Uploads the annotation to your current webknossos_context
.
Returns a streamed dataset of the annotation as shown in webknossos, incorporating fallback layers and potentially mappings. A mapping is currently only incorporated if it is a pinned agglomerate mapping. After an agglomerate mapping was activated in WEBKNOSSOS, it is pinned as soon as the first volume editing action is done. Note that this behavior might change in the future.
Adds a volume layer to the annotation, without manual annotations but possibly referring to
segmentation data using the fallback_layer
.
To prepare volume annotations in the code for correction of segmentation data in the WEBKNOSSOS interface,
please use the fallback_layer
argument, referencing a segmentation layer that is available on WEBKNOSSOS
(e.g. using the Dataset
upload before).
Correcting segmentations using fallback layers is much more efficient, adding volume annotation data
programmatically is discouraged therefore.
Given a dataset, this method will export the specified volume annotation of this annotation into that dataset by creating a new layer. The largest_segment_id is computed automatically, unless provided explicitly.
volume_layer_name
or volume_layer_id
has to be provided,
if the annotation contains multiple volume layers.
Use get_volume_layer_names()
to look up available layers.
Given a volume annotation path, create a temporary dataset which
contains the volume annotation. Returns the corresponding Layer
.
volume_layer_name
or volume_layer_id
has to be provided,
if the annotation contains multiple volume layers.
Returns a dict mapping from segment ids to SegmentInformation
.
The dict is mutable, changes to the returned instance are saved in the local annotation.
Changes in a downloaded annotation that are done online in webknossos are not
reflected automatically, the annotation needs to be re-downloaded.
Annotations can be of different types which has to be specified when using Annotation.download()
with an annotation id.
Explorational annotations are all annotations created without the task system, e.g. by uploading an annotation or using the "Create Annotation" Button in the dataset view in webknossos.
The Task type is automatically assigned to all annotations that are instances of a task.
See also Task
.
Inherited Members
- enum.Enum
- name
- value
This Enum contains the state of annotations belonging to tasks.
Can be retrieved via Task
instances, getting AnnotationInfo
from task.get_annotation_infos()
.
Inherited Members
- enum.Enum
- name
- value
Deprecated.