https://github.com/jhsmit/pymagej
Python tools for ImageJ
https://github.com/jhsmit/pymagej
Last synced: about 1 month ago
JSON representation
Python tools for ImageJ
- Host: GitHub
- URL: https://github.com/jhsmit/pymagej
- Owner: Jhsmit
- License: gpl-2.0
- Created: 2015-07-23T14:11:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-25T08:32:00.000Z (almost 4 years ago)
- Last Synced: 2025-03-22T10:17:02.175Z (about 2 months ago)
- Language: Python
- Size: 55.7 KB
- Stars: 13
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://travis-ci.com/Jhsmit/PymageJ)
# PymageJ
Python tools for ImageJ.
Features: read/write ImageJ ROIs.## How to use
**Reading ROI files:**
```python
from pymagej.roi import ROIDecoder
with ROIDecoder('roi_filepath.roi') as roi:
roi_obj = roi.get_roi()
```The returned ```roi_obj``` is an ROIObject depending on the type of ROI. Currently only reading rectangle and freehand are supported.
**Writing ROI files:**
```python
from pymagej.roi import ROIEncoder, ROIRect
roi_obj = ROIRect(20, 30, 40, 50) # Make ROIRect object specifing top, left, bottom, right
with ROIEncoder('roi_filepath.roi', roi_obj) as roi:
roi.write()
```Read/write is supported for the following ROI types:
- Polygon
- Rectangle
- Oval
- Line
- Freeline
- Polyline
- FreehandSee also: https://github.com/hadim/read-roi