Skip to main content

A napari plugin to keep images and annotations as a re-loadable project

Project description

napari-annotation-project

License PyPI Python Version tests codecov napari hub

This napari plugin allows to define projects consisting of multiple images that can be annotated with labels and rectangular regions of interest (rois). Those rois can then be exported as series of cropped images and labels, typically to train Machine Learning models. Projects can be easily reopened in order to browse through images and their annotations. This package is a meant to be a light-weight plugin which does not introduce any specific dependencies and that should be easily installable in any environment already containing napari and other plugins.

Usage

To start a project, you can just drag and drop files in the file list area. This prompts for the selection of a project folder. After that, more files (also from different folders) can be dragged and dropped to be included in the project. Files can optionally be copied to the project folder but this option has to be set before adding files. When selecting a file in the list, it is opened (using the default image reader or a reader plugin if installed) and two layers, one for rois, and one for annotations are added.

https://user-images.githubusercontent.com/4622767/147265874-57dcd956-4d54-4c76-9129-c1fc2837e6a4.mp4

Adding rois

After selecting the rois layer, you can add rectangular rois to the image. If you need square rois of a specific size (as often needed in DL training) you can select the Fixed roi size option and then use the Add roi button. Note that currently only 2D rois are supported. If you work with nD images, the roi is therefore added to the current selected 2D plane.

Adding annotations

After selecting the annotations layer, you can add annotations to your image. There are no restrictions here and you can e.g. add as many labels as you need.

Info storage

All relevant information on project location, project files and rois is stored in a yaml file Parameters.yml. Annotations are stored as 2D tiff files in the annotations as files named after the original files. Note that at the moment if multiple files have the same name, this will cause trouble. This parameter file is used when re-loading an existing project.

https://user-images.githubusercontent.com/4622767/147265984-adb6ee1f-9319-45c9-a9a4-735ade2a3905.mp4

Exporting rois

Once you are satisfied with your annotations and rois, you can use the rois to export only the corresponing cropped rois of both the image and annotation layers. For this you can head to the Export tab. Here you can set the location of the export folder, set the names of the folders that will contain cropped images and cropped annotations, and finally set the prefix names for these two types of files. Files are exported as tif files.

https://user-images.githubusercontent.com/4622767/147266002-9c4485c9-5bcc-4c64-9c92-6c06775e2711.mp4

Installation

You can install napari-annotation-project via pip (note yet functional):

pip install napari-annotation-project

To install latest development version :

pip install git+https://github.com/guiwitz/napari-annotation-project.git

Contributing

Contributions are very welcome. Tests can be run with tox.

License

Distributed under the terms of the BSD-3 license, "napari-annotation-project" is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari-annotation-project-0.1.1.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file napari-annotation-project-0.1.1.tar.gz.

File metadata

File hashes

Hashes for napari-annotation-project-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b8e1a91293d35dd8f4df02461c45a7283f54249ba97244e44b5dc1bb0c78ee10
MD5 1e513cbcb5812272374f33c860257dda
BLAKE2b-256 cd693e3d2a62a2a5bb86b912f4b9dcc9dd34230d37c8be1bea0c582e4b9c3dcc

See more details on using hashes here.

File details

Details for the file napari_annotation_project-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_annotation_project-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6da29818131539a65a51cef88d01e2daba5d2e8b10def4c78132ad4aee83d1b9
MD5 40d1f2c024c7355b8b6f1db6dcfbfbdc
BLAKE2b-256 49afcd2c9b7021d2c7e231137b5dd9e49318adb5b5289f093498c8d0b531ed7d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page