Code covered by the BSD License  

Highlights from
FHROI: Interactive freehand ROI

5.0

5.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 2.03 KB File ID: #34890
image thumbnail

FHROI: Interactive freehand ROI

by Andrew Davis

 

02 Feb 2012 (Updated 07 Feb 2012)

Interactively specify 2D freehand ROI

| Watch this File

File Information
Description

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

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File  
Everyone's Tags
image processing, mask, roi, signal processing, visualization
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
02 Mar 2012 Andrew Davis

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/

10 Feb 2012 Lili  
Updates
06 Feb 2012

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

07 Feb 2012

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

Contact us