Segmentations
In Cornerstone3DTools
, we have decoupled the concept of a Segmentation
from
a Segmentation Representation
. This means that from one Segmentation
we can
create multiple Segmentation Representation
s. For instance, a Segmentation Representation
of a 3D Labelmap, can be created from a Segmentation
data, and a Segmentation Representation
of a Contour (not supported yet) can be created from the same Segmentation
data. This
way we have decouple the presentational aspect of a Segmentation
from the underlying data.
Similar relationship structure has been adapted in popular medical imaging softwares such as 3D Slicer with the addition of polymorph segmentation.
API
Segmentation
related functions and classes are available in the segmentation
module.
import { segmentation } from '@cornerstonejs/tools';
// segmentation state holding all segmentations and their toolGroup specific representations
segmentations.state.XYZ;
// active segmentation methods (set/get)
segmentations.activeSegmentation.XYZ;
// locking for a segment index (set/get)
segmentations.locking.XYZ;
// segment index manipulations (set/get)
segmentations.segmentIndex.XYZ;
Let's start by looking deeper into each of these methods.
📄️ State
SegmentationState stores all the information regarding the current state of Segmentations and SegmentationRepresentations in the library. In version 2.x, we've decoupled Segmentations from their representations and made the system viewport-specific rather than toolGroup-specific. From a Segmentation, various representations can be created (currently supporting Labelmap, Contour, and Surface).
📄️ Active Segmentation
Each viewport can display multiple segmentation representations simultaneously, but only one segmentation can be active per viewport. The active segmentation is the one that will be modified by segmentation tools.
📄️ Segment Locking
You can lock specific segments in a segmentation to prevent them from being modified by any tools.
📄️ Config
In version 2.x, segmentation configurations are managed through a unified style system that can be applied at different levels of specificity using a specifier object.
📄️ Segment Index
When drawing with segmentation tools, you can specify which segment index to use. Below, we have used the SegmentIndex API to change the segmentIndex to draw the second segment.
📄️ Segmentation Tools
Cornerstone3DTools provides a set of tools to modify segmentations. These include
📄️ Contour Representation
A Contour Segmentation Representation is a collection of Contour Sets. Each Contour Set is a collection of Contours. Each Contour is a collection of Points. Each Point is a collection of 3D coordinates.