Class Roi

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 borders(): Border[]
  • Calculates and caches border's length and their IDs.

    Returns Border[]

    Borders' length and their IDs.

  • get convexHull(): {
        perimeter: number;
        points: Point[];
        surface: number;
    }
  • Computes convex hull. It is the smallest convex set that contains it.

    Returns {
        perimeter: number;
        points: Point[];
        surface: number;
    }

    Convex hull.

    • perimeter: number
    • points: Point[]
    • surface: number
  • 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 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 filledSurface(): number
  • Computes the surface of the ROI, including the surface of the holes.

    Returns number

    Surface including holes measured in pixels.

  • 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.

    • number: number
    • surface: number
  • 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.

    • four: number
    • one: number
    • three: number
    • two: number
  • get points(): number[][]
  • Computes current ROI points.

    Returns number[][]

    Array of points. It's an array of tuples, each tuple being the x and y coordinates of the ROI point.

  • 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 an array with the coordinates of the pixels that are on the border of the ROI. The points are defined as [column, row].

    Parameters

    Returns Point[]

    The array of border pixels.

  • 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.

  • Generates a mask of an ROI. You can specify the kind of mask you want using the kind option.

    Parameters

    Returns Mask

    The ROI mask.

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

    Returns number

    The width by height ratio.

  • A JSON object with all the data about ROI.

    Returns {
        centroid: Point;
        convexHull: {
            perimeter: number;
            points: Point[];
            surface: number;
        };
        eqpc: number;
        feret: Feret;
        fillRatio: number;
        filledSurface: 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.

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