pencilROI

버전 1.0.0.0 (203 KB) 작성자: Andrés Larroza
Freehand ROI selection with editing options.
다운로드 수: 732
업데이트 날짜: 2016/10/8

라이선스 보기

This is a freehand tool that can be used to draw ROI over images. Editing options are available modify the ROIs.
Function INTERPPOLYGON by Author: Jean-Yves Tinevez is required.
Input arguments:
hfig=Figure's handle
action:
- 'draw'(default): draw a new ROI with the selected color. Clicking over an existing ROI of the same selected color allows to modify it.
- 'move': move an existing ROI.
- 'color': changes the color of an existing ROI.
- 'delete': delete an existing ROI.
- 'polygon': modify an existing ROI. When the ROI is clicked many points are located on the ROI and each one can be moved. Right clicking on any of the points allows to increment or reduce the number of points.
- 'exit': exit function pencilROI
-color: 'r'(default), 'b','g','m','y','c'
-lineWidh
--Example----
I=dicomread('image.dcm');
imshow(I,[]);
pencilROI(gcf,'draw','r',1); %draw a red ROI size 1, or modify existing red ROI
pencilROI(gcf,'draw','g',3); %draw a green ROI size 3, or modify existing green ROI
pencilROI(gcf,'color','b'); %change color of existing ROI to blue
pencilROI(gcf,'polygon'); %modify an existing ROI
pencilROI(gcf,'move'); %move an existing ROI
pencilROI(gcf,'exit'); %exit function pencilROI
--To extract a Mask--
rois=findobj(gcf,'type','line'); %here you will get a vector containing all drawn ROIs in the current figure
coordx=(get(rois(1),'XData'))';
coordy=(get(rois(1),'YData'))';
color=get(rois(1),'Color'); %With the last 3 lines you get x, y and color of ROI number 1, the same for other ROIs.
mask1=poly2mask(coordx,coordy,m,n) %the mask size will be m x n
----INFO----
Authors: - Andrés Larroza (anlarro@gmail.com)
https://andreslarroza.wordpress.com
- Silvia Ruiz (silviaruiz.es@gmail.com)
%Any modifications to the present code is permitted, but we will appreciate
%any feedback for improvement and if our names are always mentioned.

인용 양식

Andrés Larroza (2025). pencilROI (https://kr.mathworks.com/matlabcentral/fileexchange/50567-pencilroi), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2014a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

도움 받은 파일: interppolygon

Community Treasure Hunt

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

Start Hunting!

pencilROI/pencilROI/

버전 게시됨 릴리스 정보
1.0.0.0

Description

Description
Added example to extract ROI mask
Commentaries.
.