mask2roi

Works like the function "createMask," but in the opposite direction. Takes a mask and produces points that can be used to draw a polygon.
4 téléchargements
Mise à jour 10 août 2023

Afficher la licence

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

Citation pour cette source

Alexander Moody (2024). mask2roi (https://www.mathworks.com/matlabcentral/fileexchange/133577-mask2roi), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2023a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0