Module ij
Package ij.io

Class RoiDecoder


  • public class RoiDecoder
    extends java.lang.Object
    This class decodes an ImageJ .roi file.

    Format of the original 64 byte ImageJ/NIH Image .roi file header. Two byte numbers are big-endian signed shorts. The JavaScript example at http://wsr.imagej.net/macros/js/DecodeRoiFile.js demonstrates how to use this information to decode a .roi file.

            0-3             "Iout"
            4-5             version (>=217)
            6-7             roi type (encoded as one byte)
            8-9             top
            10-11   left
            12-13   bottom
            14-15   right
            16-17   NCoordinates
            18-33   x1,y1,x2,y2 (straight line) | x,y,width,height (double rect) | size (npoints)
            34-35   stroke width (v1.43i or later)
            36-39   ShapeRoi size (type must be 1 if this value>0)
            40-43   stroke color (v1.43i or later)
            44-47   fill color (v1.43i or later)
            48-49   subtype (v1.43k or later)
            50-51   options (v1.43k or later)
            52-52   arrow style or aspect ratio (v1.43p or later)
            53-53   arrow head size (v1.43p or later)
            54-55   rounded rect arc size (v1.43p or later)
            56-59   position
            60-63   header2 offset
            64-       x-coordinates (short), followed by y-coordinates
            
    See Also:
    DecodeRoiFile.js