Install & Compatibility
Where this runs
tested against v2025.12.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.288s · 89.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.278s · 86MB
89MB installed
● package 89MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
roifile
✓ import roifile
✗ from roifile import roiread
roiread is not a top-level function; use roifile.roiread() or roifile.ImagejRoi.fromfile()
roifile.roiread
✓ from roifile import roiread
Correct import for the convenience function
roifile.ImagejRoi
✓ from roifile import ImagejRoi
Main class for ROI objects
Reads an ImageJ ROI file, prints its type and coordinates, then creates a new ROI from a list of points and saves it.
import roifile
# Read an ROI from a file
roi = roifile.roiread('example.roi')
print('ROI type:', roi.roitype)
print('Coordinates:', roi.coordinates())
# Create a new ROI and save
import numpy as np
new_roi = roifile.ImagejRoi.frompoints(np.array([[0,0], [10,0], [10,10], [0,10]]))
new_roi.tofile('square.roi')
Errors
Common errors & fixes
AttributeError: module 'roifile' has no attribute 'roiread'
roiread was renamed to roifile.roiread in version 2022.0.0 or import path confusion.
fixUse: from roifile import roiread
ValueError: Unsupported ROI type: 0
The ROI file is corrupted or not a valid ImageJ ROI.
fixVerify the file is a valid .roi file; try re-saving from ImageJ.
Upgrade
Version history
2026.2.10latest on PyPI · released Feb 11, 2026
Audit
Dependencies
numpyrequiredROI data is represented as NumPy arrays