ImageJS
    Preparing search index...

    Class Roi

    Index

    Constructors

    • Parameters

      • map: RoiMap
      • id: number
      • width: number
      • height: number
      • origin: Point
      • surface: number

      Returns Roi

    Properties

    height: number

    Height of the ROI.

    id: number

    ID of the ROI. Positive for white ROIs and negative for black ones.

    origin: Point

    Origin of the ROI. The top-left corner of the rectangle around the ROI relative to the original image.

    surface: number

    Surface of the ROI.

    width: number

    Width of the ROI.

    Accessors

    • get absolutePoints(): Point[]

      Computes ROI points relative to Image's/Mask's point of origin.

      Returns Point[]

      Array of points with absolute ROI coordinates.

    • get borders(): Border[]

      Calculates and caches border's length and their IDs.

      Returns Border[]

      Borders' length and their IDs.

    • get ellipse(): Ellipse

      Computes ellipse of ROI. It is the smallest ellipse that fits the ROI.

      Returns Ellipse

      Ellipse

    • get eqpc(): number

      Computes the diameter of a circle of equal projection area (EQPC). It is a diameter of a circle that has the same surface as the ROI.

      Returns number

      eqpc value in pixels.

    • get externalBorders(): Border[]

      Returns an array of ROIs IDs that touch the current ROI.

      Returns Border[]

      The array of Borders.

    • get feret(): Feret

      This is not a diameter in its actual sense but the common basis of a group of diameters derived from the distance of two tangents to the contour of the particle in a well-defined orientation. In simpler words, the method corresponds to the measurement by a slide gauge (slide gauge principle). In general it is defined as the distance between two parallel tangents of the particle at an arbitrary angle. The minimum Feret diameter is often used as the diameter equivalent to a sieve analysis.

      Returns Feret

      The maximum and minimum Feret Diameters.

    • get filledSurface(): number

      Computes the surface of the ROI, including the surface of the holes.

      Returns number

      Surface including holes measured in pixels.

    • get fillRatio(): number

      Computes fill ratio of the ROI. It is calculated by dividing ROI's actual surface over the surface combined with holes, to see how holes affect its surface.

      Returns number

      Fill ratio value.

    • get holesInfo(): { number: number; surface: number }

      Number of holes in the ROI and their total surface. Used to calculate fillRatio.

      Returns { number: number; surface: number }

      The surface of holes in ROI in pixels.

    • get internalIDs(): number[]

      Returns an array of ROIs IDs that are included in the current ROI. This will be useful to know if there are some holes in the ROI.

      Returns number[]

      InternalIDs.

    • get mbr(): Mbr

      Computes the minimum bounding rectangle. In digital image processing, the bounding box is merely the coordinates of the rectangular border that fully encloses a digital image when it is placed over a page, a canvas, a screen or other similar bidimensional background.

      Returns Mbr

      The minimum bounding rectangle.

    • get ped(): number

      Computes the diameter of a circle that has the same perimeter as the particle image.

      Returns number

      Ped value in pixels.

    • get perimeter(): number

      Perimeter of the ROI. The perimeter is calculated using the sum of all the external borders of the ROI to which we subtract: (2 - √2) * the number of pixels that have 2 external borders 2 * (2 - √2) * the number of pixels that have 3 external borders

      Returns number

      Perimeter value in pixels.

    • get perimeterInfo(): { four: number; one: number; three: number; two: number }

      Calculates and caches the number of sides by which each pixel is touched externally.

      Returns { four: number; one: number; three: number; two: number }

      An object which tells how many pixels are exposed externally to how many sides.

    • get relativePoints(): Point[]

      Computes ROI points relative to ROIs point of origin.

      Returns Point[]

      Array of points with relative ROI coordinates.

    • get solidity(): number

      The solidity describes the extent to which a shape is convex or concave. The solidity of a completely convex shape is 1, the farther the it deviates from 1, the greater the extent of concavity in the shape of the ROI.

      Returns number

      Solidity value.

    • get sphericity(): number

      Computes sphericity of the ROI. Sphericity is a measure of the degree to which a particle approximates the shape of a sphere, and is independent of its size. The value is always between 0 and 1. The less spheric the ROI is the smaller is the number.

      Returns number

      Sphericity value.

    Methods

    • Return the value at the given coordinates in an ROI map.

      Parameters

      • column: number

        Column of the value.

      • row: number

        Row of the value.

      Returns number

      The value at the given coordinates.

    • Returns the ratio between the width and the height of the bounding rectangle of the ROI.

      Returns number

      The width by height ratio.

    • Generator function to calculate point's coordinates.

      Parameters

      • absolute: boolean

        controls whether coordinates should be relative to ROI's point of origin (relative), or relative to ROI's position on the Image/Mask (absolute).

      Returns Generator<{ column: number; row: number }, void, unknown>

      Coordinates of each point of ROI.

    • A JSON object with all the data about ROI.

      Returns {
          centroid: Point;
          convexHull: { perimeter: number; points: Point[]; surface: number };
          eqpc: number;
          feret: Feret;
          filledSurface: number;
          fillRatio: number;
          height: number;
          id: number;
          mbr: Mbr;
          origin: Point;
          ped: number;
          perimeter: number;
          roundness: number;
          solidity: number;
          sphericity: number;
          surface: number;
          width: number;
      }

      All current ROI properties as one object.