Skip to content

ROI (Region of Interest) Selection

Modern scientific analysis often requires isolating specific features within a dataset. The ROI plugin allows users to draw, modify, and analyze free-hand or geometric regions on the chart.

Interactive Tools Demo

Capture regions using a Rectangle, Circle, Polygon, or free-hand Lasso.

Select a tool and draw on the chart to define an ROI

Features

  • Multi-region Selection: Draw multiple ROIs and manage them collectively.
  • Data Indexing: Get the exact indices of data points inside any region.
  • Styling: Distinct colors and labels for different categories of interest.
  • API Extraction: Programmatically create and remove regions from background processes.

Basic Implementation

typescript
import { createChart, PluginROI } from 'scichart-engine';

const chart = createChart({ container });

// Enable ROI functionality
await chart.use(PluginROI({
  defaultTool: 'rectangle',
  fill: 'rgba(0, 242, 255, 0.2)',
  stroke: '#00f2ff'
}));

// Listen for selection results
chart.events.on('roi:selected', ({ region, masks }) => {
  console.log('ROI ID:', region.id);
  
  masks.forEach(mask => {
    console.log(`Series ${mask.seriesId} has ${mask.indices.length} points inside.`);
  });
});

Available Tools

ToolInteractionBest For
RectangleDrag from corner to cornerStandard windowing, time-gated signals.
CircleDrag from center outwardsRadial clusters, particle detection.
PolygonClick to add vertices, double-click to closeComplex geometric envelopes.
LassoHold and draw free-hand pathNon-linear clusters, irregular outliers.

Advanced Scripting

You can also use the ROI tool programmatically to highlight known areas of interest:

typescript
chart.roi.addRegion({
  id: 'peak-alpha',
  tool: 'rectangle',
  points: [
    { x: 8.5, y: -0.5 },
    { x: 12.0, y: 5.2 }
  ],
  label: 'Alpha Wave'
});

Released under the MIT License.