fissa.readimagejrois module

Tools for reading ImageJ files.

Based on code originally written by Luis Pedro Coelho <luis@luispedro.org>, 2012, available at https://gist.github.com/luispedro/3437255, distributed under the MIT License.

Modified
fissa.readimagejrois.parse_roi_file(roi_source)

Parses an individual ImageJ ROI

This implementation utilises the read_roi package, which is more robust but does only supports Python 3+ and not Python 2.7.

Parameters:

roi_source (str or file object) – Path to file, or file object containing a single ImageJ ROI

Returns:

Returns a parsed ROI object, a dictionary with either a ‘polygons’ or a ‘mask’ field.

Return type:

dict

Raises:
  • IOError – If there is an error reading the roi file object.
  • ValueError – If unable to parse ROI.
fissa.readimagejrois.read_imagej_roi_zip(filename)[source]

Reads an ImageJ ROI zip set and parses each ROI individually

Parameters:filename (str) – Path to the ImageJ ROis zip file
Returns:roi_list – List of the parsed ImageJ ROIs
Return type:list