image-js
Version:
Image processing and manipulation in JavaScript
21 lines (17 loc) • 608 B
text/typescript
import type { GetBorderPointsOptions } from '../maskAnalysis/index.js';
import type { Point } from '../utils/geometry/points.js';
import type { Roi } from './Roi.js';
/**
* Return an array with the coordinates of the pixels that are on the border of the ROI.
* The reference is the top-left corner of the ROI.
* @param roi - ROI to process.
* @param options - Get border points options.
* @returns The array of border pixels.
*/
export function getBorderPoints(
roi: Roi,
options: GetBorderPointsOptions = {},
): Point[] {
const mask = roi.getMask();
return mask.getBorderPoints(options);
}