-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathLoadGUI.m
76 lines (59 loc) · 1.95 KB
/
LoadGUI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% LoadGUI
% manually check that directories are correct in 'FishExplorer2\dir setup'
clear all;close all;clc
% path(pathdef);
%%
% scriptName = mfilename('fullpath');
% [currentpath, filename, fileextension]= fileparts(scriptName);
% code_dir = currentpath;
%% setup dir
file_masterdir = 'C:\Users\Xiu\Dropbox (Personal)';
if ~exist(file_masterdir,'dir')
file_masterdir = 'C:\Users\xiuye\Dropbox';
end
code_dir = fullfile(file_masterdir,'FishExplorer2');
% SET CUSTOM PATH example:
% code_dir = 'C:\Users\xiuye\Dropbox\FishExplorer-master';
addpath(genpath(code_dir));
cd(code_dir)
%% setup
global VAR; %#ok<NUSED>
load_dir = GetOutputDataDir();
load(fullfile(load_dir,'VAR_new.mat'),'VAR'); % stores all clustering indices
VAR = CompileVARnames(VAR);
set(0, 'defaultUicontrolFontName', 'Arial');
set(0, 'defaultUitableFontName', 'Arial');
set(0, 'defaultUipanelFontName', 'Arial');
set(0, 'defaultAxesFontName', 'Arial');
set(0, 'defaultTextFontName', 'Arial');
%% Start GUI
% Run this, or press F5 in 'GUI_FishExplorer.m'
[hGUI,fcns] = GUI_FishExplorer;
% to push new functions to GUI, called with function 'push_cIX_gIX':
% hfig = GUI_FishExplorer(data_dir,name_CONSTs,name_MASKs,VAR,flag_script,var_script)
%%
% to get handle of local functions from GUI to use in workspace
% (call by using 'f.FunctionName')
f = [];
for i = 1:length(fcns),
eval(['f.' char(fcns{i}) ' = fcns{i};']);
end
%%
% to recover after closing figure:
% global EXPORT_autorecover;
%% demo: load data without visualizaing in GUI (only using same infrastructure)
if false,
%%
h0 = figure;
InitializeAppData(h0);
i_fish = 3;
[cIX,gIX,M,stim,behavior,M_0] = LoadSingleFishDefault(i_fish,h0);
figure('Position',[50,100,800,1000]);
I = LoadCurrentFishForAnatPlot(h0);
DrawCellsOnAnat(I);
% filename = fullfile(saveDir, num2str(i_fish));
% saveas(gcf, filename, 'png');
end
%%
% MASKs = getappdata(hGUI,'MASKs');
% Masks = MASKs.MaskDatabaseNames';