Paint labels on arbitrary planes
Summary
Painting labels is useful for annotating voxels by semantic meaning or instance. Painting labels on planes in 3D is useful to gain full context. Additionally, the axis aligned slicing may not be optimal for viewing your structure of interest. Here we describe how to paint labels on arbitrary planes in 3D.
Instructions
-
To run this example, first download the script from the Examples Gallery page; the link is at the bottom of the web page. Save the file to a memorable location. Or, if you've cloned this repository, the script can be found at
napari-threedee/docs/examples/plugin/label_annotator_plugin.py
. -
Ensure you have activated a virtual environment with napari-threedee installed. Change directories to the script location and then execute the script using:
python label_annotator_plugin.py
-
The viewer is initialized in 3D rendering mode in plane rendering mode. We are viewing a 3D volume with one plane being actively rendered. The "label annotator" widget will be visible and a
Labels
layer will be present in the viewer. Note that depending on your versions ofnapari-threedee
andnapari
you may see subtle visual differences between your viewer and the screenshots/videos here. -
Activate the plugin. Select the
plane
layer for the "image layer" andLabels
for the "labels layer" and click the "activate" button. -
With the
plane
image layer selected, you can translate the rendering plane along its normal vector holding the shift key while clicking with the left mouse button and dragging the plane. Alternately, you can re-position the render plane using the render plane manipulator. -
Paint on the rendered plane. First, select the
Labels
layer in the layer list. Then click the brush icon to "Activate the paint brush" in the layer controls. Finally paint on the rendered plane by clicking with the left mouse button on the plane and dragging the mouse. You can hold the space-bar to togglepan
mode to allow you to change the viewing angle. You can select theplane
image layer and reposition the rendering plane, then re-select theLabels
layer to resume painting.