roifile

Read and write ImageJ ROI format.

Roifile is a Python library to read, write, create, and plot ImageJ ROIs, an undocumented and ImageJ application specific format to store regions of interest, geometric shapes, paths, text, and whatnot for image overlays.

Author:

Christoph Gohlke

License:

BSD-3-Clause

Version:

2026.2.10

DOI:

10.5281/zenodo.6941603

Quickstart

Install the roifile package and all dependencies from the Python Package Index:

python -m pip install -U "roifile[all]"

View overlays stored in a ROI, ZIP, or TIFF file:

python -m roifile file.roi

See Examples for using the programming interface.

Source code, examples, and support are available on GitHub.

Requirements

This revision was tested with the following requirements and dependencies (other versions may work):

Revisions

2026.2.10

  • Revise wrapping of integer coordinates again (breaking).

  • Bump file version to 229.

  • Support groups > 255 (untested).

  • Support IMAGE subtype (requires imagecodecs).

  • Add point_type and point_size properties for point ROIs.

  • Do not return empty paths in path2coords.

  • Improve documentation.

2026.1.29

  • Fix code review issues.

2026.1.22

  • Fix boolean codec in ImagejRoi.properties.

2026.1.20

  • Fix reading ImagejRoi.props.

  • Add ImagejRoi.properties property to decode and encode ImagejRoi.props.

2026.1.8

  • Improve code quality.

  • Drop support for Python 3.10.

2025.12.12

  • Move tests to separate module.

2025.5.10

  • Support Python 3.14.

2025.2.20

Refer to the CHANGES file for older revisions.

Notes

The ImageJ ROI format cannot store integer coordinate values outside the range of -5000..60536.

Refer to the ImageJ RoiDecoder.java source code for a reference implementation.

Other Python packages handling ImageJ ROIs:

Examples

Create a new ImagejRoi instance from an array of x, y coordinates, then set ROI properties:

>>> roi = ImagejRoi.frompoints([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]])
>>> roi.roitype = ROI_TYPE.POINT
>>> roi.point_size = ROI_POINT_SIZE.LARGE
>>> roi.options |= ROI_OPTIONS.SHOW_LABELS

Export the instance to an ImageJ ROI formatted byte string or file:

>>> out = roi.tobytes()
>>> out[:4]
b'Iout'
>>> roi.tofile('_test.roi')

Read the ImageJ ROI from the file and verify the content:

>>> roi2 = ImagejRoi.fromfile('_test.roi')
>>> roi2 == roi
True
>>> roi.roitype == ROI_TYPE.POINT
True
>>> roi.subpixelresolution
True
>>> roi.coordinates()
array([[1.1, 2.2],
       [3.3, 4.4],
       [5.5, 6.6]], dtype=float32)
>>> roi.left, roi.top, roi.right, roi.bottom
(1, 2, 7, 8)
>>> roi2.name = 'test'

Plot the ROI using matplotlib:

>>> roi.plot()

Write the ROIs to a ZIP file:

>>> roiwrite('_test.zip', [roi, roi2], mode='w')

Read the ROIs from the ZIP file:

>>> rois = roiread('_test.zip')
>>> assert len(rois) == 2 and rois[0] == roi and rois[1].name == 'test'

Write the ROIs to an ImageJ formatted TIFF file:

>>> import numpy
>>> import tifffile
>>> tifffile.imwrite(
...     '_test.tif',
...     numpy.zeros((9, 9), 'u1'),
...     imagej=True,
...     metadata={'Overlays': [roi.tobytes(), roi2.tobytes()]},
... )

Read the ROIs embedded in an ImageJ formatted TIFF file:

>>> rois = roiread('_test.tif')
>>> assert len(rois) == 2 and rois[0] == roi and rois[1].name == 'test'

View the overlays stored in a ROI, ZIP, or TIFF file from a command line:

python -m roifile _test.roi

For an advanced example, see roifile_demo.py in the source distribution.

License

Copyright (c) 2020-2026, Christoph Gohlke
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

roifile module

roifile.__version__ = '2026.2.10'

Roifile version string.

class roifile.ImagejRoi(byteorder='>', roitype=ROI_TYPE.POLYGON, subtype=ROI_SUBTYPE.UNDEFINED, options=<ROI_OPTIONS.NONE: 0>, name='', props='', version=229, top=0, left=0, bottom=0, right=0, n_coordinates=0, stroke_width=0, shape_roi_size=0, stroke_color=b'\x00\x00\x00\x00', fill_color=b'\x00\x00\x00\x00', arrow_style_or_aspect_ratio=0, arrow_head_size=0, rounded_rect_arc_size=0, position=0, c_position=0, z_position=0, t_position=0, x1=0.0, y1=0.0, x2=0.0, y2=0.0, xd=0.0, yd=0.0, widthd=0.0, heightd=0.0, overlay_label_color=b'\x00\x00\x00\x00', overlay_font_size=0, group=0, image_opacity=0, image_size=0, image_data=None, float_stroke_width=0.0, text_size=0, text_style=0, text_justification=0, text_angle=0.0, text_name='', text='', counters=None, counter_positions=None, integer_coordinates=None, subpixel_coordinates=None, multi_coordinates=None)

Bases: object

Read and write ImageJ ROI format.

Parameters:
  • byteorder (Literal['>', '<'])

  • roitype (ROI_TYPE)

  • subtype (ROI_SUBTYPE)

  • options (ROI_OPTIONS)

  • name (str)

  • props (str)

  • version (int)

  • top (int)

  • left (int)

  • bottom (int)

  • right (int)

  • n_coordinates (int)

  • stroke_width (int)

  • shape_roi_size (int)

  • stroke_color (bytes)

  • fill_color (bytes)

  • arrow_style_or_aspect_ratio (int)

  • arrow_head_size (int)

  • rounded_rect_arc_size (int)

  • position (int)

  • c_position (int)

  • z_position (int)

  • t_position (int)

  • x1 (float)

  • y1 (float)

  • x2 (float)

  • y2 (float)

  • xd (float)

  • yd (float)

  • widthd (float)

  • heightd (float)

  • overlay_label_color (bytes)

  • overlay_font_size (int)

  • group (int)

  • image_opacity (int)

  • image_size (int)

  • image_data (bytes | None)

  • float_stroke_width (float)

  • text_size (int)

  • text_style (int)

  • text_justification (int)

  • text_angle (float)

  • text_name (str)

  • text (str)

  • counters (NDArray[numpy.uint8] | None)

  • counter_positions (NDArray[numpy.uint32] | None)

  • integer_coordinates (NDArray[numpy.int32] | None)

  • subpixel_coordinates (NDArray[numpy.float32] | None)

  • multi_coordinates (NDArray[numpy.float32] | None)

byteorder: Literal['>', '<'] = '>'

‘>’ for big-endian, ‘<’ for little-endian.

Type:

Byte order

roitype: ROI_TYPE = 0

ROI type (polygon, rect, oval, line, point, etc).

subtype: ROI_SUBTYPE = 0

Subtype for specialized ROIs (text, arrow, ellipse, image, etc).

options: ROI_OPTIONS = 0

Bit flags for ROI options and features.

name: str = ''

ROI name.

props: str = ''

value pairs.

Type:

Properties string containing key

version: int = 229

File format version number.

top: int = 0

Bounding rectangle top coordinate.

left: int = 0

Bounding rectangle left coordinate.

bottom: int = 0

Bounding rectangle bottom coordinate.

right: int = 0

Bounding rectangle right coordinate.

n_coordinates: int = 0

Number of coordinate pairs.

stroke_width: int = 0

Stroke width in pixels (also point_size for POINT ROIs version 226+).

shape_roi_size: int = 0

Composite shape data size in floats.

__init__(byteorder='>', roitype=ROI_TYPE.POLYGON, subtype=ROI_SUBTYPE.UNDEFINED, options=<ROI_OPTIONS.NONE: 0>, name='', props='', version=229, top=0, left=0, bottom=0, right=0, n_coordinates=0, stroke_width=0, shape_roi_size=0, stroke_color=b'\x00\x00\x00\x00', fill_color=b'\x00\x00\x00\x00', arrow_style_or_aspect_ratio=0, arrow_head_size=0, rounded_rect_arc_size=0, position=0, c_position=0, z_position=0, t_position=0, x1=0.0, y1=0.0, x2=0.0, y2=0.0, xd=0.0, yd=0.0, widthd=0.0, heightd=0.0, overlay_label_color=b'\x00\x00\x00\x00', overlay_font_size=0, group=0, image_opacity=0, image_size=0, image_data=None, float_stroke_width=0.0, text_size=0, text_style=0, text_justification=0, text_angle=0.0, text_name='', text='', counters=None, counter_positions=None, integer_coordinates=None, subpixel_coordinates=None, multi_coordinates=None)
Parameters:
  • byteorder (Literal['>', '<'])

  • roitype (ROI_TYPE)

  • subtype (ROI_SUBTYPE)

  • options (ROI_OPTIONS)

  • name (str)

  • props (str)

  • version (int)

  • top (int)

  • left (int)

  • bottom (int)

  • right (int)

  • n_coordinates (int)

  • stroke_width (int)

  • shape_roi_size (int)

  • stroke_color (bytes)

  • fill_color (bytes)

  • arrow_style_or_aspect_ratio (int)

  • arrow_head_size (int)

  • rounded_rect_arc_size (int)

  • position (int)

  • c_position (int)

  • z_position (int)

  • t_position (int)

  • x1 (float)

  • y1 (float)

  • x2 (float)

  • y2 (float)

  • xd (float)

  • yd (float)

  • widthd (float)

  • heightd (float)

  • overlay_label_color (bytes)

  • overlay_font_size (int)

  • group (int)

  • image_opacity (int)

  • image_size (int)

  • image_data (bytes | None)

  • float_stroke_width (float)

  • text_size (int)

  • text_style (int)

  • text_justification (int)

  • text_angle (float)

  • text_name (str)

  • text (str)

  • counters (NDArray[numpy.uint8] | None)

  • counter_positions (NDArray[numpy.uint32] | None)

  • integer_coordinates (NDArray[numpy.int32] | None)

  • subpixel_coordinates (NDArray[numpy.float32] | None)

  • multi_coordinates (NDArray[numpy.float32] | None)

Return type:

None

__weakref__

list of weak references to the object

stroke_color: bytes = b'\x00\x00\x00\x00'

Stroke/outline color as ARGB bytes.

fill_color: bytes = b'\x00\x00\x00\x00'

Fill color as ARGB bytes.

arrow_style_or_aspect_ratio: int = 0

Arrow style, aspect ratio for ellipse, or point_type for POINT ROIs.

arrow_head_size: int = 0

Arrow head size in pixels.

rounded_rect_arc_size: int = 0

Arc size for rounded rectangle corners.

position: int = 0

Position in stack (1-based, 0 means not set).

c_position: int = 0

Channel position (1-based, 0 means not set).

z_position: int = 0

Z-slice position (1-based, 0 means not set).

t_position: int = 0

Time frame position (1-based, 0 means not set).

x1: float = 0.0

First X coordinate for line ROIs or X for subpixel rectangles.

y1: float = 0.0

First Y coordinate for line ROIs or Y for subpixel rectangles.

x2: float = 0.0

Second X coordinate for line ROIs.

y2: float = 0.0

Second Y coordinate for line ROIs.

xd: float = 0.0

X coordinate for subpixel rectangles (double precision).

yd: float = 0.0

Y coordinate for subpixel rectangles (double precision).

widthd: float = 0.0

Width for subpixel rectangles (double precision).

heightd: float = 0.0

Height for subpixel rectangles (double precision).

overlay_label_color: bytes = b'\x00\x00\x00\x00'

Overlay label color as ARGB bytes.

overlay_font_size: int = 0

Overlay label font size in points.

group: int = 0

Group number for grouping related ROIs.

image_opacity: int = 0

Opacity for image ROIs (0-255).

image_size: int = 0

Embedded image data size in bytes.

image_data: bytes | None = None

Embedded image data for IMAGE subtype ROIs.

float_stroke_width: float = 0.0

Floating point stroke width for precise rendering.

text_size: int = 0

Text ROI font size in points.

text_style: int = 0

Text ROI font style flags (bold, italic, etc).

text_justification: int = 0

Text ROI alignment (left, center, right).

text_angle: float = 0.0

Text ROI rotation angle in degrees.

text_name: str = ''

Text ROI font name.

text: str = ''

Text ROI content.

counters: NDArray[numpy.uint8] | None = None

Counter values for each coordinate point.

counter_positions: NDArray[numpy.uint32] | None = None

Counter positions for each coordinate point.

integer_coordinates: NDArray[numpy.int32] | None = None

Integer coordinate pairs relative to bounding box.

subpixel_coordinates: NDArray[numpy.float32] | None = None

Floating point coordinate pairs for subpixel precision.

multi_coordinates: NDArray[numpy.float32] | None = None

Path data for composite shapes (MOVETO, LINETO, CLOSE operations).

classmethod frompoints(points=None, /, *, name=None, position=None, index=None, c=None, z=None, t=None)

Return ImagejRoi instance from sequence of Point coordinates.

Use floating point coordinates for subpixel precision or values outside the range -5000..60535.

A FREEHAND ROI with options OVERLAY_BACKGROUNDS and OVERLAY_LABELS is returned.

Parameters:
  • points (TypeAliasForwardRef('numpy.ArrayLike') | None) – Array-like of shape (n, 2) containing x, y coordinates.

  • name (str | None) – ROI name. Auto-generated if None.

  • position (int | None) – Stack position (0-based). Stored as 1-based.

  • index (int | str | None) – Index for auto-generated name.

  • c (int | None) – Channel position (0-based). Stored as 1-based.

  • z (int | None) – Z-slice position (0-based). Stored as 1-based.

  • t (int | None) – Time frame position (0-based). Stored as 1-based.

Returns:

New ImagejRoi instance created from points.

Return type:

Self

classmethod fromfile(filename, /, *, min_int_coord=None, maxsize=268435456)

Return ImagejRoi instance from ROI, ZIP, or TIFF file.

For ZIP or TIFF files, return a list of ImagejRoi.

Parameters:
  • filename (os.PathLike[Any] | str) – Path to .roi, .zip, or .tif file.

  • min_int_coord (int | None) – Minimum integer coordinate for unwrapping.

  • maxsize (int) – Maximum bytes to read per entry.

Returns:

Single ImagejRoi for .roi files, list of ImagejRoi for .zip/.tif.

Return type:

ImagejRoi | list[ImagejRoi]

classmethod frombytes(data, /, *, min_int_coord=None)

Return ImagejRoi instance from bytes.

Parameters:
  • data (bytes) – Bytes in ImageJ ROI format.

  • min_int_coord (int | None) – Minimum integer coordinate for unwrapping.

Returns:

ImagejRoi instance decoded from bytes.

Return type:

ImagejRoi

tofile(filename, /, *, name=None, mode=None)

Write ImagejRoi to ROI or ZIP file.

Existing ZIP files are opened for append.

Parameters:
  • filename (os.PathLike[Any] | str) – Path to output .roi or .zip file.

  • name (str | None) – ROI name for ZIP file entry.

  • mode (Literal['w', 'x', 'a'] | None) – File mode {‘w’, ‘x’, or ‘a’}.

Return type:

None

tobytes()

Return ImagejRoi as bytes.

Returns:

Bytes in ImageJ ROI format.

Return type:

bytes

plot(ax=None, *, rois=None, title=None, bounds=False, invert_yaxis=None, show=True, **kwargs)

Plot draft of coordinates using matplotlib.

Parameters:
  • ax (Axes | None) – Matplotlib axes to plot on. Create new figure if None.

  • rois (Iterable[ImagejRoi] | None) – Multiple ROIs to plot together.

  • title (str | None) – Figure title.

  • bounds (bool) – Show bounding rectangle.

  • invert_yaxis (bool | None) – Invert Y axis. Auto-determined if None.

  • show (bool) – Call pyplot.show().

  • **kwargs (Any) – Additional arguments passed to matplotlib plot functions.

Return type:

None

coordinates(*, multi=False)

Return x, y coordinates as numpy array for display.

Parameters:

multi (bool) – Return list of coordinate arrays for composite shapes.

Returns:

Array of shape (n, 2) with x, y coordinates, or list of such arrays if multi=True.

Return type:

NDArray[Any] | list[NDArray[Any]]

hexcolor(b, /, default=None)

Return color (bytes) as hex triplet or default if black.

Parameters:
  • b (bytes) – Color as 4 ARGB bytes.

  • default (str | None) – Value to return if color is black/none.

Returns:

Hex color string like ‘#rrggbb’, or default if black.

Return type:

str | None

static path2coords(multi_coordinates, /)

Return list of coordinate arrays from 2D geometric path.

Parameters:

multi_coordinates (NDArray[numpy.float32]) – Path data with MOVETO, LINETO, CLOSE operations.

Returns:

List of coordinate arrays, one per path segment.

Return type:

list[NDArray[numpy.float32]]

static min_int_coord(value=None, /)

Return minimum integer coordinate value.

The default, -5000, is used by ImageJ. A value of -32768 means to use int16 range, 0 means uint16 range.

Parameters:

value (int | None) – Minimum coordinate value (-32768 to 0), or None for default.

Returns:

Minimum integer coordinate value (-5000 default).

Return type:

int

property composite: bool

ROI is composite shape.

property subpixelresolution: bool

ROI has subpixel resolution.

property drawoffset: bool

ROI has draw offset.

property subpixelrect: bool

ROI has subpixel rectangle.

property autoname: str

Name generated from positions.

property point_type: ROI_POINT_TYPE

Point type for POINT ROIs (version 226+).

Maps to arrow_style_or_aspect_ratio field. Only meaningful for ROI_TYPE.POINT.

property point_size: ROI_POINT_SIZE

Point size for POINT ROIs (version 226+).

Maps to stroke_width field. Only meaningful for ROI_TYPE.POINT.

property image: NDArray[Any] | None

Decoded image as numpy array for IMAGE subtype ROIs.

Image is None if no image data is stored in file or decoding failed.

property properties: dict[str, Any]

Decoded props field as dictionary.

property utf16: str

UTF-16 codec depending on byteorder.

__hash__()

Return hash of ImagejRoi.

Return type:

int

__eq__(other)

Return True if two ImagejRoi are the same.

Parameters:

other (object)

Return type:

bool

__repr__()

Return repr(self).

Return type:

str

roifile.logger()

Return logger for roifile module.

Returns:

Logger instance for ‘roifile’ module.

Return type:

Logger

roifile.roiread(filename, /, *, min_int_coord=None, maxsize=268435456)

Return ImagejRoi instance(s) from ROI, ZIP, or TIFF file.

For ZIP or TIFF files, return a list of ImagejRoi.

Parameters:
  • filename (os.PathLike[Any] | str) – Path to ROI, ZIP, or TIFF file.

  • min_int_coord (int | None) – Minimum integer coordinate value for unwrapping. Default is -5000 (ImageJ standard).

  • maxsize (int) – Maximum file size to read in bytes.

Returns:

Single ImagejRoi instance for .roi files, or list of ImagejRoi instances for .zip and .tif files.

Return type:

ImagejRoi | list[ImagejRoi]

roifile.roiwrite(filename, roi, /, *, name=None, mode=None)

Write ImagejRoi instance(s) to ROI or ZIP file.

Write an ImagejRoi instance to a ROI file or write a sequence of ImagejRoi instances to a ZIP file. Existing ZIP files are opened for append.

Parameters:
  • filename (os.PathLike[Any] | str) – Path to output .roi or .zip file.

  • roi (ImagejRoi | Iterable[ImagejRoi]) – Single ImagejRoi instance or iterable of instances.

  • name (str | Iterable[str] | None) – Optional name(s) for ROI(s) in ZIP file.

  • mode (Literal['w', 'x', 'a'] | None) – File mode (‘w’ for write, ‘x’ for exclusive, ‘a’ for append). Defaults to ‘a’ for existing files, ‘w’ for new files.

Return type:

None

roifile.ROI_COLOR_NONE = b'\x00\x00\x00\x00'

bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object

Construct an immutable array of bytes from:
  • an iterable yielding integers in range(256)

  • a text string encoded using the specified encoding

  • any object implementing the buffer API.

  • an integer

class roifile.ROI_OPTIONS(*values)

Bases: IntFlag

ImageJ ROI options.

NONE = 0

No options.

SPLINE_FIT = 1

Spline fit enabled.

DOUBLE_HEADED = 2

Double-headed arrow.

OUTLINE = 4

Outline only (no fill).

OVERLAY_LABELS = 8

Show overlay labels.

OVERLAY_NAMES = 16

Show overlay names.

OVERLAY_BACKGROUNDS = 32

Show overlay backgrounds.

OVERLAY_BOLD = 64

Bold overlay text.

SUB_PIXEL_RESOLUTION = 128

Subpixel resolution coordinates.

DRAW_OFFSET = 256

Draw with offset.

ZERO_TRANSPARENT = 512

Zero values transparent.

SHOW_LABELS = 1024

Show point labels.

SCALE_LABELS = 2048

Scale labels with zoom.

PROMPT_BEFORE_DELETING = 4096

Prompt before deletion.

SCALE_STROKE_WIDTH = 8192

Scale stroke width with zoom.

UNKNOWN_14 = 16384

Undocumented or unknown option (bit 14).

UNKNOWN_15 = 32768

Undocumented or unknown option (bit 15).

__format__(format_spec, /)

Convert to a string according to format_spec.

__or__(other)

Return self|value.

__and__(other)

Return self&value.

__xor__(other)

Return self^value.

__ror__(other)

Return value|self.

__rand__(other)

Return value&self.

__rxor__(other)

Return value^self.

__invert__()

~self

__new__(value)
class roifile.ROI_POINT_SIZE(*values)

Bases: IntEnum

ImageJ ROI point sizes.

UNKNOWN = -1

Undocumented or unknown point size.

TINY = 1

Tiny marker (1px).

SMALL = 3

Small marker (3px).

MEDIUM = 5

Medium marker (5px).

LARGE = 7

Large marker (7px).

EXTRA_LARGE = 11

Extra large marker (11px).

XXL = 17

XXL marker (17px).

XXXL = 25

XXXL marker (25px).

__format__(format_spec, /)

Convert to a string according to format_spec.

__new__(value)
class roifile.ROI_POINT_TYPE(*values)

Bases: IntEnum

ImageJ ROI point types.

UNKNOWN = -1

Undocumented or unknown point type.

HYBRID = 0

Hybrid marker (cross with dot).

CROSS = 1

Cross/crosshair marker.

DOT = 2

Dot/circle marker (filled).

CIRCLE = 3

Circle marker (outline).

__format__(format_spec, /)

Convert to a string according to format_spec.

__new__(value)
class roifile.ROI_SUBTYPE(*values)

Bases: IntEnum

ImageJ ROI subtypes.

UNKNOWN = -1

Undocumented or unknown ROI subtype.

UNDEFINED = 0

No subtype specified.

TEXT = 1

Text overlay.

ARROW = 2

Arrow overlay.

ELLIPSE = 3

Ellipse (fitted).

IMAGE = 4

Embedded image overlay.

ROTATED_RECT = 5

Rotated rectangle.

__format__(format_spec, /)

Convert to a string according to format_spec.

__new__(value)
class roifile.ROI_TYPE(*values)

Bases: IntEnum

ImageJ ROI types.

UNKNOWN = -1

Undocumented or unknown ROI type.

POLYGON = 0

Polygon with straight edges.

RECT = 1

Rectangle.

OVAL = 2

Oval/ellipse.

LINE = 3

Straight line.

FREELINE = 4

Freehand line.

POLYLINE = 5

Polyline with straight segments.

NOROI = 6

No ROI.

FREEHAND = 7

Freehand polygon.

TRACED = 8

Traced polygon.

ANGLE = 9

Angle measurement.

POINT = 10

Point or multi-point.

__format__(format_spec, /)

Convert to a string according to format_spec.

__new__(value)