Extracting point ROIs from ImageJ .tif files in Python

Hi all,

I’m currently working on a project that requires me to extract the ROIs as coordinates from tiff files saved by ImageJ from within a Jupyter notebook. When I open the files in Fiji, they open correctly with the point ROIs marked, but I can’t seem to find a way to get those coordinates from the images themselves. I was wondering if anyone knew of any Python libraries that would allow me to extract just the coordinates of ROIs by passing in an image or an image path.


Try roifile together with tifffile.

from roifile import roiread
for roi in roiread('ImageJ_file.tif'):

Coordinates can be found in several attributes of roi depending on the ROI type.

1 Like