function []=stat_threshold_gui_cb(); Volume = get(gcf,'UserData'); errchk=1; if get(findobj(gcf,'Tag','Tstat'),'Value')==1 Volume.T_Thresh.Req=1; set(findobj(gcf,'Tag','StaticText1'),'Enable','on'); set(findobj(gcf,'Tag','SearchVolume'),'Enable','on'); set(findobj(gcf,'Tag','VoxelVolume'),'Enable','on'); set(findobj(gcf,'Tag','FWHM'),'Enable','on'); set(findobj(gcf,'Tag','Df'),'Enable','on'); set(findobj(gcf,'Tag','P_val_peak'),'Enable','on'); set(findobj(gcf,'Tag','ClusterThresh'),'Enable','on'); set(findobj(gcf,'Tag','P_val_extent'),'Enable','on'); set(findobj(gcf,'Tag','Dim'),'Enable','on'); Volume.T_Thresh.Volume =str2num(get(findobj(gcf,'Tag','SearchVolume'),'String'));if isempty(Volume.T_Thresh.Volume);errchk=0;end Volume.T_Thresh.Voxel = str2num(get(findobj(gcf,'Tag','VoxelVolume'),'String'));if isempty(Volume.T_Thresh.Voxel);errchk=0;end Volume.T_Thresh.FWHM = str2num(get(findobj(gcf,'Tag','FWHM'),'String'));if isempty(Volume.T_Thresh.FWHM);errchk=0;end Volume.T_Thresh.DF = str2num(get(findobj(gcf,'Tag','Df'),'String'));if isempty(Volume.T_Thresh.DF);errchk=0;end Volume.T_Thresh.P_val_peak = str2num(get(findobj(gcf,'Tag','P_val_peak'),'String'));if isempty(Volume.T_Thresh.P_val_peak);errchk=0;end Volume.T_Thresh.ClusterThresh = str2num(get(findobj(gcf,'Tag','ClusterThresh'),'String'));if isempty(Volume.T_Thresh.ClusterThresh);errchk=0;end Volume.T_Thresh.P_val_extent = str2num(get(findobj(gcf,'Tag','P_val_extent'),'String'));if isempty(Volume.T_Thresh.P_val_extent);errchk=0;end Volume.T_Thresh.Dim = str2num(get(findobj(gcf,'Tag','Dim'),'String'));if isempty(Volume.T_Thresh.Dim);errchk=0;end if errchk==1;Volume.T_Thresh.Status='OK';else;Volume.T_Thresh.Status = 'Incorrect or incomplete Stat_Threshold definition';end else Volume.T_Thresh.Req=0; set(findobj(gcf,'Tag','StaticText1'),'Enable','off'); set(findobj(gcf,'Tag','SearchVolume'),'Enable','off'); set(findobj(gcf,'Tag','VoxelVolume'),'Enable','off'); set(findobj(gcf,'Tag','FWHM'),'Enable','off'); set(findobj(gcf,'Tag','Df'),'Enable','off'); set(findobj(gcf,'Tag','P_val_peak'),'Enable','off'); set(findobj(gcf,'Tag','ClusterThresh'),'Enable','off'); set(findobj(gcf,'Tag','P_val_extent'),'Enable','off'); set(findobj(gcf,'Tag','Dim'),'Enable','off'); end if get(findobj(gcf,'Tag','LocMax'),'Value')==1 Volume.LocMax.Req=1; if get(findobj(gcf,'Tag','Tstat'),'Value')==1 if ((get(findobj(gcf,'Tag','LocMax_calc'),'Value')==0)&(get(findobj(gcf,'Tag','LocMax_inp'),'Value')==0)) set(findobj(gcf,'Tag','LocMax_calc'),'Enable','on','Value',1); set(findobj(gcf,'Tag','LocMax_inp'),'Enable','on','Value',0); set(findobj(gcf,'Tag','LocMax_val'),'Enable','off'); elseif (get(findobj(gcf,'Tag','LocMax_inp'),'Value')==0) set(findobj(gcf,'Tag','LocMax_calc'),'Enable','on','Value',1); else set(findobj(gcf,'Tag','LocMax_calc'),'Enable','on','Value',0); end else set(findobj(gcf,'Tag','LocMax_calc'),'Enable','off','Value',0); set(findobj(gcf,'Tag','LocMax_inp'),'Enable','on','Value',1); set(findobj(gcf,'Tag','LocMax_val'),'Enable','on'); end set(findobj(gcf,'Tag','LocMaxInput'),'Enable','on'); set(findobj(gcf,'Tag','LocMaxInputFile'),'Enable','on'); Volume.LocMax.Threshold = str2num(get(findobj(gcf,'Tag','LocMax_val'),'String')); Volume.LocMax.InpThresh = get(findobj(gcf,'Tag','LocMax_inp'),'Value'); if isempty(Volume.LocMax.Threshold)&get(findobj(gcf,'Tag','LocMax_inp'),'Value')==1;Volume.LocMax.Status='Incomplete or Incorrect LocMax Definition';else Volume.LocMax.Status='OK';end else Volume.LocMax.Req=0; set(findobj(gcf,'Tag','LocMaxInput'),'Enable','off'); set(findobj(gcf,'Tag','LocMaxInputFile'),'Enable','off'); set(findobj(gcf,'Tag','LocMax_calc'),'Enable','off','Value',0); set(findobj(gcf,'Tag','LocMax_inp'),'Enable','off','Value',0); set(findobj(gcf,'Tag','LocMax_inp'),'Enable','off'); Volume.LocMax.Status='OK'; end if get(findobj(gcf,'Tag','LocMaxInput'),'Value')==1 [Volume.LocMax.Input.filename,Volume.LocMax.Input.filepath]=uigetfile(['*.*'],'Choose Input Image file'); if Volume.LocMax.Input.filename set(findobj(gcf,'Tag','LocMaxInputFile'),'String',[Volume.LocMax.Input.filepath Volume.LocMax.Input.filename]); end end if isempty(Volume.LocMax.Input.filename)&(Volume.LocMax.Req==1) Volume.LocMax.Status = 'Incorrect or incomplete LocMax Definition'; else Volume.LocMax.Status='OK'; end set(gcf,'UserData',Volume);