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.
> pip install pipra
And then you can execute it by just writing
> pipra
- 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).
- Open a video or a folder with images (currently, PiPrA is looking for PNGs only)
- 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.
- 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) or the GrabCut mode to estimate the foreground in a drawn rectangle.
- Remove area with right mouse click with given brush size
- Use the mouse wheel to zoom in/out
- Adjust contrast/brightness by adjusting the levels on the right hand side. These settings are kept for the entire video.
- To move the scene, keep the
Shiftkey pressed. - For flood fill mode, keep
Ctrlpressed, and click on the desired seed pixel.
Specifically, PiPrA offers four different annotation modalities:
a) brush b) outline c) flood fill d) GrabCut
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.
You can also export masks to a more common format, such as TIF files or MP4 (Ctrl+E).
These shortcuts make your life much easier:
Xto remove the maskCtrl+Left Clickflood fill, seeded with the clicked pxShift+Left Click+Mouse moveMove sceneCtrl+Zgo back in historyCtrl+Ssave mask/segmentationCcopy mask from previous frameQtoggle mask on/offW,A,S,Dto change frame forward (W, D)/backward (A, S)Mchange brush from circle to blockOchange brush to outline mode: Draw outline around ROI, then the inside will be filledPchange brush to grabcut mode: Draw rectangle around ROI, GrabCut estimates the foreground2make brush smaller (as small as 1 px)8make brush bigger
Space pressed+Left Click+Mouse moveMove scene (similar to photoshop)Ctrl+Mouse wheelchange frame forward (wheel up) and backward (wheel down)Ctrl+EExport segmentation as TIF or MP4Ctrl+OOpen file
We have not published PiPrA yet.
To acknowledge PiPrA, please use currently 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

