Code covered by the BSD License
- SegmentToolA GUI tool for trying out, and generating code for, different approaches to segmenting an image.
- cellfind(z)
[POSNS, VALS] = CELLFIND(Z) evaluates cell array Z and returns the positions and values of nonempty elements.
- createButtonLabel(string,...createButtonLabel: creates a tightly cropped RGB image (button-label) of a simple text string
- distributeObjects(nobject...[objpos, objdim] = distributeObjects(nobjects, startpos, endpos, gap, warnoff)
- expandAxes(hndls,rotEnable)
Sets all axes in the handle list to expand in a new figure on buttondown.
- getNewImage(convertToDoub...Prompt for new image from file or workspace
- imgformats(augment)
FILTERSPEC = IMGFORMATS(AUGMENT)
- markImagePoints(imgax,var...Pass in a handle to an image-containing axes
- roundto(a, place)
Copyright 2012 The MathWorks, Inc.
- showMaskAsOverlay(opacity...Show segmentation (mask) with user-specified transparency/color as overlay on image
- sliderPanel(parent,PanelP...[sliderHandle,panelHandle,editHandle] = sliderPanel(parent,PanelPVs,SliderPVs,EditPVs,LabelPVs,numFormat)
- tabPanel(parent,tabLabels...tabPanel: Create a uipanel comprising labeled, tiered, and ranked tabbed cards.
- thresholdLocally(A, blksz...Performs LOCAL Otsu thresholding on an image; user can specify blocksize
- uigetvariables(prompts,in...% uigetvariables Open variable selection dialog box
- FindCirclesGUI.m
- SegmentTool.m
-
View all files
from
SegmentTool: An Interactive GUI for Segmenting Images
by Brett Shoelson
Interactively find the best approach to segmenting (masking) your image
|
| cellfind(z)
|
function [posns, vals] = cellfind(z)
%[POSNS, VALS] = CELLFIND(Z) evaluates cell array Z and returns the positions and values of nonempty elements.
% Written by Brett Shoelson, PhD
% brett.shoelson@mathworks.com
% Copyright 2010-2013 The Mathworks Inc
if nargout == 0 | nargout == 1
posns=[];
elseif nargout == 2
posns=[];
vals=[];
end
if ~strcmp(class(z),'cell')
error('cellfind.m message: Option is valid only for cell arrays. Use ''find'' for non-cell arrays.');
end
nonzeros=cellfun('prodofsize',z)/2;
posns=find(nonzeros);
number_nonzero_elements=length(posns);
sum_of_lengths=sum(sum(nonzeros));
contval=questdlg('Compile matrix of nonzero elements? (This may take a few minutes.)','Compile Elements?','Continue','NO','NO');
if strcmp(contval,'Continue')
h = waitbar(0,'Compiling nonempty elements....');
x=1;
y=length(posns);
for i=x:y
waitbar((i-x)/(y-x));
vals=[vals;z{posns(i)}];
end
close(h);
end
|
|
Contact us