diff --git a/@Sources2D/Sources2D.m b/@Sources2D/Sources2D.m index ef48481..2d8693f 100644 --- a/@Sources2D/Sources2D.m +++ b/@Sources2D/Sources2D.m @@ -115,6 +115,14 @@ function plotComponents(obj, Y, Cn) view_components(Y, obj.A, obj.C, obj.b, obj.f, Cn, obj.options); end + %% plot components GUI + function plotComponentsGUI(obj, Y, Cn) + if ~exist('Cn', 'var') + Cn = []; + end + plot_components_GUI(Y,obj.A,obj.C,obj.b,obj.f,Cn,obj.options) + end + %% make movie function makePatchVideo(obj, Y) make_patch_video(obj.A, obj.C, obj.b, obj.f, Y, obj.Coor,... diff --git a/demo_script.m b/demo_script.m index 860694b..2872070 100644 --- a/demo_script.m +++ b/demo_script.m @@ -44,8 +44,7 @@ scatter(center(:,2),center(:,1),'mo'); title('Center of ROIs found from initialization algorithm'); drawnow; -%% refine components manually -% new_centers=manually_refine_components(center,Cn); + %% update spatial components Yr = reshape(Y,d,T); clear Y; @@ -93,6 +92,7 @@ %savejson('jmesh',json_file,'filename'); % optional save json file with component coordinates (requires matlab json library) %% plot_components_GUI(Yr,A_or,C_or,b2,f2,Cn,options) +pause; %% make movie make_patch_video(A_or,C_or,b2,f2,Yr,Coor,options) diff --git a/demo_script_class.m b/demo_script_class.m index d74fae7..7c6a9fa 100644 --- a/demo_script_class.m +++ b/demo_script_class.m @@ -93,7 +93,7 @@ [json_file] = viewContours(obj, Cn, contour_threshold, 1); pause; %savejson('jmesh',json_file,'filename'); % optional save json file with component coordinates (requires matlab json library) -plotComponents(obj, Yr, Cn); % display all components +plotComponentsGUI(obj, Yr, Cn); % display all components %% make movie -makePatchVideo(obj, Yr) +makePatchVideo(obj, Yr) \ No newline at end of file diff --git a/utilities/plot_components_GUI.m b/utilities/plot_components_GUI.m index 124f77f..7a7c8a5 100644 --- a/utilities/plot_components_GUI.m +++ b/utilities/plot_components_GUI.m @@ -93,7 +93,7 @@ function plot_components_GUI(Y,A,C,b,f,Cn,options) function surfzlim(source,callbackdata) i = source.Value; - plot_component(i) + plot_component(round(i)) % For R2014a and earlier: % i = get(source,'Value');