How to use the roipoly.roipoly function in roipoly

To help you get started, we’ve selected a few roipoly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jdoepfert / roipoly.py / examples / old_example.py View on Github external
"""Test if the old example still works
(commit 80737fa9d66d839e52b40d7cadcf02e143a86b4a)"""
import pylab as pl
from roipoly import roipoly

# create image
img = pl.ones((100, 100)) * range(0, 100)

# show the image
pl.imshow(img, interpolation='nearest', cmap="Greys")
pl.colorbar()
pl.title("left click: line segment         right click: close region")

# let user draw first ROI
ROI1 = roipoly(roicolor='r')  # let user draw first ROI

# show the image with the first ROI
pl.imshow(img, interpolation='nearest', cmap="Greys")
pl.colorbar()
ROI1.displayROI()
pl.title('draw second ROI')

# let user draw second ROI
ROI2 = roipoly(roicolor='b')  # let user draw ROI

# show the image with both ROIs and their mean values
pl.imshow(img, interpolation='nearest', cmap="Greys")
pl.colorbar()
[x.displayROI() for x in [ROI1, ROI2]]
[x.displayMean(img) for x in [ROI1, ROI2]]
pl.title('The two ROIs')
github jdoepfert / roipoly.py / examples / old_example.py View on Github external
# show the image
pl.imshow(img, interpolation='nearest', cmap="Greys")
pl.colorbar()
pl.title("left click: line segment         right click: close region")

# let user draw first ROI
ROI1 = roipoly(roicolor='r')  # let user draw first ROI

# show the image with the first ROI
pl.imshow(img, interpolation='nearest', cmap="Greys")
pl.colorbar()
ROI1.displayROI()
pl.title('draw second ROI')

# let user draw second ROI
ROI2 = roipoly(roicolor='b')  # let user draw ROI

# show the image with both ROIs and their mean values
pl.imshow(img, interpolation='nearest', cmap="Greys")
pl.colorbar()
[x.displayROI() for x in [ROI1, ROI2]]
[x.displayMean(img) for x in [ROI1, ROI2]]
pl.title('The two ROIs')
pl.show()

# show ROI masks
pl.imshow(ROI1.getMask(img) + ROI2.getMask(img),
          interpolation='nearest', cmap="Greys")
pl.title('ROI masks of the two ROIs')
pl.show()

roipoly

Tool to draw regions of interest (ROIs)

Apache-2.0
Latest version published 4 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages