File Exchange

image thumbnail

FHROI: Interactive freehand ROI

version 1.2.0.0 (2.03 KB) by Andrew Davis
Interactively specify 2D freehand ROI

2 Downloads

Updated 07 Feb 2012

View License

FHROI: Interactively specify 2D freehand ROI

Overlays an imfreehand ROI on an image.
Gives the ability to tweak the ROI by adding and
subtracting regions as needed, while updating
the ROI boundaries as an overlay on the image.
Returns a logical matrix of the same size as the
overlain image.

Requires alphamask:
http://www.mathworks.com/matlabcentral/fileexchange/34936

Usage:
bwMask = fhroi([axHandle])
axHandle: handle to axes on which to operate (optional)
bwMask: ROI mask as logical matrix

Example:
figure;
I = rand(20) + eye(20);
imshow(I, [], 'Colormap', hot, 'initialMagnification', 1000);
bwMask = fhroi;

See also IMFREEHAND, CREATEMASK

Cite As

Andrew Davis (2020). FHROI: Interactive freehand ROI (https://www.mathworks.com/matlabcentral/fileexchange/34890-fhroi-interactive-freehand-roi), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

I thought I would post this question I received via email in case others have a similar question:

Q: I was wondering if there is a modification that can be made to report the roi (bwMask) not as a binary, but with the original signal intensities of the image?

A: The nice thing about returning the ROI as a logical is that it can be used to index the original matrix directly. So if your original image was I, you can call
>> Iselected = I(bwMask);
to get a vector of signal intensities corresponding to the ROI. Or to get an image with the non-ROI pixels zeroed out, you could call
>> Imasked = I.*bwMask;

For more, see Steve's blog: http://blogs.mathworks.com/steve/2008/01/28/logical-indexing/

Lili

Updates

1.2.0.0

re-submission of the file since it didn't update last time

1.1.0.0

- Added 'delete ROI' user option
- Split off mask overlay code into alphamask function

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux