Skip to main content

An annotation tool to allow binary px-based labels.

Project description

PiPrA (Pixel Precise Annotator)

PiPrA Logo

PiPrA allows to label data in a binary fashing (fore-and background) pixel-precisely, using painting or flood filling. It opens tiff stacks and videos (as supported by imageio mimread), and can operate on single frames.

To try out the PiPrA tool, simple close the Open File dialog, to get some dummy data.

Dependencies

  • PyQt5 (in Anaconda)
  • ImageIO (in Anaconda)
  • Scikit-image (in Anaconda)
  • flammkuchen (pip install flammkuchen)
  • PyQtGraph (pip install pyqtgraph)

Works with the latest libraries much better (PyQt5==5.15.4, pyqtgraph==0.12.1, python==3.7.10).

How it works

  1. Open a video or a folder with images (currently, PiPrA is looking for PNGs only)
  2. The brush is by default magenta, the foreground green, you can change these colors in the settings, and you are able to save and restore old settings.
  3. Draw with left mouse click, you can paint a larger surface by keeping the left mouse button pressed. Alternatively: you may use the outline mode for large areas (see shortcuts below)
  4. Remove area with right mouse click with given brush size
  5. Use the mouse wheel to zoom in/out
  6. Adjust contrast/brightness by adjusting the levels on the right hand side. These settings are kept for the entire video.
  7. To move the scene, keep the Shift key pressed.
  8. For flood fill mode, keep Ctrl pressed, and click on the desired seed pixel.

Saving

Everything is stored as HDF5 file, the dimensions are (z/time, x, y), dtype is boolean. Use flammkuchen or PyTables to read the file. Also, when annotating a folder, it contains a list of the filenames in the same order as the masks.

Shortcuts

These shortcuts make your life much easier:

  • X to remove the mask
  • Ctrl+Left Click flood fill, seeded with the clicked px
  • Shift+Left Click+Mouse move Move scene
  • Ctrl+Z go back in history
  • Ctrl+S save mask/segmentation
  • C copy mask from previous frame
  • Q toggle mask on/off
  • W, A, S, D to change frame forward (W, D)/backward (A, S)
  • M change brush from circle to block
  • O change brush to outline mode: Draw outline around ROI, then the inside will be filled
  • 2 make brush smaller (as small as 1 px)
  • 8 make brush bigger

New shortcuts

  • Space pressed+Left Click+Mouse move Move scene (similar to photoshop)
  • Ctrl+Mouse wheel change frame forward (wheel up) and backward (wheel down)

How to cite PiPrA

We published PiPrA here, please use the following citation:

Gómez, P., Kist, A.M., Schlegel, P. et al. BAGLS, a multihospital Benchmark for Automatic Glottis Segmentation. Sci Data 7, 186 (2020). https://doi.org/10.1038/s41597-020-0526-3

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

pipra-0.2.1.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

pipra-0.2.1-py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 3

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