A ROI marker using matplotlib
Project description
Roimarker
A simple region of interest (ROI) creator using matplotlib to annotate images with rectangular ROI.
Warning: Roimarker is still quite plain and unfinished.
Installing
pip install roimarker
Usage
Both (1) and (2) (below) launch the same interface, iterating over the given images.
1) Standalone
python -m roimarker DIRECTORY
where DIRECTORY contains all the image files to annotate. This saves markings.json file when finished (see below).
2) As part of your program
import matplotlib.pyplot as plt
from roimarker import Marker
# Create matplotlib figure and ax
fig, ax = plt.subplots()
# List of images to annotate
image_fns = ['image1.tif', 'image2.tif', 'image3.tif']
marker = Marker(fig, ax, image_fns, 'markings.json')
marker.run()
This opens a window where the user can draw a number of rectangle ROIs on the images. Pressing n advances to the next image, and z, x, c and v can be used to adjust brightness/contrast. After going through all the images or when manually pressing w, a markings.json file in the current directory, containin the ROIs in the following format
{fn1: [ROI_1, ROI_2, ROI_3, ..], fn2: [ROI_1, ...], ...}
where
ROI_i = [x,y,w,h]
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
Built Distribution
Hashes for roimarker-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a1612d8a4a378c90c668b83530fd9db141950c9089ffacde4b7a4a86cf6ceef |
|
MD5 | d03ed29ff6fad07108171f0b2f14f670 |
|
BLAKE2b-256 | e1f3fb0d636d33131f0c49b3ae2b60c71b8e5167cef1f54b2a3746cbca569cc8 |