Annotations
In Cornerstone3DTools
, Annotation Tools keep their state in a state
object. This object is a plain JavaScript object that is
used to store the state of the annotation instance. Information such as the statistics of the annotation, its data
and camera position are stored in this object.
There are various methods for adding/removing, selection, locking and unlocking of annotations. They can be accessed via the annotations
name space in the Cornerstone3DTools
by calling:
import { annotation } from '@cornerstonejs/tools';
// All methods to deal with annotation state can be accessed via
annotation.state.XYZ;
// All methods for annotation selection can be accessed via
annotation.selection.XYZ;
// All methods for annotation locking can be accessed via
annotation.locking.XYZ;
// All methods for annotation styling can be accessed via
annotation.config.XYZ;
// The AnnotationGroup class allows for grouping of annotations
annotation.AnnotationGroup;
Let's start by looking deeper into each of these methods.
📄️ State
Cornerstone3DTools implements a FrameOfReference annotations state manager, where annotations use world coordinates for points.
📄️ Annotation Manager
The Annotation Manager is a singleton class that manages annotations in Cornerstone Tools.
📄️ Selection
Annotations can be selected and deselected. This is achieved by holding down the Shift key (by default) and clicking on annotations.
📄️ Locking
Annotations can be locked to avoid accidental changes. You can use
📄️ Config
In this section we will explain various ways you can change the tool styles. This
📄️ Annotation Groups
In order to indicate that annotations are related to each other, there is