A toolbox for annotating objects one by one in nD
Project description
napari-nD-annotator
A toolbox for annotating objects one by one in nD
This plugin contains some tools to make 2D/3D, but basically any dimensional annotation easier. Main features:
- nD bounding box layer
- object list from bounding boxes
- visualizing selected objects from different projections
- auto-filling labels
- label slice interpolation (geometric mean, RSPV representation)
- minimal contour segmentation
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
Installation
You can install napari-nD-annotator
via pip:
pip install napari-nD-annotator
The plugin is also available in napari-hub, to install it directly from napari, please refer to plugin installation instructions at the official napari website.
Usage
You can start napari with the plugin's widgets already opened as:
napari -w napari-nD-annotator "Object List" "Annotation Toolbox"
Bounding boxes
The main idea is to create bounding boxes around objects we want to annotate, crop them, and annotate them one by one. This has mainly two advantages when visualizing in 3D:
- We don't have to load the whole data into memory
- The surrounding objects won't occlude the annotated ones, making it easier to check the annotation.
Bounding boxes can be created from the Object list
widget. The dimensionality of the bounding box layer will be determined from the image layer. As bounding boxes are created, a small thumbnail will be displayed.
The proposed pipeline goes as follows:
- Create a bounding box layer
- Select data parts using the bounding boxes
- Select an object from the object list
- Annotate the object
- Repeat from 3.
Slice interpolation
The Interpolation
tab contains tools for estimating missing annotation slices from existing ones. Two methods are implemented:
- Geometric: the interpolation will be determined by calculating the average of the corresponding contour points.
- RSPV: A more sophisticated average contour calculation, see the preprint here.
Minimal contour
This plugin can estimate a minimal contour, which is calculated from a point set on the edges of the object, which are provided by the user. This contour will follow some image feature (pixels with high gradient or high/low intensity). Features:
- With a single click a new point can be added to the set. This will also extend the contour with the curve shown in red
- A double click will close the curve by adding both the red and gray curves to the minimal contour
- When holding
Shift
, the gray and red highlight will be swapped, so the other curve can be added to the contour - With the
Ctrl
button down a straight line can be added instead of the minimal path - If the anchor points were misplaced, the last point can be removed by right-clicking, or the whole point set can be cleared by pressing
Esc
- The
Param
value at the widget will decide, how strongly should the contour follow edges on the image. Higher value means higher sensitivity to image data, while a lower value will be closer to straight lines. - Different features can be used, like image gradient or pixel intensities, and also user-defined features (using Python)
- the image is accessed as the
image
variable, and the features should be stored in thefeatures
variable in the small code editor widget
- the image is accessed as the
This functionality can be used by selecting the Minimal Contour
tab in the Annotation Toolbox
widget, which will create a new layer called Anchors
.
Important note: Do not remove or modify this layer directly!
Note: if any layer is created before opening the Annotation Toolbox
widget, some "temporary" layers appear in the layer list. This is not intended, but currently there is no way to hide these. Do not remove or modify these, as this could break the plugin! Whenever possible, open the toolbox first, in order to prevent these from appearing.
Intensity-based:
Gradient-based:
Custom feature:
License
Distributed under the terms of the BSD-3 license, "napari-nD-annotator" is free and open source software
Issues
Known issues
- When using the
Annotation Toolbox
:- When deleting a single layer from the layer list, some other layers' names might be overwritten by some "invisible" utility layers. Selecting and unselecting these will restore the original layer.
- When deleting multiple layers, some strange behavior can happen (layer duplicates appear, only in the layer list; napari breaks etc.). Until fixed, layers should be removed one by one.
- If any layer is created before opening the
Annotation Toolbox
widget, some "temporary" layers appear in the layer list. For further information see the Minimal contour section
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for napari-nD-annotator-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9122947149e44745b03fe498244e169007984d75e9fb6f713bb8b78050a5e3 |
|
MD5 | eac6cf6c5cf692df39eace4ce6497cc1 |
|
BLAKE2b-256 | 57684a556d5fe693e73ec67a817426382953b537ded52a85563ccaa12f89fed2 |
Hashes for napari_nD_annotator-0.0.8-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d859010627058ec8c0e21de55a7fb328a4de4d221cf202f05169ce8ef41bbe92 |
|
MD5 | dfe79ea5affd4255efd325604d97b7f2 |
|
BLAKE2b-256 | 6d549ed0ee6e81e7846bbc221cf20707c2abe1ca4576e793f40492f212c16300 |
Hashes for napari_nD_annotator-0.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dea7ee4ebba1f8c35cb675fd5620a86e2e6988a6bcf84d1bdece41c0101a7dff |
|
MD5 | 87811d56529f985eb3a9568f37c9e29f |
|
BLAKE2b-256 | 401139ded7899e4d61572ba45da6b60ff8ea0e1aba50725f9d2421fbc191acab |
Hashes for napari_nD_annotator-0.0.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51fee1107d49fc68ef2926d5a733d8b0ecba5f6e249b0f51bbf389191951ab0d |
|
MD5 | 9f1dc52ff0812d5a1378df4b6eac0729 |
|
BLAKE2b-256 | 341a72cfb5364e44b1cad3812eb3b6660bad7e16b21818df4f32d173559ef180 |
Hashes for napari_nD_annotator-0.0.8-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346e38557a4b132ac7a08e51ff63791ea606abe26cf2c0fa7a71571af55e4d87 |
|
MD5 | 8e28fc77f18b6d70de094dc14f1b44cf |
|
BLAKE2b-256 | 202bf7a566a3d6a1281c82dd97b0f3d267dd30dc95d4b689b20a533626128224 |
Hashes for napari_nD_annotator-0.0.8-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26bf3a7bae76cb6c8a983c86772b1fe5cf9e0866961ccbb766005641f0a05ab0 |
|
MD5 | a926fe6b9d337e665140ca4d0c52cd00 |
|
BLAKE2b-256 | 0c975348456bf609f6ba18889285c5a8e8a1eb4ea879bc8a569fbed827002a60 |
Hashes for napari_nD_annotator-0.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5278685aecf0654001a093eec4e51a99db27c6c573e40bae8b82bbfc5e9aa26e |
|
MD5 | 601f6a9572d1f537c9b6dc9a8666a9a2 |
|
BLAKE2b-256 | dfb7ec13d22888397221ca90a06de33afde368bfb4f4f8b49cc755bdf6cc4730 |
Hashes for napari_nD_annotator-0.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 855764305a91e9c13d73090dee4045bb3804a1dd041642c98f8c178f79b2d543 |
|
MD5 | 2072b758ece4fec72638b88582cbec28 |
|
BLAKE2b-256 | dacfc51ca9b66abfb7348a9444b84742a3dc90d5aa0e5f74ddd439141bad3847 |
Hashes for napari_nD_annotator-0.0.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e51aba69ff714441c9cda4f8d906e29a7e851afda02d30d285ac6de21a0df30 |
|
MD5 | b13755f66afc7a9ed3603124d7cedda7 |
|
BLAKE2b-256 | 0a12187a8bc181ab39f9f7b5c07e2bfeb8d32e1ad643e3f7eb188364a0761aa0 |
Hashes for napari_nD_annotator-0.0.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04812eb0845a176ec36d963d02e7fe53dccdbebd0b12b8232680131cb051c3c9 |
|
MD5 | 4b122134809ee570b0c98586295019c1 |
|
BLAKE2b-256 | 22316b31ec6e8befd1ccbc97b9ac0bd188d9eb4bbfaee15856077548c0b77e07 |
Hashes for napari_nD_annotator-0.0.8-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce661dde9848d68430254f2311b12243b25db5c0727711f7d478f8c6a9112312 |
|
MD5 | 7c30204890e8256f75c28df0a85cab41 |
|
BLAKE2b-256 | 53061a5288f3d8874c290842fcfbeaa4000973b1543c35fdebe9eab71a73adf5 |
Hashes for napari_nD_annotator-0.0.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6294657f304192ed8c758ef7f1ef7d82e3032addaa30093f25d39c579f87120b |
|
MD5 | e757f508871ae0dd28284abecf1ebeb6 |
|
BLAKE2b-256 | ec81dfbfcc701402a2a585901ff24241e3bf4728f19ac9bad92420678c40b34b |
Hashes for napari_nD_annotator-0.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5492d75c95a1ca4b8abd3474737c2e79d2c0a822f53c37deb9366e01d618e2 |
|
MD5 | 1c0977720aabc36f0e43816e36117981 |
|
BLAKE2b-256 | 2f733eef247d21331702cdbf98deac99e48404951a45155059628fb9de398f2f |
Hashes for napari_nD_annotator-0.0.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4140090569b81e4b89058f889e4f714913077798af17e6fc769e5941712cd68 |
|
MD5 | 585db246da50611dbccae67df56a0b82 |
|
BLAKE2b-256 | 3b88ebb1a2050ee4cee1c56bccb60d95e7a4a63cdd2d89c2f09cad6a01f7a822 |