function fig = fmrilm_gui(Volume); col1 = [0.2 0.6 0.9]; col2 = col1*0.9; col3 = [1 1 1]; col4 = col2*1; col5 = col1*.8; Volume.LM.Status = 'Incorrect or incomplete Linear Model Definition'; Volume.LM.Input = []; Volume.LM.X_cache.X_cache = []; Volume.LM.Contrast.Contrast = 1; Volume.LM.Exclude.Exclude = 1; Volume.LM.DelayCont=0; Volume.LM.Confound.Confound = []; if isfield(Volume,'X_cache');Volume.LM.X_cache.X_cache=Volume.X_cache;X_cache_str='Using X_cache previously defined';Volume.LM.X_cache.string=X_cache_str;else;X_cache_str='';end h0 = figure('Units','normalized', ... 'Color',col1, ... 'Name','fMRIlm', ... 'NumberTitle','off', ... 'Resize','off', ... 'Position',[0.2 0.3 0.5 0.6], ... 'Tag','fmrilm'); screen = get(0,'ScreenSize'); font_size = round((screen(3)-400)/200)+3; font_name = 'Helvetica'; h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', ['fmrilm_gui_cb;Volume=get(gcf,''UserData'');if Volume.LM.Status(1:2) == ''OK'';delete(gcf);Volume.LM.Batch=0;fmrilm_prog(Volume);return; else errordlg(Volume.LM.Status,''Error'');end;'], ... 'ListboxTop',0, ... 'Position',[0.87 0.04 0.10 0.04], ... 'String','Accept', ... 'Style','pushbutton', ... 'Tag','Push1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', ['fmrilm_gui_cb;Volume=get(gcf,''UserData'');if Volume.LM.Status(1:2) == ''OK'';delete(gcf);Volume.LM.Batch=1;fmrilm_prog(Volume);return; else errordlg(Volume.LM.Status,''Error'');end;'], ... 'ListboxTop',0, ... 'Position',[0.87 0.10 0.10 0.04], ... 'String','Batch', ... 'Style','pushbutton', ... 'Tag','Push1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', ['Volume=get(gcf,''UserData'');delete(gcf);set(Volume.fig,''Visible'',''on'');return;'], ... 'ListboxTop',0, ... 'Position',[0.87 0.16 0.10 0.04], ... 'String','Back', ... 'Style','pushbutton', ... 'Tag','Push1'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.83 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.92 0.35 0.06], ... 'String','fMRIlm', ... 'Style','text', ... 'Tag','StaticText3'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.77 0.15 0.03], ... 'String','Input File Name(s)', ... 'Style','pushbutton', ... 'Tag','InputFile', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.77 0.50 0.03], ... 'Style','text', ... 'String', '', ... 'Tag','InputFileName'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.80 0.77 0.13 0.03], ... 'String','Multi-Input', ... 'Style','checkbox', ... 'Tag','MultipleInFiles', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.07 0.70 0.15 0.03], ... 'String','Output File Base', ... 'Style','text', ... 'Tag','StaticText1', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col3, ... 'ListboxTop',0, ... 'Position',[0.29 0.70 0.61 0.03], ... 'Style','edit', ... 'String', '', ... 'Tag','OutputFileBase'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.63 0.15 0.03], ... 'String','X_cache', ... 'Style','pushbutton', ... 'Tag','X_cache', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.63 0.61 0.03], ... 'Style','text', ... 'String', X_cache_str, ... 'Tag','X_cacheName'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.57 0.15 0.03], ... 'String','Contrast', ... 'Style','pushbutton', ... 'Tag','Contrast', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.57 0.61 0.03], ... 'Style','text', ... 'String', '1', ... 'Tag','ContrastList'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.50 0.15 0.03], ... 'String','Exclude', ... 'Style','pushbutton', ... 'Tag','Exclude', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.50 0.61 0.03], ... 'Style','text', ... 'String', '1', ... 'Tag','ExcludeList'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.43 0.15 0.03], ... 'String','Confounds', ... 'Style','pushbutton', ... 'Tag','Confound', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.43 0.61 0.03], ... 'Style','text', ... 'String', '', ... 'Tag','ConfoundMatrix'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col5, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.07 0.36 0.15 0.03], ... 'String','Delay Contrast', ... 'Style','pushbutton', ... 'Tag','DelayContrast', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.29 0.36 0.61 0.03], ... 'Style','text', ... 'String', '0', ... 'Tag','DelayContrastList'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmridesign_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.45 0.26 0.10 0.05], ... 'String','Which Statistics', ... 'Style','text', ... 'Tag','StaticText1', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.03 0.21 0.09 0.03], ... 'String','T-Stat', ... 'Style','checkbox', ... 'Tag','Tstat', ... 'Value',1); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.13 0.21 0.09 0.03], ... 'String','Effect', ... 'Style','checkbox', ... 'Tag','Effect', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.23 0.21 0.11 0.03], ... 'String','SDEffect', ... 'Style','checkbox', ... 'Tag','SdEffect', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.35 0.21 0.09 0.03], ... 'String','F-Stat', ... 'Style','checkbox', ... 'Tag','Fstat', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.45 0.21 0.09 0.03], ... 'String','AR(1)', ... 'Style','checkbox', ... 'Tag','Rho', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.55 0.21 0.10 0.03], ... 'String','Resids', ... 'Style','checkbox', ... 'Tag','Resids', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.66 0.21 0.16 0.03], ... 'String','Whitened Resids', ... 'Style','checkbox', ... 'Tag','Wresids', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.83 0.21 0.09 0.03], ... 'String','AR(p)', ... 'Style','checkbox', ... 'Tag','ARp', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.10 0.13 0.10 0.05], ... 'String','FWHM rho', ... 'Style','text', ... 'Tag','StaticText1', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col3, ... 'ListboxTop',0, ... 'Position',[0.10 0.08 0.10 0.03], ... 'Style','edit', ... 'String', '15', ... 'Tag','FWHMrho'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.30 0.13 0.10 0.05], ... 'String','Polynomial Drift', ... 'Style','text', ... 'Tag','StaticText1', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col3, ... 'ListboxTop',0, ... 'Position',[0.30 0.08 0.10 0.03], ... 'Style','edit', ... 'String', '3', ... 'Tag','N_Poly'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'CallBack', 'fmrilm_gui_cb;', ... 'ListboxTop',0, ... 'Position',[0.48 0.13 0.14 0.05], ... 'String','Reference Delay', ... 'Style','pushbutton', ... 'Tag','MultiRefDelay', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col3, ... 'ListboxTop',0, ... 'Position',[0.50 0.08 0.10 0.03], ... 'Style','edit', ... 'String', '0', ... 'Tag','RefDelay'); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col4, ... 'ListboxTop',0, ... 'Position',[0.69 0.13 0.12 0.05], ... 'String','AR Error Model Order', ... 'Style','text', ... 'Tag','StaticText1', ... 'Value',0); h1 = uicontrol('Parent',h0, ... 'Units','normalized', ... 'BackgroundColor',col3, ... 'ListboxTop',0, ... 'Position',[0.70 0.08 0.10 0.03], ... 'Style','edit', ... 'String', '1', ... 'Tag','NumLags'); 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'');'); uimenu(h1,'Label','Liao et al. (2001)','CallBack','web(''http://www.math.mcgill.ca/keith/delay/delay.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.math.mcgill.ca/~vali/fmri/'',''-browser'');'); set(gcf,'UserData',Volume); fmrilm_gui_cb;