Calculate Area % of either freehand or ellipse ROI
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Victoria
il 30 Lug 2018
Commentato: Image Analyst
il 1 Ago 2018
Hello - I'm trying to figure out the Area % of a thresholded ROI. Currently, I have my code set so that the image is thresholded, and then the user manual draws a freehand ROI (still debating if freehand or ellipse ROI is better). I want the code to give me the percent of area that is 'white' in the threshold over the total area in that ROI, but currently when I draw in the ROI, it is filled with 1's. How can I do this so that it is not filled and I can find the % Area? Below is my code. Thank you!
I=imread('Image.tif'); figure,imshow(I); BW = imbinarize(I,0.300); figure,imshow(BW); % Ask user to draw ROI. message = sprintf('Draw ROI on the wanted image.\nDouble click to finish drawing.'); uiwait(msgbox(message)); h=imfreehand;
Risposta accettata
Image Analyst
il 30 Lug 2018
Use h to create a mask.
mask = h.createMask;
See attached demo for more details.
4 Commenti
Image Analyst
il 1 Ago 2018
You can use writetable() to write an Excel workbook without doing the convertion to a cell array.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!