function fig = fmridesign_gui(Volume) col1 = [0.2 0.6 0.9]; col2 = col1*0.9; col3 = [1 1 1]; col4 = col2*1; col5 = col1*.8; Volume.Design.Status = 'Incorrect or incomplete Design'; Volume.Design.Frames.frametimes = []; Volume.Design.Slice.slicetimes=0; Volume.Design.Events.events=[1 0];Volume.Design.Events.numevents=1; Volume.Design.S.S=[];Volume.Design.S.numS=0; Volume.Design.HRF.Multi=0; h0 = figure('Units','normalized', ... 'Color',col1, ... 'Name','fMRIdesign', ... 'NumberTitle','off', ... 'Resize','off', ... 'Position',[0.2 0.3 0.5 0.45], ... 'Tag','fmridesign'); screen = get(0,'ScreenSize'); font_size = round((screen(3)-400)/200)+3; font_name = 'Helvetica'; h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', ['fmridesign_gui_cb;Volume=get(gcf,''UserData'');if Volume.Design.Status(1:2) == ''OK'';if isfield(Volume.Design.HRF,''plot'');if ishandle(Volume.Design.HRF.plot);delete(Volume.Design.HRF.plot);end;rmfield(Volume.Design.HRF,''plot'');end;delete(gcf);fmridesign_prog(Volume);return; else errordlg(Volume.Design.Status,''Error'');end;'], ... 'ListboxTop',0, ... 'Position',[0.82 0.03 0.15 0.07], ... 'String','Accept', ... 'Style','pushbutton', ... 'Tag','Push1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'Volume=get(gcf,''UserData'');if isfield(Volume.Design.HRF,''plot'');if ishandle(Volume.Design.HRF.plot);close(Volume.Design.HRF.plot);end;rmfield(Volume.Design.HRF,''plot'');end;delete(gcf);set(Volume.fig,''Visible'',''on'');return;', ... 'ListboxTop',0, ... 'Position',[0.82 0.12 0.15 0.07], ... 'String','Back', ... 'Style','pushbutton', ... 'Tag','Push1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmridesign_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.67 0.15 0.06], ... 'String','Frame Times', ... 'Style','pushbutton', ... 'Tag','FrameFile', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmridesign_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.55 0.15 0.06], ... 'String','Slice Times', ... 'Style','pushbutton', ... 'Tag','SliceFile', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmridesign_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.43 0.15 0.06], ... 'String','Events', ... 'Style','pushbutton', ... 'Tag','EventsFile', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmridesign_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.31 0.15 0.06], ... 'String','S', ... 'Style','pushbutton', ... 'Tag','SFile', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.67 0.61 0.06], ... 'Style','text', ... 'String', '', ... 'Tag','FrameFileName'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'ListboxTop',0, ... 'Position',[0.29 0.55 0.61 0.06], ... 'Style','text', ... 'String', '0', ... 'Tag','SliceFileName'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'ListboxTop',0, ... 'Position',[0.29 0.43 0.61 0.06], ... 'Style','text', ... 'String', '1 0', ... 'Tag','EventsFileName'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'ListboxTop',0, ... 'Position',[0.29 0.31 0.61 0.06], ... 'Style','text', ... 'String', 'No S Definred', ... 'Tag','SFileName'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.18 0.2 0.11 0.05], ... 'String','Peak1', ... 'Style','text', ... 'Tag','StaticText1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[0.18 0.14 0.11 0.07], ... 'Style','edit', ... 'String','5.4', ... 'Tag','HRF_1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.3 0.2 0.11 0.05], ... 'String','FWHM1', ... 'Style','text', ... 'Tag','StaticText1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[0.3 0.14 0.11 0.07], ... 'Style','edit', ... 'String','5.2', ... 'Tag','HRF_2'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.42 0.2 0.11 0.05], ... 'String','Peak2', ... 'Style','text', ... 'Tag','StaticText1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[0.42 0.14 0.11 0.07], ... 'Style','edit', ... 'String','10.8', ... 'Tag','HRF_3'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.54 0.2 0.11 0.05], ... 'String','FWHM2', ... 'Style','text', ... 'Tag','StaticText1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[0.54 0.14 0.11 0.07], ... 'Style','edit', ... 'String','7.35', ... 'Tag','HRF_4'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.66 0.2 0.11 0.05], ... 'String','Dip', ... 'Style','text', ... 'Tag','StaticText1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',[1 1 1], ... 'ListboxTop',0, ... 'Position',[0.66 0.14 0.11 0.07], ... 'Style','edit', ... 'String','0.35', ... 'Tag','HRF_5'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'Callback', 'fmridesign_gui_cb', ... 'ListboxTop',0, ... 'Position',[0.17 0.05 0.25 0.06], ... 'String','Multiple HRFs', ... 'Style','pushbutton', ... 'Tag','MultiHRF', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'Callback', 'fmridesign_gui_cb', ... 'ListboxTop',0, ... 'Position',[0.46 0.05 0.25 0.06], ... 'String','Plot HRF(s)', ... 'Style','pushbutton', ... 'Tag','PlotHRF', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmridesign_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.8 0.83 0.05], ... 'String','Definition File', ... 'Tag','DefineFile', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.3 0.9 0.35 0.06], ... 'String','fMRIdesign', ... 'Style','text', ... 'Tag','StaticText3'); h1 = uimenu(gcf,'Label','Related Papers'); uimenu(h1,'Label','Worsley et al. (2000)','CallBack','web(''http://www.math.mcgill.ca/keith/HBM2000/HBM2000.html'',''-browser'');'); uimenu(h1,'Label','Worsley et al. (2001)','CallBack','web(''http://www.math.mcgill.ca/keith/fmristat_paper/fmristat.pdf'',''-browser'');'); h1 = uimenu(gcf,'Label','Related WebPages'); uimenu(h1,'Label','fMRIstat Web','CallBack','web(''http://www.math.mcgill.ca/keith/fmristat/'',''-browser'');'); uimenu(h1,'Label','fMRI at the BIC','CallBack','web(''http://www.bic.mni.mcgill.ca/~vali/fmri/'',''-browser'');'); set(gcf,'UserData',Volume); fmridesign_gui_cb;