mask2roi
バージョン 1.0.0 (2.93 KB) 作成者:
Alexander Moody
Works like the function "createMask," but in the opposite direction. Takes a mask and produces points that can be used to draw a polygon.
mask2roi converts binary images/masks into roi positions. Only one input
is required for default algorithm, the mask. This mask can have any
number of regions which will be contained in separate cells of the
output. Additional outputs are perimeters (masks of edges) for each
region. The points are lined up to be used in drawpolygon as shown below:
EXAMPLE:
roiPositions = mask2roi(mask)
for i = 1:length(roiPositions)
drawpolygon("Position", roiPositions{i}, "Parent", imageAxes)
end
INPUTS:
mask - logical - binary image
NumROIs - numeric/int - specify the number of ROIs you want returned
Connectivity - numeric - must be 4 or 8
FillHoles - logical - in case you don't want holes filled in mask
ScaleNumVertices - numeric/int - higher numbers remove more points
RoundOutput - logical - rounds vertex coordinates
OUTPUTS:
roiPositions - cell of double arrays - arrays are n-by-2 where n is the
number of regions in the mask, x and y correspond to col 1 and 2
perimeters - optional - cell of 2D double arrays - Each with an edge mask
of the individual regions
引用
Alexander Moody (2026). mask2roi (https://jp.mathworks.com/matlabcentral/fileexchange/133577-mask2roi), MATLAB Central File Exchange. に取得済み.
MATLAB リリースの互換性
作成:
R2023a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linuxタグ
| バージョン | 公開済み | リリース ノート | |
|---|---|---|---|
| 1.0.0 |
