get segmentation size image

1 Ansicht (letzte 30 Tage)
Bruce Victor
Bruce Victor am 8 Jan. 2022
Beantwortet: Image Analyst am 9 Jan. 2022
Define the get_segmentation_size() function, which allows opening the resulting binary mask of the targeting a certain structure (eg the lungs or heart) of a certain patient and calculates its maximum width, maximum height and area (white region).
calculate width and height the red square

Antworten (1)

Image Analyst
Image Analyst am 9 Jan. 2022
Try getting the bounding box of the convex hull.
mask = bwconvhull(mask, 'union');
props = regionprops(mask, 'BoundingBox');
bb = props.BoundingBox;
% Display it over the image.
hold on;
rectangle('position', bb);
width = bb(3)
height = bb(4)
areaOfBoundingBox = width * height

Community Treasure Hunt

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

Start Hunting!

Translated by