diff --git a/plscmd/plotroi/rri_file_menu.m b/plscmd/plotroi/rri_file_menu.m index cf0f701..0e85fd2 100644 --- a/plscmd/plotroi/rri_file_menu.m +++ b/plscmd/plotroi/rri_file_menu.m @@ -12,7 +12,7 @@ function rri_file_menu(action, varargin) - if isnumeric(action) + if isnumeric(action) || isgraphics(action) fig = action; action = 'init'; end diff --git a/plscmd/plotroi/rri_txtbox.m b/plscmd/plotroi/rri_txtbox.m index 7f8d9a5..d075cca 100644 --- a/plscmd/plotroi/rri_txtbox.m +++ b/plscmd/plotroi/rri_txtbox.m @@ -72,7 +72,7 @@ % try txtbox_hdl = findobj(CurrentFigure, 'tag', 'rri_txtbox'); - if txtbox_hdl, delete(txtbox_hdl); end; + if isvalid(txtbox_hdl), delete(txtbox_hdl); end; catch end @@ -116,7 +116,6 @@ 'FontWeight', fntweight, ... 'FontSize', fnt, ... 'box','on', ... - 'drawmode','fast', ... 'nextplot','add', ... 'xtick', [-1], ... 'ytick', [-1], ... @@ -125,6 +124,14 @@ 'tag','rri_txtbox', ... 'position', pos); + % to avoid "The DrawMode property will be removed in a future release" warning in R2014b + if verLessThan('matlab', '8.4.0') % R2014b + set(txtbox_hdl,'drawmode', 'fast'); + else + set(txtbox_hdl,'sortmethod', 'childorder'); + end + + if ishandle(varargin{1}) items = (nargin-1)/2; for i=1:items diff --git a/plsgui/bfm_analysis_ui.m b/plsgui/bfm_analysis_ui.m index a272eaa..12c714d 100644 --- a/plsgui/bfm_analysis_ui.m +++ b/plsgui/bfm_analysis_ui.m @@ -1103,7 +1103,7 @@ function Init() group_hdls = [g_h1, g_h2, g_h3, g_h4]; setappdata(h0,'Group_hlist',group_hdls); - group_template = copyobj(group_hdls,h0); + group_template = copyobj_legacy(group_hdls,h0); set(group_template,'visible','off','Tag','GroupUIControls'); setappdata(h0,'GroupTemplate',group_template); @@ -1172,7 +1172,7 @@ function SetupGroupRows() group_hdls = group_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_g_hdls = copyobj(group_template,gcf); + new_g_hdls = copyobj_legacy(group_template,gcf); group_hdls = [group_hdls; new_g_hdls']; end; end; @@ -1275,7 +1275,7 @@ function CreateAddRow() group_template = getappdata(gcf,'GroupTemplate'); - a_hdls = copyobj(group_template,gcf); + a_hdls = copyobj_legacy(group_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/bfm_hrf_input_condition_ui.m b/plsgui/bfm_hrf_input_condition_ui.m index 861a425..2764412 100644 --- a/plsgui/bfm_hrf_input_condition_ui.m +++ b/plsgui/bfm_hrf_input_condition_ui.m @@ -330,7 +330,7 @@ function init(old_conditions,old_condition_baseline,protected_conds) cond1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; % save handles for condition#1 setappdata(h0,'Cond_hlist',cond1_hdls); - cond_template = copyobj(cond1_hdls,h0); + cond_template = copyobj_legacy(cond1_hdls,h0); set(cond_template,'visible','off'); setappdata(h0,'ProtectedConditions',protected_conds); @@ -424,7 +424,7 @@ function SetupConditionRows() cond_hdls = cond_hdls(1:rows,:); else % add new rows to 'rows' amount for i=nr+1:rows, - new_c_hdls = copyobj(cond_template,gcf); + new_c_hdls = copyobj_legacy(cond_template,gcf); cond_hdls = [cond_hdls; new_c_hdls']; end; end @@ -432,7 +432,7 @@ function SetupConditionRows() v = 'off'; for i=1:rows % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = cond_hdls(i,:); % init label @@ -540,7 +540,7 @@ function CreateAddRow() cond_template = getappdata(gcf,'ConditionTemplate'); - a_hdls = copyobj(cond_template,gcf); + a_hdls = copyobj_legacy(cond_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/bfm_hrf_input_run_ui.m b/plsgui/bfm_hrf_input_run_ui.m index 68838f1..0388021 100644 --- a/plsgui/bfm_hrf_input_run_ui.m +++ b/plsgui/bfm_hrf_input_run_ui.m @@ -660,7 +660,7 @@ function init(run_info,num_runs,conditions), setappdata(gcf,'DataDirectory',curr); - onset_template = copyobj([t1 t2 t3 t4 t5],h0); + onset_template = copyobj_legacy([t1 t2 t3 t4 t5],h0); set(onset_template(1),'Tag','ConditionNameLabelTemplate','Visible','off'); set(onset_template(2),'Tag','BlockOnsetEditTemplate','Visible','off'); set(onset_template(3),'Tag','BlockLengthEditTemplate','Visible','off'); @@ -704,7 +704,7 @@ function SetupBlockOnsetRows() onset_hdls = onset_hdls(1:rows,:); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(onset_template,gcf); + new_s_hdls = copyobj_legacy(onset_template,gcf); onset_hdls = [onset_hdls; new_s_hdls']; end; end; diff --git a/plsgui/bfm_input_run_ui.m b/plsgui/bfm_input_run_ui.m index 7aa0da1..e0889c5 100644 --- a/plsgui/bfm_input_run_ui.m +++ b/plsgui/bfm_input_run_ui.m @@ -640,7 +640,7 @@ function init(run_info,num_runs,conditions), setappdata(gcf,'DataDirectory',curr); - onset_template = copyobj([t1 t2 t3 t4 t5],h0); + onset_template = copyobj_legacy([t1 t2 t3 t4 t5],h0); set(onset_template(1),'Tag','ConditionNameLabelTemplate','Visible','off'); set(onset_template(2),'Tag','BlockOnsetEditTemplate','Visible','off'); set(onset_template(3),'Tag','BlockLengthEditTemplate','Visible','off'); @@ -684,7 +684,7 @@ function SetupBlockOnsetRows() onset_hdls = onset_hdls(1:rows,:); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(onset_template,gcf); + new_s_hdls = copyobj_legacy(onset_template,gcf); onset_hdls = [onset_hdls; new_s_hdls']; end; end; diff --git a/plsgui/bfm_plot_brain_scores.m b/plsgui/bfm_plot_brain_scores.m index 129789c..428a777 100644 --- a/plsgui/bfm_plot_brain_scores.m +++ b/plsgui/bfm_plot_brain_scores.m @@ -312,7 +312,7 @@ 'tag','LegendMenu'); % 'sepa','on', ... - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); % load the brain scores, conditions, evt_list @@ -415,7 +415,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/bfm_plot_rf.m b/plsgui/bfm_plot_rf.m index eea3ca9..578863d 100644 --- a/plsgui/bfm_plot_rf.m +++ b/plsgui/bfm_plot_rf.m @@ -930,7 +930,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1387,7 +1387,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/bfm_plot_rf_task.m b/plsgui/bfm_plot_rf_task.m index f4c4c54..c096aa0 100644 --- a/plsgui/bfm_plot_rf_task.m +++ b/plsgui/bfm_plot_rf_task.m @@ -1239,7 +1239,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location','northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1717,7 +1717,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -2402,7 +2402,7 @@ function plot_response_fn_resid() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/bfm_plot_scores_ui.m b/plsgui/bfm_plot_scores_ui.m index 88c2ae5..e509ed8 100644 --- a/plsgui/bfm_plot_scores_ui.m +++ b/plsgui/bfm_plot_scores_ui.m @@ -367,7 +367,7 @@ function bfm_plot_scores_ui(varargin) % set(hh,'Name',sprintf('PLS Scores Plot: %s',PLSresultFile)); % end; - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); [b_scores,d_scores,designlv,s,perm_result,conditions, ... @@ -434,7 +434,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -781,7 +781,7 @@ function PlotDesignScores() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -912,7 +912,7 @@ function PlotDesignLV() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); diff --git a/plsgui/copyobj_legacy.m b/plsgui/copyobj_legacy.m new file mode 100644 index 0000000..fec5506 --- /dev/null +++ b/plsgui/copyobj_legacy.m @@ -0,0 +1,21 @@ +% +% copyobj_legacy +% +% workaround for changed behaviour of copyobj in Matlab 2014b +% +% new_handle = copyobj(h,p) +% copyobj(___,'legacy') +% +% Copy graphics objects and their descendants +% +% copyobj(___,'legacy') copies object callback properties and object application data. +% This behavior is consistent with versions of copyobj before Matlab release R2014b. +% + +function template = copyobj_legacy(source_hdl,parent_hdl) + if verLessThan('matlab', '8.4.0') % R2014b + template = copyobj(source_hdl, parent_hdl); + else + template = copyobj(source_hdl, parent_hdl, 'legacy'); + end +end diff --git a/plsgui/erp_analysis_ui.m b/plsgui/erp_analysis_ui.m index 256d56b..605b0e7 100644 --- a/plsgui/erp_analysis_ui.m +++ b/plsgui/erp_analysis_ui.m @@ -1134,7 +1134,7 @@ function init() group_hdls = [g_h1, g_h2, g_h3, g_h4]; setappdata(h0,'Group_hlist',group_hdls); - group_template = copyobj(group_hdls,h0); + group_template = copyobj_legacy(group_hdls,h0); set(group_template,'visible','off','Tag','GroupUIControls'); setappdata(h0,'GroupTemplate',group_template); @@ -1204,7 +1204,7 @@ function SetupGroupRows() group_hdls = group_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_g_hdls = copyobj(group_template,gcf); + new_g_hdls = copyobj_legacy(group_template,gcf); group_hdls = [group_hdls; new_g_hdls']; end; end; @@ -1318,7 +1318,7 @@ function CreateAddRow() group_template = getappdata(gcf,'GroupTemplate'); buttondown_group = 'erp_analysis_ui(''BUTTONDOWN_GROUP'');'; - a_hdls = copyobj(group_template,gcf); + a_hdls = copyobj_legacy(group_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','on', ... 'UserData',1); % empty string diff --git a/plsgui/erp_input_diff_ui.m b/plsgui/erp_input_diff_ui.m index 2ba50cf..c8febcf 100644 --- a/plsgui/erp_input_diff_ui.m +++ b/plsgui/erp_input_diff_ui.m @@ -285,7 +285,7 @@ couple1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; % save handles for row setappdata(h01,'couple_hlist',couple1_hdls); - couple_template = copyobj(couple1_hdls,h01); + couple_template = copyobj_legacy(couple1_hdls,h01); set(couple_template,'visible','off'); setappdata(h01,'old_couple_lst',old_couple_lst); @@ -336,7 +336,7 @@ function SetupCoupleRows() couple_hdls = couple_hdls(1:rows,:); else % add new rows to 'rows' amount for i=nr+1:rows, - new_c_hdls = copyobj(couple_template,gcf); + new_c_hdls = copyobj_legacy(couple_template,gcf); couple_hdls = [couple_hdls; new_c_hdls']; end; end @@ -344,7 +344,7 @@ function SetupCoupleRows() v = 'off'; for i=1:rows % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = couple_hdls(i,:); % init label @@ -442,7 +442,7 @@ function CreateAddRow() edit_cbf = [edit_cbf, '''Use Add Button to add condition couple'');']; couple_template = getappdata(gcf,'couple_template'); - a_hdls = copyobj(couple_template,gcf); + a_hdls = copyobj_legacy(couple_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... diff --git a/plsgui/erp_new_axis_ui.m b/plsgui/erp_new_axis_ui.m index ded0548..51e66b1 100644 --- a/plsgui/erp_new_axis_ui.m +++ b/plsgui/erp_new_axis_ui.m @@ -79,8 +79,8 @@ rri_file_menu(h01); h0 = gcbf; - copy_axis = copyobj(old_axis, h0); - new_axis = copyobj(copy_axis, h01); + copy_axis = copyobj_legacy(old_axis, h0); + new_axis = copyobj_legacy(copy_axis, h01); delete(copy_axis); set(new_axis, 'position', [.08 .12 .86 .8]); diff --git a/plsgui/erp_plot_brain_scores.m b/plsgui/erp_plot_brain_scores.m index 14b7fb3..ed842ae 100644 --- a/plsgui/erp_plot_brain_scores.m +++ b/plsgui/erp_plot_brain_scores.m @@ -313,7 +313,7 @@ 'Callback','pet_plot_cond_stim_ui(''CHANGE_PLOT_DIMS'');'); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); setappdata(hh,'result_file',plsResultFile); @@ -395,7 +395,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/erp_plot_canonical_corr.m b/plsgui/erp_plot_canonical_corr.m index 74d9c15..cb09137 100644 --- a/plsgui/erp_plot_canonical_corr.m +++ b/plsgui/erp_plot_canonical_corr.m @@ -319,7 +319,7 @@ get_st_datamat_filename(plsResultFile); make_datamat_popup(1); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); [brainlv,conditions,cond_selection,chan_selection, ... @@ -380,7 +380,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/erp_plot_canonical_scores.m b/plsgui/erp_plot_canonical_scores.m index e2ecab8..c1c71fc 100644 --- a/plsgui/erp_plot_canonical_scores.m +++ b/plsgui/erp_plot_canonical_scores.m @@ -323,7 +323,7 @@ get_st_datamat_filename(plsResultFile); make_datamat_popup(1); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); [brainlv,conditions,cond_selection,chan_selection,common_time_info] = ... @@ -382,7 +382,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/erp_plot_rf_task.m b/plsgui/erp_plot_rf_task.m index 09ecf4d..c9ce812 100644 --- a/plsgui/erp_plot_rf_task.m +++ b/plsgui/erp_plot_rf_task.m @@ -1560,7 +1560,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1878,7 +1878,7 @@ function plot_response_fn_resid() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/erp_plot_scores_ui.m b/plsgui/erp_plot_scores_ui.m index 725fa3f..41f140e 100644 --- a/plsgui/erp_plot_scores_ui.m +++ b/plsgui/erp_plot_scores_ui.m @@ -446,7 +446,7 @@ 'label','&Zoom on'); - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); curr_lv_state = zeros(1,num_lv); curr_lv_state(1) = 1; @@ -520,7 +520,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -701,7 +701,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -838,7 +838,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -986,7 +986,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1701,7 +1701,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1713,7 +1713,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1731,7 +1731,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1743,7 +1743,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1761,7 +1761,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1773,7 +1773,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2116,7 +2116,7 @@ function select_subj() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl3',[{l_hdl} {o_hdl}]); diff --git a/plsgui/erp_plot_taskpls_bs.m b/plsgui/erp_plot_taskpls_bs.m index bbf2a9f..e50c29b 100644 --- a/plsgui/erp_plot_taskpls_bs.m +++ b/plsgui/erp_plot_taskpls_bs.m @@ -410,7 +410,7 @@ 'String','', ... 'Tag','MessageLine'); - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); curr_lv_state = zeros(1,num_lv); curr_lv_state(1) = 1; @@ -482,7 +482,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -665,7 +665,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -797,7 +797,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -941,7 +941,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1666,7 +1666,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1678,7 +1678,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1696,7 +1696,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1708,7 +1708,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1726,7 +1726,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1738,7 +1738,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1952,7 +1952,7 @@ function select_subj() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2103,7 +2103,7 @@ function SelectLV(selected_lv) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2139,7 +2139,7 @@ function SelectLV(selected_lv) end if ~isempty(ulusc) - h2 = errorbar(range, orig_usc(range,lv_idx), llusc(range,lv_idx), ulusc(range,lv_idx), 'ok'); + h2 = errorbar(range, orig_usc(range,lv_idx), abs(llusc(range,lv_idx)), ulusc(range,lv_idx), 'ok'); end hold off; diff --git a/plsgui/erp_plot_ui.m b/plsgui/erp_plot_ui.m index 1d14ae5..abdf685 100644 --- a/plsgui/erp_plot_ui.m +++ b/plsgui/erp_plot_ui.m @@ -415,13 +415,19 @@ 'ytick', [], ... 'xaxislocation', 'top', ... 'yaxislocation', 'left', ... - 'drawmode', 'fast', ... 'visible','off', ... 'position', pos); -% 'fontunit','normal', ... -% 'fontname','courier', ... -% 'fontsize',0.023, ... + % to avoid "The DrawMode property will be removed in a future release" warning in R2014b + if verLessThan('matlab', '8.4.0') % R2014b + set(ha,'drawmode', 'fast'); + else + set(ha,'sortmethod', 'childorder'); + end + + % 'fontunit','normal', ... + % 'fontname','courier', ... + % 'fontsize',0.023, ... %--------------------------- menu ---------------------- @@ -2192,7 +2198,7 @@ function display_legend(state) if ~isempty(avg_wave_hdl) & ~isempty(wave_hdl) % display both [l_hdl, o_hdl] = legend([avg_wave_hdl(first_chan,selected_avg_idx), ... wave_hdl(first_chan,selected_wave_idx)], ... - char([{selected_avg_name}; {selected_wave_name}]), 0); + char([{selected_avg_name}; {selected_wave_name}]), 'Location', 'northeast'); legend_txt(o_hdl); elseif isempty(avg_wave_hdl) & ~isempty(wave_hdl) % display subj if ~isempty(bs_wave_hdl) % also display bootstrap @@ -2208,16 +2214,16 @@ function display_legend(state) [l_hdl, o_hdl] = legend([wave_hdl(first_chan,selected_wave_idx), ... bs_wave_hdl(first_chan,selected_bs_idx)], ... - char([{selected_wave_name}; {selected_bs_name}]), 0); + char([{selected_wave_name}; {selected_bs_name}]), 'Location', 'northeast'); legend_txt(o_hdl); else [l_hdl, o_hdl] = legend(wave_hdl(first_chan,selected_wave_idx), ... - selected_wave_name, 0); + selected_wave_name, 'Location', 'northeast'); legend_txt(o_hdl); end elseif ~isempty(avg_wave_hdl) & isempty(wave_hdl) % display avg [l_hdl, o_hdl] = legend(avg_wave_hdl(first_chan,selected_avg_idx), ... - selected_avg_name, 0); + selected_avg_name, 'Location', 'northeast'); legend_txt(o_hdl); end diff --git a/plsgui/erp_showplot_ui.m b/plsgui/erp_showplot_ui.m index f90599a..77f3c0c 100644 --- a/plsgui/erp_showplot_ui.m +++ b/plsgui/erp_showplot_ui.m @@ -410,7 +410,7 @@ function erp_showplot_ui(fig) k = 1; for j = xtick_pos - xtick_template(k,:) = copyobj(xtick_template_hdl, ha); + xtick_template(k,:) = copyobj_legacy(xtick_template_hdl, ha); set(xtick_template(k,:),'xdata', ... get(xtick_template(k,:),'xdata') ... + j/timepoint); @@ -457,7 +457,7 @@ function erp_showplot_ui(fig) k = 1; for j = ytick_pos - ytick_template(k,:) = copyobj(ytick_template_hdl, ha); + ytick_template(k,:) = copyobj_legacy(ytick_template_hdl, ha); set(ytick_template(k,:),'ydata', ... get(ytick_template(k,:),'ydata') ... +j/(wave_top - wave_bottom)); @@ -475,7 +475,7 @@ function erp_showplot_ui(fig) offset2 = 0; % legend axis offset to bottom offset3 = 0.01; % axis label offset to axis - laxis_hdl = copyobj(axis_template, ha); + laxis_hdl = copyobj_legacy(axis_template, ha); for j=1:2 % just for 2 axis line set(laxis_hdl(j), 'visible', 'on', ... @@ -489,7 +489,7 @@ function erp_showplot_ui(fig) % create legend tickmark % if ~isempty(xtick_template) - lxtick_hdl = copyobj(xtick_template, ha); + lxtick_hdl = copyobj_legacy(xtick_template, ha); for j=1:size(lxtick_hdl,1) % for all the components on xtick set(lxtick_hdl(j), 'visible', 'on', ... 'xdata',eta*get(lxtick_hdl(j),'xdata') ... @@ -517,7 +517,7 @@ function erp_showplot_ui(fig) lxtick_hdl = []; end if ~isempty(ytick_template) - lytick_hdl = copyobj(ytick_template, ha); + lytick_hdl = copyobj_legacy(ytick_template, ha); for j=1:size(lytick_hdl,1) % for all the components on ytick set(lytick_hdl(j), 'visible', 'on', ... 'xdata',eta*get(lytick_hdl(j),'xdata') ... @@ -613,7 +613,7 @@ function erp_showplot_ui(fig) % draw sub axes % - axis_hdl(:,i) = copyobj(axis_template, ha); + axis_hdl(:,i) = copyobj_legacy(axis_template, ha); for j=1:size(axis_hdl,1) % for all the components on axis set(axis_hdl(j,i), ... @@ -622,7 +622,7 @@ function erp_showplot_ui(fig) end if ~isempty(xtick_template) - xtick_hdl(:,i) = copyobj(xtick_template, ha); + xtick_hdl(:,i) = copyobj_legacy(xtick_template, ha); for j=1:size(xtick_hdl,1) % for all the components on xtick set(xtick_hdl(j,i), ... 'xdata',eta*get(xtick_hdl(j,i),'xdata')+x(i), ... @@ -636,7 +636,7 @@ function erp_showplot_ui(fig) end if ~isempty(ytick_template) - ytick_hdl(:,i) = copyobj(ytick_template, ha); + ytick_hdl(:,i) = copyobj_legacy(ytick_template, ha); for j=1:size(ytick_hdl,1) % for all the components on ytick set(ytick_hdl(j,i), ... 'xdata',eta*get(ytick_hdl(j,i),'xdata')+x(i), ... diff --git a/plsgui/fmri_analysis_ui.m b/plsgui/fmri_analysis_ui.m index bc29c7d..90c169d 100644 --- a/plsgui/fmri_analysis_ui.m +++ b/plsgui/fmri_analysis_ui.m @@ -1109,7 +1109,7 @@ function Init() group_hdls = [g_h1, g_h2, g_h3, g_h4]; setappdata(h0,'Group_hlist',group_hdls); - group_template = copyobj(group_hdls,h0); + group_template = copyobj_legacy(group_hdls,h0); set(group_template,'visible','off','Tag','GroupUIControls'); setappdata(h0,'GroupTemplate',group_template); @@ -1178,7 +1178,7 @@ function SetupGroupRows() group_hdls = group_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_g_hdls = copyobj(group_template,gcf); + new_g_hdls = copyobj_legacy(group_template,gcf); group_hdls = [group_hdls; new_g_hdls']; end; end; @@ -1281,7 +1281,7 @@ function CreateAddRow() group_template = getappdata(gcf,'GroupTemplate'); - a_hdls = copyobj(group_template,gcf); + a_hdls = copyobj_legacy(group_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/fmri_cluster_report.m b/plsgui/fmri_cluster_report.m index 03109e8..4b18202 100644 --- a/plsgui/fmri_cluster_report.m +++ b/plsgui/fmri_cluster_report.m @@ -624,7 +624,7 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... @@ -632,21 +632,21 @@ function show_report_page(page_num), h_list = [h_list h]; if (idx==start_row | cluster_idx==1) - h = copyobj(standard_text_obj,axes_h); % lag + h = copyobj_legacy(standard_text_obj,axes_h); % lag set(h, 'String',num2str(cluster_lag-1), ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -654,7 +654,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -662,7 +662,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -672,7 +672,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -1256,7 +1256,7 @@ function save_peak_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -1292,7 +1292,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('fmri_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -1312,7 +1312,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -1342,7 +1342,7 @@ function setup_footer(), cluster_info.min_dist); parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/fmri_input_condition_ui.m b/plsgui/fmri_input_condition_ui.m index b48fb42..ff469b7 100644 --- a/plsgui/fmri_input_condition_ui.m +++ b/plsgui/fmri_input_condition_ui.m @@ -324,7 +324,7 @@ function init(old_conditions,old_condition_baseline,protected_conds) cond1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; % save handles for condition#1 setappdata(h0,'Cond_hlist',cond1_hdls); - cond_template = copyobj(cond1_hdls,h0); + cond_template = copyobj_legacy(cond1_hdls,h0); set(cond_template,'visible','off'); setappdata(h0,'ProtectedConditions',protected_conds); @@ -418,7 +418,7 @@ function SetupConditionRows() cond_hdls = cond_hdls(1:rows,:); else % add new rows to 'rows' amount for i=nr+1:rows, - new_c_hdls = copyobj(cond_template,gcf); + new_c_hdls = copyobj_legacy(cond_template,gcf); cond_hdls = [cond_hdls; new_c_hdls']; end; end @@ -426,7 +426,7 @@ function SetupConditionRows() v = 'off'; for i=1:rows % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = cond_hdls(i,:); % init label @@ -534,7 +534,7 @@ function CreateAddRow() cond_template = getappdata(gcf,'ConditionTemplate'); - a_hdls = copyobj(cond_template,gcf); + a_hdls = copyobj_legacy(cond_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/fmri_input_contrast_ui.m b/plsgui/fmri_input_contrast_ui.m index d73cef9..e7644c4 100644 --- a/plsgui/fmri_input_contrast_ui.m +++ b/plsgui/fmri_input_contrast_ui.m @@ -401,7 +401,7 @@ contrast1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; setappdata(h0,'Contrast_hlist',contrast1_hdls); - contrast_template = copyobj(contrast1_hdls,h0); + contrast_template = copyobj_legacy(contrast1_hdls,h0); for i=1:length(contrast_template), set(contrast_template(i),'visible','off','Tag', sprintf('Template%d',i)); end; @@ -466,7 +466,7 @@ function SetupContrastRows() contrast_hdls = contrast_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_c_hdls = copyobj(contrast_template,gcf); + new_c_hdls = copyobj_legacy(contrast_template,gcf); contrast_hdls = [contrast_hdls; new_c_hdls']; end; end; @@ -584,7 +584,7 @@ function CreateAddRow() contrast_template = getappdata(gcf,'ContrastTemplate'); - a_hdls = copyobj(contrast_template,gcf); + a_hdls = copyobj_legacy(contrast_template,gcf); set(a_hdls(1),'String','','Foreground',[0 0 0],'Visible','off', ... 'UserData',1); diff --git a/plsgui/fmri_input_run_ui.m b/plsgui/fmri_input_run_ui.m index ed8f280..2987274 100644 --- a/plsgui/fmri_input_run_ui.m +++ b/plsgui/fmri_input_run_ui.m @@ -602,7 +602,7 @@ function init(run_info,num_runs,conditions), % setappdata(gcf,'DataDirectory',curr); - onset_template = copyobj([t1 t2 t3],h0); + onset_template = copyobj_legacy([t1 t2 t3],h0); set(onset_template(1),'Tag','ConditionNameLabelTemplate','Visible','off'); set(onset_template(2),'Tag','EventOnsetEditTemplate','Visible','off'); set(onset_template(3),'Tag','EventOnsetLabelTemplate','Visible','off'); @@ -644,7 +644,7 @@ function SetupEventOnsetRows() onset_hdls = onset_hdls(1:rows,:); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(onset_template,gcf); + new_s_hdls = copyobj_legacy(onset_template,gcf); onset_hdls = [onset_hdls; new_s_hdls']; end; end; diff --git a/plsgui/fmri_plot_brain_corr.m b/plsgui/fmri_plot_brain_corr.m index f8bb2b3..4fb8a91 100644 --- a/plsgui/fmri_plot_brain_corr.m +++ b/plsgui/fmri_plot_brain_corr.m @@ -361,7 +361,7 @@ get_st_datamat_filename(sessionFileList, plsResultFile); make_datamat_popup(2); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); setappdata(hh,'cond_selection',cond_selection); @@ -422,7 +422,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/fmri_plot_brain_scores.m b/plsgui/fmri_plot_brain_scores.m index aa280eb..9156c00 100644 --- a/plsgui/fmri_plot_brain_scores.m +++ b/plsgui/fmri_plot_brain_scores.m @@ -314,7 +314,7 @@ get_st_datamat_filename(sessionFileList); make_datamat_popup(1); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); setappdata(hh,'cond_selection',cond_selection); @@ -408,7 +408,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/fmri_plot_scores.m b/plsgui/fmri_plot_scores.m index de3ef83..70e3023 100644 --- a/plsgui/fmri_plot_scores.m +++ b/plsgui/fmri_plot_scores.m @@ -364,7 +364,7 @@ % set(hh,'Name',sprintf('PLS Scores Plot: %s',PLSresultFile)); % end; - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); num_lv = size(b_scores,2); @@ -430,7 +430,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -658,6 +658,9 @@ function PlotBrainDesignScores() margin_y = abs((max_y - min_y) / 100); axes(ax_hdl); + +delete(ax_hdl.Legend); % LP 12.07.2018 + cla; grid off; hold on; for grp_idx = 1:num_grp @@ -793,6 +796,9 @@ function PlotDesignScores() end; axes(ax_hdl); + +delete(ax_hdl.Legend); % LP 12.07.2018 + cla;hold on; lv_idx = find(lv_state == 1); @@ -865,7 +871,7 @@ function PlotDesignScores() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -937,6 +943,7 @@ function PlotDesignLV() % ax_hdl = getappdata(gcf,'ScoreAxes_top'); axes(ax_hdl); + delete(ax_hdl.Legend); % LP 12.07.2018 cla;hold on; % num_contrasts = size(designlv,1); @@ -991,7 +998,7 @@ function PlotDesignLV() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1137,7 +1144,12 @@ function DisplayBrainDesignScores(on_off) case {'on'}, if (design_state == 1), % need to display design scores h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); set(getappdata(gcf,'ScoreAxes_top'),'Visible','on'); PlotDesignScores; @@ -1146,13 +1158,28 @@ function DisplayBrainDesignScores(on_off) PlotBrainDesignScores; else h = getappdata(gcf,'ScoreAxes_top'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes_bottom'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','on'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','on'); PlotBrainDesignScores; end; @@ -1167,17 +1194,37 @@ function DisplayBrainDesignScores(on_off) % DisplayLegend('off'); if (design_state == 1) h = getappdata(gcf,'ScoreAxes_top'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes_bottom'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','on'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','on'); PlotDesignScores; else h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); end; end; % switch @@ -1219,7 +1266,12 @@ function DisplayDesignScores(on_off) case {'on'}, if (brain_design_state == 1), % need to display brain/design scores h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); set(getappdata(gcf,'ScoreAxes_top'),'Visible','on'); PlotDesignScores; @@ -1228,13 +1280,28 @@ function DisplayDesignScores(on_off) PlotBrainDesignScores; else h = getappdata(gcf,'ScoreAxes_top'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes_bottom'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','on'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','on'); PlotDesignScores; end; @@ -1248,16 +1315,31 @@ function DisplayDesignScores(on_off) end; if (brain_design_state == 1), % need to display brain/design scores h = getappdata(gcf,'ScoreAxes_top'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes_bottom'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); set(getappdata(gcf,'ScoreAxes'),'Visible','on'); PlotBrainDesignScores; else h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); end; end; % switch @@ -1325,13 +1407,28 @@ function DisplayDesignLV(on_off) end; h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes_top'); - axes(h); cla; set(h,'Visible','on'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','on'); h = getappdata(gcf,'ScoreAxes_bottom'); - axes(h); cla; set(h,'Visible','on'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','on'); PlotDesignLV; @@ -1344,14 +1441,29 @@ function DisplayDesignLV(on_off) end; end; h = getappdata(gcf,'ScoreAxes'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); h = getappdata(gcf,'ScoreAxes_top'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); % PlotDesignScores; h = getappdata(gcf,'ScoreAxes_bottom'); - axes(h); cla; set(h,'Visible','off'); + axes(h); + try % LP 12.07.2018 + delete(h.Legend); % LP 12.07.2018 + catch + end; + cla; set(h,'Visible','off'); % PlotBrainDesignScores; end; % switch diff --git a/plsgui/fmri_plot_taskpls_bs.m b/plsgui/fmri_plot_taskpls_bs.m index 0c1cf84..9646d89 100644 --- a/plsgui/fmri_plot_taskpls_bs.m +++ b/plsgui/fmri_plot_taskpls_bs.m @@ -379,7 +379,7 @@ % set(hh,'Name',sprintf('PLS Scores Plot: %s',PLSresultFile)); % end; - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); num_lv = size(b_scores,2); @@ -445,7 +445,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -833,7 +833,7 @@ function PlotDesignScores() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -955,7 +955,7 @@ function PlotDesignLV() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1644,8 +1644,9 @@ function select_subj() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); - +% [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); % LP 27.06.2018 + [l_hdl, o_hdl] = legend(conditions,'Location','northeast'); + legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1680,7 +1681,7 @@ function select_subj() end if ~isempty(ulusc) - h2 = errorbar(range, orig_usc(range,lv_idx), llusc(range,lv_idx), ulusc(range,lv_idx), 'ok'); + h2 = errorbar(range, orig_usc(range,lv_idx), abs(llusc(range,lv_idx)), ulusc(range,lv_idx), 'ok'); end hold off; diff --git a/plsgui/fmri_pls_analysis.m b/plsgui/fmri_pls_analysis.m index 22e6bce..af2eeb9 100644 --- a/plsgui/fmri_pls_analysis.m +++ b/plsgui/fmri_pls_analysis.m @@ -887,7 +887,8 @@ function fmri_pls_analysis(varargin) while ~done try - eval(['save ''' resultFile ''' ' saved_info]); + %eval(['save ''' resultFile ''' ' saved_info]); + eval(['save ''' resultFile ''' ' saved_info ' ' '-v7.3']); done = 1; catch if findstr('BfMRIsessiondata.mat', fn) diff --git a/plsgui/get_cluster_info_pet.m b/plsgui/get_cluster_info_pet.m index 729471d..539852d 100644 --- a/plsgui/get_cluster_info_pet.m +++ b/plsgui/get_cluster_info_pet.m @@ -631,28 +631,28 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % voxel mean + h = copyobj_legacy(standard_text_obj,axes_h); % voxel mean voxel_mean_str = sprintf('%6.2f',cluster_info.voxel_means_avg(cluster_idx)); set(h, 'String',voxel_mean_str, ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -660,7 +660,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -668,7 +668,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -678,7 +678,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -1155,7 +1155,7 @@ function save_all_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -1191,7 +1191,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('pet_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -1211,7 +1211,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -1242,7 +1242,7 @@ function setup_footer(), parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/get_cluster_info_struct.m b/plsgui/get_cluster_info_struct.m index 5cddbbd..56c2eb8 100644 --- a/plsgui/get_cluster_info_struct.m +++ b/plsgui/get_cluster_info_struct.m @@ -636,28 +636,28 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % voxel mean + h = copyobj_legacy(standard_text_obj,axes_h); % voxel mean voxel_mean_str = sprintf('%6.2f',cluster_info.voxel_means_avg(cluster_idx)); set(h, 'String',voxel_mean_str, ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -665,7 +665,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -673,7 +673,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -683,7 +683,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -1160,7 +1160,7 @@ function save_all_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -1196,7 +1196,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('struct_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -1216,7 +1216,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -1247,7 +1247,7 @@ function setup_footer(), parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/pet_analysis_ui.m b/plsgui/pet_analysis_ui.m index 73cd73c..af17e8b 100644 --- a/plsgui/pet_analysis_ui.m +++ b/plsgui/pet_analysis_ui.m @@ -1128,7 +1128,7 @@ function init() group_hdls = [g_h1, g_h2, g_h3, g_h4]; setappdata(h0,'Group_hlist',group_hdls); - group_template = copyobj(group_hdls,h0); + group_template = copyobj_legacy(group_hdls,h0); set(group_template,'visible','off','Tag','GroupUIControls'); setappdata(h0,'GroupTemplate',group_template); @@ -1198,7 +1198,7 @@ function SetupGroupRows() group_hdls = group_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_g_hdls = copyobj(group_template,gcf); + new_g_hdls = copyobj_legacy(group_template,gcf); group_hdls = [group_hdls; new_g_hdls']; end; end; @@ -1312,7 +1312,7 @@ function CreateAddRow() group_template = getappdata(gcf,'GroupTemplate'); buttondown_group = 'pet_analysis_ui(''BUTTONDOWN_GROUP'');'; - a_hdls = copyobj(group_template,gcf); + a_hdls = copyobj_legacy(group_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/pet_cluster_report.m b/plsgui/pet_cluster_report.m index bcfc518..6c8af8d 100644 --- a/plsgui/pet_cluster_report.m +++ b/plsgui/pet_cluster_report.m @@ -721,28 +721,28 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % voxel mean + h = copyobj_legacy(standard_text_obj,axes_h); % voxel mean voxel_mean_str = sprintf('%6.2f',cluster_info.voxel_means_avg(cluster_idx)); set(h, 'String',voxel_mean_str, ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -750,7 +750,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -758,7 +758,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -768,7 +768,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -1268,7 +1268,7 @@ function save_all_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -1304,7 +1304,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('pet_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -1324,7 +1324,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -1355,7 +1355,7 @@ function setup_footer(), parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/pet_plot_allerr.m b/plsgui/pet_plot_allerr.m index 1931178..6dbd428 100644 --- a/plsgui/pet_plot_allerr.m +++ b/plsgui/pet_plot_allerr.m @@ -229,7 +229,7 @@ end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl4',[{l_hdl} {o_hdl}]); @@ -250,7 +250,7 @@ end end - h2 = errorbar(range, orig_corr(range,lv_idx), llcorr(range,lv_idx), ulcorr(range,lv_idx), 'ok'); + h2 = errorbar(range, orig_corr(range,lv_idx), abs(llcorr(range,lv_idx)), ulcorr(range,lv_idx), 'ok'); end diff --git a/plsgui/pet_plot_behavlv.m b/plsgui/pet_plot_behavlv.m index 6910fe6..e33bb1b 100644 --- a/plsgui/pet_plot_behavlv.m +++ b/plsgui/pet_plot_behavlv.m @@ -226,7 +226,7 @@ end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl3',[{l_hdl} {o_hdl}]); diff --git a/plsgui/pet_plot_brain_scores.m b/plsgui/pet_plot_brain_scores.m index f3c3c33..3c612e8 100644 --- a/plsgui/pet_plot_brain_scores.m +++ b/plsgui/pet_plot_brain_scores.m @@ -313,7 +313,7 @@ 'Callback','pet_plot_cond_stim_ui(''CHANGE_PLOT_DIMS'');'); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); setappdata(hh,'result_file',plsResultFile); @@ -399,7 +399,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/pet_plot_cond_stim_ui.m b/plsgui/pet_plot_cond_stim_ui.m index a95f5e9..8a628e7 100644 --- a/plsgui/pet_plot_cond_stim_ui.m +++ b/plsgui/pet_plot_cond_stim_ui.m @@ -368,7 +368,7 @@ function plot_stims(start_cond,start_stim) end; % create a new legend, and save the handles -% [l_hdl, o_hdl] = legend(subj_name, 0); +% [l_hdl, o_hdl] = legend(subj_name, 'Location', 'northeast'); % legend_txt(o_hdl); % set(l_hdl,'color',[0.9 1 0.9]); % setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -464,7 +464,7 @@ function plot_stims(start_cond,start_stim) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -484,7 +484,7 @@ function plot_stims(start_cond,start_stim) end; if ~isempty(st_data.ulcorr) - h2=errorbar(1:length(llcorr), orig_corr(mask), llcorr(mask), ulcorr(mask), 'ok'); + h2=errorbar(1:length(llcorr), orig_corr(mask), abs(llcorr(mask)), ulcorr(mask), 'ok'); end hold off; diff --git a/plsgui/pet_plot_rf.m b/plsgui/pet_plot_rf.m index bfa93e9..b7d362b 100644 --- a/plsgui/pet_plot_rf.m +++ b/plsgui/pet_plot_rf.m @@ -1051,7 +1051,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1602,7 +1602,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1629,7 +1629,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, behavname, 0); + [l_hdl, o_hdl] = legend(intensity_legend, behavname, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/pet_plot_rf_task.m b/plsgui/pet_plot_rf_task.m index 9ccfd54..77f5136 100644 --- a/plsgui/pet_plot_rf_task.m +++ b/plsgui/pet_plot_rf_task.m @@ -1325,7 +1325,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1908,7 +1908,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1935,7 +1935,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, behavname, 0); + [l_hdl, o_hdl] = legend(intensity_legend, behavname, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -2335,7 +2335,7 @@ function plot_response_fn_resid() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/pet_plot_scores_ui.m b/plsgui/pet_plot_scores_ui.m index 6357ff8..4b4b149 100644 --- a/plsgui/pet_plot_scores_ui.m +++ b/plsgui/pet_plot_scores_ui.m @@ -412,7 +412,7 @@ 'String','', ... 'Tag','MessageLine'); - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); curr_lv_state = zeros(1,num_lv); curr_lv_state(1) = 1; @@ -484,7 +484,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -665,7 +665,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -802,7 +802,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -950,7 +950,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1673,7 +1673,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1685,7 +1685,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1703,7 +1703,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1715,7 +1715,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1733,7 +1733,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1745,7 +1745,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1964,7 +1964,7 @@ function select_subj() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl3',[{l_hdl} {o_hdl}]); diff --git a/plsgui/pet_plot_taskpls_bs.m b/plsgui/pet_plot_taskpls_bs.m index 67313cd..fd9619a 100644 --- a/plsgui/pet_plot_taskpls_bs.m +++ b/plsgui/pet_plot_taskpls_bs.m @@ -411,7 +411,7 @@ 'String','', ... 'Tag','MessageLine'); - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); curr_lv_state = zeros(1,num_lv); curr_lv_state(1) = 1; @@ -483,7 +483,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -666,7 +666,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -798,7 +798,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -942,7 +942,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1675,7 +1675,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1687,7 +1687,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1705,7 +1705,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1717,7 +1717,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1735,7 +1735,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1747,7 +1747,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1961,7 +1961,7 @@ function select_subj() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2112,7 +2112,7 @@ function SelectLV(selected_lv) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2147,7 +2147,7 @@ function SelectLV(selected_lv) end if ~isempty(ulusc) - h2 = errorbar(range, orig_usc(range,lv_idx), llusc(range,lv_idx), ulusc(range,lv_idx), 'ok'); + h2 = errorbar(range, orig_usc(range,lv_idx), abs(llusc(range,lv_idx)), ulusc(range,lv_idx), 'ok'); end hold off; diff --git a/plsgui/rri_create_fig_3v.m b/plsgui/rri_create_fig_3v.m index 4409ffa..04bbb86 100644 --- a/plsgui/rri_create_fig_3v.m +++ b/plsgui/rri_create_fig_3v.m @@ -23,7 +23,7 @@ set(nii_view.handles.cbarminmax_axes, 'visible', 'off'); set(nii_view.handles.cbar_axes, 'visible', 'off'); - cbar_hdl = copyobj(getappdata(old_fig,'Colorbar'), s.fig); + cbar_hdl = copyobj_legacy(getappdata(old_fig,'Colorbar'), s.fig); set(cbar_hdl,'pos',get(nii_view.handles.cbar_axes,'pos')); return; @@ -72,7 +72,7 @@ 'colormap', get(old_fig, 'colormap'), ... 'name', get(old_fig, 'name')); - ax_hdl = copyobj([nii_view.handles.axial_axes, nii_view.handles.coronal_axes, ... + ax_hdl = copyobj_legacy([nii_view.handles.axial_axes, nii_view.handles.coronal_axes, ... nii_view.handles.sagittal_axes], new_fig); set(ax_hdl(1), 'position', axial_ax_pos); diff --git a/plsgui/rri_file_menu.m b/plsgui/rri_file_menu.m index cf0f701..0e85fd2 100644 --- a/plsgui/rri_file_menu.m +++ b/plsgui/rri_file_menu.m @@ -12,7 +12,7 @@ function rri_file_menu(action, varargin) - if isnumeric(action) + if isnumeric(action) || isgraphics(action) fig = action; action = 'init'; end diff --git a/plsgui/rri_getsubject_ui.m b/plsgui/rri_getsubject_ui.m index dba6f1b..cf11e04 100644 --- a/plsgui/rri_getsubject_ui.m +++ b/plsgui/rri_getsubject_ui.m @@ -500,7 +500,7 @@ function init(condition, selected_conditions, old_dir, ... imgfile1_hdls = [c_h1,c_h2,c_h3,c_h4]; % save handles for the 1st one setappdata(h0,'imgfile_hlist', imgfile1_hdls); - imgfile_template = copyobj(imgfile1_hdls,h0); + imgfile_template = copyobj_legacy(imgfile1_hdls,h0); set(imgfile_template, 'visible', 'off'); setappdata(h0,'imgfile_template', imgfile_template); setappdata(h0,'saved_map',{}); % init saved subj map list @@ -808,7 +808,7 @@ function SetupConditionRows() imgfile_hdls = imgfile_hdls(1:rows, :); else % add new rows for i = nr + 1:rows - new_c_hdls = copyobj(imgfile_template, gcf); + new_c_hdls = copyobj_legacy(imgfile_template, gcf); imgfile_hdls = [imgfile_hdls; new_c_hdls']; % stack imgfile_hdls end end @@ -819,7 +819,7 @@ function SetupConditionRows() % take out the handle list created above, and use it % in the following 'idx,name,colon,combo'. % those handles are valid, since they are all obtained - % from function copyobj() above. + % from function copyobj_legacy() above. % new_c_hdls = imgfile_hdls(i,:); diff --git a/plsgui/rri_input_condition_ui.m b/plsgui/rri_input_condition_ui.m index ee4b067..5be4bea 100644 --- a/plsgui/rri_input_condition_ui.m +++ b/plsgui/rri_input_condition_ui.m @@ -250,7 +250,7 @@ function init(old_conditions, old_subj_files) cond1_hdls = [c_h1,c_h2,c_h3]; % save handles for condition#1 setappdata(h0,'Cond_hlist',cond1_hdls); - cond_template = copyobj(cond1_hdls,h0); + cond_template = copyobj_legacy(cond1_hdls,h0); set(cond_template,'visible','off'); setappdata(h0,'OldConditions',old_conditions); @@ -343,7 +343,7 @@ function SetupConditionRows() cond_hdls = cond_hdls(1:rows,:); else % add new rows to 'rows' amount for i=nr+1:rows, - new_c_hdls = copyobj(cond_template,gcf); + new_c_hdls = copyobj_legacy(cond_template,gcf); cond_hdls = [cond_hdls; new_c_hdls']; end; end @@ -351,7 +351,7 @@ function SetupConditionRows() v = 'off'; for i=1:rows % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = cond_hdls(i,:); % init label @@ -433,7 +433,7 @@ function CreateAddRow() cond_template = getappdata(gcf,'ConditionTemplate'); - a_hdls = copyobj(cond_template,gcf); + a_hdls = copyobj_legacy(cond_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/rri_input_contrast_ui.m b/plsgui/rri_input_contrast_ui.m index 3dd781e..ec99edb 100644 --- a/plsgui/rri_input_contrast_ui.m +++ b/plsgui/rri_input_contrast_ui.m @@ -595,7 +595,7 @@ contrast1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; setappdata(h0,'Contrast_hlist',contrast1_hdls); - contrast_template = copyobj(contrast1_hdls,h0); + contrast_template = copyobj_legacy(contrast1_hdls,h0); for i=1:length(contrast_template), set(contrast_template(i),'visible','off','Tag', sprintf('Template%d',i)); end; @@ -667,7 +667,7 @@ function SetupContrastRows() contrast_hdls = contrast_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_c_hdls = copyobj(contrast_template,gcf); + new_c_hdls = copyobj_legacy(contrast_template,gcf); contrast_hdls = [contrast_hdls; new_c_hdls']; end; end; @@ -793,7 +793,7 @@ function CreateAddRow() contrast_template = getappdata(gcf,'ContrastTemplate'); - a_hdls = copyobj(contrast_template,gcf); + a_hdls = copyobj_legacy(contrast_template,gcf); set(a_hdls(1),'String','','Foreground',[0 0 0],'Visible','off', ... 'UserData',1); diff --git a/plsgui/rri_input_subject_ui.m b/plsgui/rri_input_subject_ui.m index 2603000..4b74d67 100644 --- a/plsgui/rri_input_subject_ui.m +++ b/plsgui/rri_input_subject_ui.m @@ -344,7 +344,7 @@ function init(old_subjects, num_subj_init, filter) subj1_hdls = [c_h1,c_h2,c_h3,c_h4]; % save handles for subject#1 setappdata(h0,'Subj_hlist',subj1_hdls); - subj_template = copyobj(subj1_hdls,h0); + subj_template = copyobj_legacy(subj1_hdls,h0); set(subj_template,'visible','off'); setappdata(h0,'OldSubjects',old_subjects); @@ -398,7 +398,7 @@ function SetupSubjectRows() subj_hdls = subj_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_c_hdls = copyobj(subj_template,gcf); + new_c_hdls = copyobj_legacy(subj_template,gcf); subj_hdls = [subj_hdls; new_c_hdls']; end; end; @@ -406,7 +406,7 @@ function SetupSubjectRows() v = 'Off'; for i=1:rows, % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = subj_hdls(i,:); % init label @@ -508,7 +508,7 @@ function CreateAddRow() subj_template = getappdata(gcf,'SubjectTemplate'); buttondown_subject = 'rri_input_subject_ui(''BUTTONDOWN_SUBJECTS'');'; - a_hdls = copyobj(subj_template,gcf); + a_hdls = copyobj_legacy(subj_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/rri_txtbox.m b/plsgui/rri_txtbox.m index 26407e7..42169ba 100644 --- a/plsgui/rri_txtbox.m +++ b/plsgui/rri_txtbox.m @@ -116,7 +116,6 @@ 'FontWeight', fntweight, ... 'FontSize', fnt, ... 'box','on', ... - 'drawmode','fast', ... 'nextplot','add', ... 'xtick', [-1], ... 'ytick', [-1], ... @@ -125,6 +124,13 @@ 'tag','rri_txtbox', ... 'position', pos); + % to avoid "The DrawMode property will be removed in a future release" warning in R2014b + if verLessThan('matlab', '8.4.0') % R2014b + set(txtbox_hdl,'drawmode', 'fast'); + else + set(txtbox_hdl,'sortmethod', 'childorder'); + end + if ishandle(varargin{1}) items = (nargin-1)/2; for i=1:items diff --git a/plsgui/selectafile.m b/plsgui/selectafile.m index 3bb529d..6a55620 100644 --- a/plsgui/selectafile.m +++ b/plsgui/selectafile.m @@ -482,6 +482,7 @@ function EditFilter() try load('pls_profile'); + pls_profile = which('pls_profile.mat'); selectafile_pos = get(gcbf,'position'); diff --git a/plsgui/show_cluster_info_fmri.m b/plsgui/show_cluster_info_fmri.m index 74fa278..b5cb129 100644 --- a/plsgui/show_cluster_info_fmri.m +++ b/plsgui/show_cluster_info_fmri.m @@ -96,7 +96,7 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... @@ -104,21 +104,21 @@ function show_report_page(page_num), h_list = [h_list h]; if (idx==start_row | cluster_idx==1) - h = copyobj(standard_text_obj,axes_h); % lag + h = copyobj_legacy(standard_text_obj,axes_h); % lag set(h, 'String',num2str(cluster_lag-1), ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -126,7 +126,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -134,7 +134,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -144,7 +144,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -685,7 +685,7 @@ function save_peak_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -721,7 +721,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('fmri_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -741,7 +741,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -771,7 +771,7 @@ function setup_footer(), cluster_info.min_dist); parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/show_cluster_info_pet.m b/plsgui/show_cluster_info_pet.m index e2392c8..8f4de86 100644 --- a/plsgui/show_cluster_info_pet.m +++ b/plsgui/show_cluster_info_pet.m @@ -96,28 +96,28 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % voxel mean + h = copyobj_legacy(standard_text_obj,axes_h); % voxel mean voxel_mean_str = sprintf('%6.2f',cluster_info.voxel_means_avg(cluster_idx)); set(h, 'String',voxel_mean_str, ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -125,7 +125,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -133,7 +133,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -143,7 +143,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -604,7 +604,7 @@ function save_all_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -640,7 +640,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('pet_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -660,7 +660,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -691,7 +691,7 @@ function setup_footer(), parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/show_cluster_info_struct.m b/plsgui/show_cluster_info_struct.m index 62c7e4a..68554ad 100644 --- a/plsgui/show_cluster_info_struct.m +++ b/plsgui/show_cluster_info_struct.m @@ -96,28 +96,28 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % voxel mean + h = copyobj_legacy(standard_text_obj,axes_h); % voxel mean voxel_mean_str = sprintf('%6.2f',cluster_info.voxel_means_avg(cluster_idx)); set(h, 'String',voxel_mean_str, ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -125,7 +125,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -133,7 +133,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -143,7 +143,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -604,7 +604,7 @@ function save_all_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -640,7 +640,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('struct_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -660,7 +660,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -691,7 +691,7 @@ function setup_footer(), parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/smallfc_analysis_ui.m b/plsgui/smallfc_analysis_ui.m index dc0bbb4..3dbafa4 100644 --- a/plsgui/smallfc_analysis_ui.m +++ b/plsgui/smallfc_analysis_ui.m @@ -1122,7 +1122,7 @@ function init() group_hdls = [g_h1, g_h2, g_h3, g_h4]; setappdata(h0,'Group_hlist',group_hdls); - group_template = copyobj(group_hdls,h0); + group_template = copyobj_legacy(group_hdls,h0); set(group_template,'visible','off','Tag','GroupUIControls'); setappdata(h0,'GroupTemplate',group_template); @@ -1179,7 +1179,7 @@ function SetupGroupRows() group_hdls = group_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_g_hdls = copyobj(group_template,gcf); + new_g_hdls = copyobj_legacy(group_template,gcf); group_hdls = [group_hdls; new_g_hdls']; end; end; @@ -1293,7 +1293,7 @@ function CreateAddRow() group_template = getappdata(gcf,'GroupTemplate'); buttondown_group = 'smallfc_analysis_ui(''BUTTONDOWN_GROUP'');'; - a_hdls = copyobj(group_template,gcf); + a_hdls = copyobj_legacy(group_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','on', ... 'UserData',1); % empty string diff --git a/plsgui/smallfc_plot_taskpls_bs.m b/plsgui/smallfc_plot_taskpls_bs.m index 47c5a34..6bf87ce 100644 --- a/plsgui/smallfc_plot_taskpls_bs.m +++ b/plsgui/smallfc_plot_taskpls_bs.m @@ -407,7 +407,7 @@ 'String','', ... 'Tag','MessageLine'); - lv_template = copyobj(lv_h,gcf); + lv_template = copyobj_legacy(lv_h,gcf); set(lv_template,'Tag','LVTemplate','Visible','off'); curr_lv_state = zeros(1,num_lv); curr_lv_state(1) = 1; @@ -479,7 +479,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; @@ -662,7 +662,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -794,7 +794,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -938,7 +938,7 @@ function MoveSlider() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1645,7 +1645,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1657,7 +1657,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1675,7 +1675,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1687,7 +1687,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl2',[{l_hdl} {o_hdl}]); @@ -1705,7 +1705,7 @@ function delete_fig(), legend_state = get(findobj(h0,'Tag','LegendMenu'),'Userdata'); axes(axis_old); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h0, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1717,7 +1717,7 @@ function delete_fig(), figure(h01) axes(axis_new); - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(h01, 'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -1931,7 +1931,7 @@ function select_subj() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcbf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2082,7 +2082,7 @@ function SelectLV(selected_lv) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(conditions, 0); + [l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]); @@ -2117,7 +2117,7 @@ function SelectLV(selected_lv) end if ~isempty(ulusc) - h2 = errorbar(range, orig_usc(range,lv_idx), llusc(range,lv_idx), ulusc(range,lv_idx), 'ok'); + h2 = errorbar(range, orig_usc(range,lv_idx), abs(llusc(range,lv_idx)), ulusc(range,lv_idx), 'ok'); end hold off; diff --git a/plsgui/ssb_bfm_plot_rf_task.m b/plsgui/ssb_bfm_plot_rf_task.m index 9f4b36f..e0be07b 100644 --- a/plsgui/ssb_bfm_plot_rf_task.m +++ b/plsgui/ssb_bfm_plot_rf_task.m @@ -1265,7 +1265,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1749,7 +1749,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -2532,7 +2532,7 @@ function plot_response_fn_resid() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/ssb_pet_plot_cond_stim_ui.m b/plsgui/ssb_pet_plot_cond_stim_ui.m index 9db5e7b..f8bffb7 100644 --- a/plsgui/ssb_pet_plot_cond_stim_ui.m +++ b/plsgui/ssb_pet_plot_cond_stim_ui.m @@ -371,7 +371,7 @@ function plot_stims(start_cond,start_stim) end; % create a new legend, and save the handles -% [l_hdl, o_hdl] = legend(subj_name, 0); +% [l_hdl, o_hdl] = legend(subj_name, 'Location', 'northeast'); % legend_txt(o_hdl); % set(l_hdl,'color',[0.9 1 0.9]); % setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -467,7 +467,7 @@ function plot_stims(start_cond,start_stim) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -487,7 +487,7 @@ function plot_stims(start_cond,start_stim) end; if ~isempty(st_data.ulcorr) - h2=errorbar(1:length(llcorr), orig_corr(mask), llcorr(mask), ulcorr(mask), 'ok'); + h2=errorbar(1:length(llcorr), orig_corr(mask), abs(llcorr(mask)), ulcorr(mask), 'ok'); end hold off; diff --git a/plsgui/struct_analysis_ui.m b/plsgui/struct_analysis_ui.m index 3e3f5c0..67b9a02 100644 --- a/plsgui/struct_analysis_ui.m +++ b/plsgui/struct_analysis_ui.m @@ -1127,7 +1127,7 @@ function init() group_hdls = [g_h1, g_h2, g_h3, g_h4]; setappdata(h0,'Group_hlist',group_hdls); - group_template = copyobj(group_hdls,h0); + group_template = copyobj_legacy(group_hdls,h0); set(group_template,'visible','off','Tag','GroupUIControls'); setappdata(h0,'GroupTemplate',group_template); @@ -1197,7 +1197,7 @@ function SetupGroupRows() group_hdls = group_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_g_hdls = copyobj(group_template,gcf); + new_g_hdls = copyobj_legacy(group_template,gcf); group_hdls = [group_hdls; new_g_hdls']; end; end; @@ -1311,7 +1311,7 @@ function CreateAddRow() group_template = getappdata(gcf,'GroupTemplate'); buttondown_group = 'struct_analysis_ui(''BUTTONDOWN_GROUP'');'; - a_hdls = copyobj(group_template,gcf); + a_hdls = copyobj_legacy(group_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/struct_cluster_report.m b/plsgui/struct_cluster_report.m index 718afe6..bb4211f 100644 --- a/plsgui/struct_cluster_report.m +++ b/plsgui/struct_cluster_report.m @@ -724,28 +724,28 @@ function show_report_page(page_num), cluster_idx = cluster_data_idx(3,idx); c_data = cluster_info.data{cluster_lag}; - h = copyobj(standard_text_obj,axes_h); % cluster # + h = copyobj_legacy(standard_text_obj,axes_h); % cluster # cluster_num = sprintf('%3d',cluster_id); set(h, 'String',cluster_num, ... 'Position',[h_pos(1) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % voxel mean + h = copyobj_legacy(standard_text_obj,axes_h); % voxel mean voxel_mean_str = sprintf('%6.2f',cluster_info.voxel_means_avg(cluster_idx)); set(h, 'String',voxel_mean_str, ... 'Position',[h_pos(2) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak xyz + h = copyobj_legacy(standard_text_obj,axes_h); % peak xyz peak_xyz_str = sprintf('[%3d %3d %3d]',c_data.peak_xyz(cluster_idx,:)); set(h, 'String',peak_xyz_str, ... 'Position',[h_pos(3) v_pos(v_idx) 0], ... 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak loc + h = copyobj_legacy(standard_text_obj,axes_h); % peak loc peak_loc_str = sprintf('[%6.1f %6.1f %6.1f]', ... c_data.peak_loc(cluster_idx,:)); set(h, 'String',peak_loc_str, ... @@ -753,7 +753,7 @@ function show_report_page(page_num), 'Visible','on'); h_list = [h_list h]; - h = copyobj(standard_text_obj,axes_h); % peak value + h = copyobj_legacy(standard_text_obj,axes_h); % peak value peak_value_str = sprintf('%8.4f',c_data.peak_values(cluster_idx)); set(h, 'String',peak_value_str, ... 'Position',[h_pos(5) v_pos(v_idx) 0], ... @@ -761,7 +761,7 @@ function show_report_page(page_num), h_list = [h_list h]; if (h_pvalue_pos ~= 0) - h = copyobj(standard_text_obj,axes_h); % P value + h = copyobj_legacy(standard_text_obj,axes_h); % P value p_value = ratio2p(abs(c_data.peak_values(cluster_idx)), ... 0,1 ); p_value_str = sprintf('(%6.4f)',p_value); @@ -771,7 +771,7 @@ function show_report_page(page_num), h_list = [h_list h]; end; - h = copyobj(standard_text_obj,axes_h); % cluster size + h = copyobj_legacy(standard_text_obj,axes_h); % cluster size size_str = sprintf('%4d',c_data.size(cluster_idx)); set(h, 'String',size_str, ... 'Position',[h_pos(6) v_pos(v_idx) 0], ... @@ -1271,7 +1271,7 @@ function save_all_location() str_field = 1; pos_field = 2; type_field = 3; for i=1:length(header_text), if (header_text{i}{type_field}<0 | report_type==header_text{i}{type_field}) - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); text_pos = header_text{i}{pos_field}; text_pos(2) = total_height - text_pos(2); % text pos=[x height-y z] set(h,'String', header_text{i}{str_field}, ... @@ -1307,7 +1307,7 @@ function setup_footer(), str_field = 1; pos_field = 2; tag_field = 3; for i=1:length(key_text), - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); bd_fn = sprintf('struct_cluster_report(''%s'');',key_text{i}{tag_field}); set(h,'String', key_text{i}{str_field}, ... 'Position',key_text{i}{pos_field}, ... @@ -1327,7 +1327,7 @@ function setup_footer(), source_line = sprintf('Source: %s',source_file); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); x = 0.03; y = 0.08; @@ -1358,7 +1358,7 @@ function setup_footer(), parameters_line = sprintf('%s, %s, %s, %s\n%s, %s, %s', ... lv_str,thresh_str,thresh_str2,min_size_str,peak_thresh_str,peak_thresh_str2,min_dist_str); - h = copyobj(standard_text_obj,axes_h); + h = copyobj_legacy(standard_text_obj,axes_h); y = 0.05; diff --git a/plsgui/struct_input_condition_ui.m b/plsgui/struct_input_condition_ui.m index 1c9c0a4..1fd3cd9 100644 --- a/plsgui/struct_input_condition_ui.m +++ b/plsgui/struct_input_condition_ui.m @@ -276,7 +276,7 @@ function init(old_conditions, old_cond_filter, old_subj_files) cond1_hdls = [c_h1,c_h2,c_h3,c_h4]; % save handles for condition#1 setappdata(h0,'Cond_hlist',cond1_hdls); - cond_template = copyobj(cond1_hdls,h0); + cond_template = copyobj_legacy(cond1_hdls,h0); set(cond_template,'visible','off'); setappdata(h0,'OldConditions',old_conditions); @@ -417,7 +417,7 @@ function SetupConditionRows() cond_hdls = cond_hdls(1:rows,:); else % add new rows to 'rows' amount for i=nr+1:rows, - new_c_hdls = copyobj(cond_template,gcf); + new_c_hdls = copyobj_legacy(cond_template,gcf); cond_hdls = [cond_hdls; new_c_hdls']; end; end @@ -425,7 +425,7 @@ function SetupConditionRows() v = 'off'; for i=1:rows % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = cond_hdls(i,:); % init label @@ -514,7 +514,7 @@ function CreateAddRow() cond_template = getappdata(gcf,'ConditionTemplate'); - a_hdls = copyobj(cond_template,gcf); + a_hdls = copyobj_legacy(cond_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/struct_input_subject_ui.m b/plsgui/struct_input_subject_ui.m index 6e6a037..52cac25 100644 --- a/plsgui/struct_input_subject_ui.m +++ b/plsgui/struct_input_subject_ui.m @@ -329,7 +329,7 @@ function init(old_subj_name, old_subjects, num_subj_init, filter, cond_filter, d subj1_hdls = [c_h1,c_h2,c_h3,c_h4]; % save handles for subject#1 setappdata(h0,'Subj_hlist',subj1_hdls); - subj_template = copyobj(subj1_hdls,h0); + subj_template = copyobj_legacy(subj1_hdls,h0); set(subj_template,'visible','off'); setappdata(h0,'old_subj_name',old_subj_name); @@ -388,7 +388,7 @@ function SetupSubjectRows() subj_hdls = subj_hdls(1:rows,:); else % add new rows for i=nr+1:rows, - new_c_hdls = copyobj(subj_template,gcf); + new_c_hdls = copyobj_legacy(subj_template,gcf); subj_hdls = [subj_hdls; new_c_hdls']; end; end; @@ -396,7 +396,7 @@ function SetupSubjectRows() v = 'Off'; for i=1:rows, % take out the handle list created above, and use it in the following 'label,edit,delete'. - % those handles are valid, since they are all obtained from function copyobj() above. + % those handles are valid, since they are all obtained from function copyobj_legacy() above. new_c_hdls = subj_hdls(i,:); % init label @@ -499,7 +499,7 @@ function CreateAddRow() subj_template = getappdata(gcf,'SubjectTemplate'); buttondown_subject = 'struct_input_subject_ui(''BUTTONDOWN_SUBJECTS'');'; - a_hdls = copyobj(subj_template,gcf); + a_hdls = copyobj_legacy(subj_template,gcf); set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ... 'UserData',1); diff --git a/plsgui/struct_plot_brain_scores.m b/plsgui/struct_plot_brain_scores.m index 24ec206..fe3e9c7 100644 --- a/plsgui/struct_plot_brain_scores.m +++ b/plsgui/struct_plot_brain_scores.m @@ -308,7 +308,7 @@ 'Callback','pet_plot_cond_stim_ui(''CHANGE_PLOT_DIMS'');'); - lv_template = copyobj(lv_h,hh); + lv_template = copyobj_legacy(lv_h,hh); set(lv_template,'Tag','LVTemplate','Visible','off'); setappdata(hh,'result_file',plsResultFile); @@ -394,7 +394,7 @@ function SetupLVButtonRows() lv_hdls = lv_hdls(1:rows); else % add more rows for i=nr+1:rows, - new_s_hdls = copyobj(lv_template,gcf); + new_s_hdls = copyobj_legacy(lv_template,gcf); lv_hdls = [lv_hdls; new_s_hdls']; end; end; diff --git a/plsgui/struct_plot_rf.m b/plsgui/struct_plot_rf.m index 5d7bd3e..4155e17 100644 --- a/plsgui/struct_plot_rf.m +++ b/plsgui/struct_plot_rf.m @@ -1058,7 +1058,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1609,7 +1609,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1636,7 +1636,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, behavname, 0); + [l_hdl, o_hdl] = legend(intensity_legend, behavname, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); diff --git a/plsgui/struct_plot_rf_task.m b/plsgui/struct_plot_rf_task.m index 4865e89..e195ded 100644 --- a/plsgui/struct_plot_rf_task.m +++ b/plsgui/struct_plot_rf_task.m @@ -1338,7 +1338,7 @@ function plot_response_fn() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1921,7 +1921,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(cond_name, 0); + [l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -1948,7 +1948,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin) end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, behavname, 0); + [l_hdl, o_hdl] = legend(intensity_legend, behavname, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]); @@ -2356,7 +2356,7 @@ function plot_response_fn_resid() end; % create a new legend, and save the handles - [l_hdl, o_hdl] = legend(intensity_legend, subjects, 0); + [l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast'); legend_txt(o_hdl); set(l_hdl,'color',[0.9 1 0.9]); setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]);