Skip to content

Commit

Permalink
update demo with GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
epnev committed Feb 3, 2016
1 parent 9281f74 commit b244f52
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions @Sources2D/Sources2D.m
Original file line number Diff line number Diff line change
Expand Up @@ -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,...
Expand Down
4 changes: 2 additions & 2 deletions demo_script.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions demo_script_class.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion utilities/plot_components_GUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit b244f52

Please sign in to comment.