%%%%%%%%%% MENU 3 %%%%%%%%%%
function menu3(action,varargin)
if nargin<1,
action='Initialize';
end;
feval(action,varargin{:});
return;
function Initialize()
%%%% image processing variables
global Image1; % original image
global Image2; % blured image
global sigma;
global mu;
global NoGVFIterations; % number of iterations
global NoSnakeIterations; % number of Snake iterations
global VectorFieldButt;
global alpha beta gamma kappa dmin dmax; % parameters for the snake
global px py; % forse filed
global IncSnakeRadius; % inicializaton snake radius
global XSnake YSnake; % conture of the snake
%%%% interface variables
global VectorOfLocalMenuHD; %vector of local objects that can be arased in next step
global HDmainf; %main figure handle
global HDorigPic; %original picture axes handle
global HDbluredPic; %blured picture axes handle
global HDvectorFPic; %handle of vector field picture
global HDedit1 HDedit2 HDedit3 HDedit4 HDedit5 HDedit6 HDedit7; % handels of snake edit uicontrol
global HDSnakeLine; %vector of Handles of Snake lines on the picture
global HDedit8 HDedit9 HDRadioButton1 HDRadioButton2;
global HDButton1 HDButton2 HDButton4;
global SnakeON; %indicate if snake is visible
global CircleOn; % inicalization snake will be circle
global SnakeDotsON; % 1 if snake dots should be displeyed
global xsize ysize; %size of the picture
global adgeD MinSize MenuSizeX MenuSizeY MenuPosX MenuPosY;
global ButtHeight ButtWidth ButtDist TextHeight;
global DotsSize; % size in pixels of the dots on the snake
%%%%%% Close Old Objects %%%%%%%%
if ~isempty(VectorOfLocalMenuHD)
delete(VectorOfLocalMenuHD);
VectorOfLocalMenuHD=[];
end;
pause(0.1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define menu objects
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%plot the border for the menu
MenuSizeY=365;
MenuPosX=xsize*2+3*adgeD;
MenuPosY=ysize*2+3*adgeD-8-MenuSizeY;
HDMenuAxes=uicontrol( 'Parent',HDmainf , ...
'Style','frame', ...
'Units','pixels', ...
'Position',[MenuPosX MenuPosY MenuSizeX MenuSizeY],...
'BackgroundColor',[0.45 0.45 0.45]);
% Deform
labelStr='Deform';
ButtPosX=MenuPosX+0.5*ButtDist+MenuSizeX/2;
ButtPosY=MenuPosY+MenuSizeY-ButtDist-ButtHeight;
ButtWidth=MenuSizeX/2-1.5*ButtDist;
HDButton1=uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','pushbutton', ...
'Units','pixels', ...
'Position',[ButtPosX ButtPosY ButtWidth ButtHeight], ...
'String',labelStr, ...
'Enable','on', ...
'Callback','SnakeIter');
% The BACK button
labelStr='<-- Back';
ButtPosX=MenuPosX+ButtDist;
HDButton2=uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','pushbutton', ...
'Units','pixels', ...
'Position',[ButtPosX ButtPosY ButtWidth ButtHeight], ...
'String',labelStr, ...
'Enable','on', ...
'Callback','menu2');
% UICONTROL for alpha
ButtWidth=MenuSizeX-2*ButtDist;
ButtPosY = ButtPosY-ButtDist-ButtHeight;
labelPos=[ButtPosX+0.1*ButtWidth ButtPosY ButtWidth*0.5 TextHeight];
HDtext1 = uicontrol('Parent', HDmainf, ...
'Style','text', ...
'Units','pixels', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','Alpha:', ...
'Interruptible','off', ...
'BackgroundColor',[0.45 0.45 0.45], ...
'ForegroundColor','white');
textPos=[ButtPosX+0.5*ButtWidth ButtPosY ButtWidth*0.35 TextHeight];
callbackStr = 'snakeset';
stringVal=num2str(alpha);
HDedit1 = uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','edit', ...
'Units','pixel', ...
'Position',textPos, ...
'Units','normal', ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',stringVal,'Value',alpha, ...
'UserData',alpha,...
'Enable','on',...
'callback',callbackStr);
% UICONTROL for beta
ButtPosY = ButtPosY-ButtDist-ButtHeight;
labelPos=[ButtPosX+0.1*ButtWidth ButtPosY ButtWidth*0.5 TextHeight];
HDtext2 = uicontrol('Parent', HDmainf, ...
'Style','text', ...
'Units','pixels', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','Beta:', ...
'Interruptible','off', ...
'BackgroundColor',[0.45 0.45 0.45], ...
'ForegroundColor','white');
textPos=[ButtPosX+0.5*ButtWidth ButtPosY ButtWidth*0.35 TextHeight];
stringVal=num2str(beta);
HDedit2 = uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','edit', ...
'Units','pixel', ...
'Position',textPos, ...
'Units','normal', ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',stringVal,'Value',beta, ...
'UserData',beta,...
'Enable','on',...
'callback',callbackStr);
% UICONTROL for gamma
ButtPosY = ButtPosY-ButtDist-ButtHeight;
labelPos=[ButtPosX+0.1*ButtWidth ButtPosY ButtWidth*0.5 TextHeight];
HDtext3 = uicontrol('Parent', HDmainf, ...
'Style','text', ...
'Units','pixels', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','Gamma:', ...
'Interruptible','off', ...
'BackgroundColor',[0.45 0.45 0.45], ...
'ForegroundColor','white');
textPos=[ButtPosX+0.5*ButtWidth ButtPosY ButtWidth*0.35 TextHeight];
stringVal=num2str(gamma);
HDedit3 = uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','edit', ...
'Units','pixel', ...
'Position',textPos, ...
'Units','normal', ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',stringVal,'Value',gamma, ...
'UserData',gamma,...
'Enable','on',...
'callback',callbackStr);
% UICONTROL for kappa
ButtPosY = ButtPosY-ButtDist-ButtHeight;
labelPos=[ButtPosX+0.1*ButtWidth ButtPosY ButtWidth*0.5 TextHeight];
HDtext4 = uicontrol('Parent', HDmainf, ...
'Style','text', ...
'Units','pixels', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','Kappa:', ...
'Interruptible','off', ...
'BackgroundColor',[0.45 0.45 0.45], ...
'ForegroundColor','white');
textPos=[ButtPosX+0.5*ButtWidth ButtPosY ButtWidth*0.35 TextHeight];
stringVal=num2str(kappa);
HDedit4 = uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','edit', ...
'Units','pixel', ...
'Position',textPos, ...
'Units','normal', ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',stringVal,'Value',kappa, ...
'UserData',kappa,...
'Enable','on',...
'callback',callbackStr);
% UICONTROL for dmin
ButtPosY = ButtPosY-ButtDist-ButtHeight;
labelPos=[ButtPosX+0.1*ButtWidth ButtPosY ButtWidth*0.5 TextHeight];
HDtext5 = uicontrol('Parent', HDmainf, ...
'Style','text', ...
'Units','pixels', ...
'Position',labelPos, ...
'Horiz','left', ...
'String','Dmin:', ...
'Interruptible','off', ...
'BackgroundColor',[0.45 0.45 0.45], ...
'ForegroundColor','white');
textPos=[ButtPosX+0.5*ButtWidth ButtPosY ButtWidth*0.35 TextHeight];
stringVal=num2str(dmin);
HDedit5 = uicontrol('Parent', HDmainf, ...
'BusyAction','Queue','Interruptible','off',...
'Style','edit', ...
'Units','pixel', ...
'Position',textPos, ...
'Units','normal', ...
'Horiz','right', ...
'Background','white', ...
'Foreground','black', ...
'String',stringVal,'Value',dmin, ...
'UserData',dmin,...
'Enable','on',...
'callback',callbackStr);
% UICONTROL for dmax
ButtPosY = ButtPosY-ButtDist-ButtHeight;
labelPos=[ButtPosX+0.1*ButtWidth ButtPosY ButtWidth*0.5 TextHeight];
HDtext6 = uicontrol('Parent', HDmainf, ...
'Style','text', ...
'Units','pixels', ...
'Position',labelPos, ...
'Horiz','left', ...
'St
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
snake_demo.zip (51个子文件)
subf
muset.m 374B
CallBackHelpSlider.m 512B
gradient2.m 2KB
menu3.m 25KB
closeapl.m 289B
sigmaset.m 392B
iterset.m 420B
RadioUPDATE.m 905B
WriteHelp.m 2KB
menu0.m 6KB
caclVF.m 3KB
iterset2.m 387B
snakeset.m 704B
menu1.m 9KB
menu2.m 8KB
SnakeIter.m 8KB
sdemo.m 4KB
head.jpg 31KB
images
heart3.mat 4KB
new.pgm 64KB
heart2.mat 4KB
u64.mat 3KB
room.mat 3KB
u642.mat 3KB
room3.mat 3KB
room2.mat 3KB
heart.pgm 25KB
U64.pgm 4KB
chest.pgm 46KB
room.pgm 4KB
heart.mat 1KB
snake
BoundMirrorExpand.m 699B
imdisp.m 257B
Contents.m 1KB
snakedisp.m 551B
GVF.m 2KB
snakedeform.m 1KB
snakeinterp1.m 1KB
snakedeform2.m 2KB
rawwrite.m 2KB
snakeinit.m 894B
BoundMirrorEnsure.m 916B
rawread.m 3KB
snakeinterp.m 2KB
snakeindex.m 190B
dt.m 608B
GGVF.m 895B
xconv2.m 913B
gaussianMask.m 255B
gaussianBlur.m 500B
BoundMirrorShrink.m 488B
共 51 条
- 1
jjqldyt
- 粉丝: 21
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页