5af189c125f87180b6b2a3ecd4150a3849faf3a0
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

1) function main_UI(args)
2) 
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

3) %     project = args.project;
4) %     DEFAULT = project.default;
5) 
6)     % DELETE THIS
7) DEFAULT.selectedSubject = 1;
8) DEFAULT.smoothed        = 1;
9) DEFAULT.multisubject    = 'single';
10) DEFAULT.pststart        = -15;
11) DEFAULT.pstend          = 40;
12) DEFAULT.baselinestart   = -3;
13) DEFAULT.baselineend     = -1;
14) DEFAULT.frameshiftstart = -5;
15) DEFAULT.frameshiftend   = 35;
16) DEFAULT.frameshiftdur   = 0;
17) DEFAULT.classdefstring  = 'left,\t[9,11,13],\t -2 ;\nright,\t[10,12,14],\t -1;';
18) DEFAULT.voxelstring     = 'SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n';
19) DEFAULT.svmoptstring    = '-s 0 -t 0 -v 6 -c 1';
20)     % STOP DELETE HERE
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

21) 
22) %  Initialize and hide the GUI as it is being constructed.
23)     frameWidth=450;
24)     frameHeight=600;
25)     frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
26)     movegui(frame,'west'); % get this thing visible on smaller displays.
27)     
28)     set(frame,'Name','SVMCrossVal Decode Performance 4 SPM');
29)     set(frame,'NumberTitle','off');
30)     set(frame,'MenuBar','none');
31)     set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
32)     set(frame,'Resize','off');
33)     set(frame,'Units','normalize');
34)     
35)     
36)     savemenu = uimenu(frame,'Label','Save/Load');
37)     
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

38) %     model.subjectMap = SubjectRoiMapping(project);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

39)     model.subjectMap = SubjectRoiMapping;
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

40)     
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

41)     nElementRows = 24;
42)     optionLineHeight = 1.0/nElementRows;
43)     controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
44)     pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*19 frameWidth optionLineHeight*5]);
45)     pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*14 frameWidth optionLineHeight*5]); 
46)     pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*9  frameWidth optionLineHeight*5]); 
47)     pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*6]); 
48)     pSVM         = uipanel(frame,'Title','SVM Options',      'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*2]); 
49)     btnRunButton = uicontrol(frame,'Tag','run','String','run decode-performance visualiser','Position',[2 optionLineHeight*0  frameWidth controlElementHeight*1.6]);
50) 
51) 
52)     % Subject
53)     firstColumn  =  5.00;
54)     firstRow     =  1.00 * controlElementHeight;
55)     
56)     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
57)                     'Min',1, 'Max',3,...
58)                     'String',getSubjectCellList(model.subjectMap),...
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

59)                     'Value',DEFAULT.selectedSubject,...  % default selected item
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

60)                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
61)     set(model.subjectSelector,'BackgroundColor','w');
62)     
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

63)     createLabel(pSubject,[0.68*frameWidth firstRow*2  0.25*frameWidth controlElementHeight],'Smooth Data');
64)     model.txtSmoothed     = uicontrol(pSubject,'Style','checkbox','Position',[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'Value',DEFAULT.smoothed);
65) 
66)     createLabel(pSubject,[0.68*frameWidth firstRow*4  0.25*frameWidth controlElementHeight],'Crossvalidation');
67)     model.txtMultisubject = createTextField(pSubject,[0.68*frameWidth firstRow*3  0.25*frameWidth controlElementHeight],DEFAULT.multisubject);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

68)     set(model.txtMultisubject,'enable','off');
69) 
70)     % PSTH
71)     firstColumn  = 5.00;
72)     secondColumn = 0.33*frameWidth;
73)     thirdColumn  = 0.66*frameWidth;
74) %     fourthColumn = 0.84*frameWidth;
75)     
76)     firstRow    = 5.5*controlElementHeight;
77)     secondRow   = 4.5*controlElementHeight;
78)     thirdRow    = 3.5*controlElementHeight;
79)     fourthRow   = 2.5*controlElementHeight;
80)     fifthRow    = 1.0*controlElementHeight;
81)     
82)     lStart      = createLabel(pPSTH, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'Start [sec]');
83)     lEnd        = createLabel(pPSTH, [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'End [sec]');
84)     lPSTH       = createLabel(pPSTH, [firstColumn  secondRow 0.33*frameWidth controlElementHeight],'PSTH Range');
85)     lBaseline   = createLabel(pPSTH, [firstColumn  thirdRow  0.33*frameWidth controlElementHeight],'Baseline');
86)     lFrameShift = createLabel(pPSTH, [firstColumn  fourthRow 0.33*frameWidth controlElementHeight],'SVM Frame Shift');
87)     lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
88)     
89)     
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

90)     model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pststart);
91)     model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pstend);
92)     model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselinestart);
93)     model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselineend);
94)     model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftstart);
95)     model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftend);
96)     model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],DEFAULT.frameshiftdur);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

97) 
98)                 
99)     %Classes
100)     nClassRows = 6;
101)     firstColumn  = 5.00;
102)     
103)     firstRow    = (nClassRows-0.5)*controlElementHeight;
104)     secondRow   = (nClassRows-4.5)*controlElementHeight;
105) 
106)     lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

107)     model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf(DEFAULT.classdefstring));
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

108)     set(model.txtClassDef,'HorizontalAlignment','left');
109)     set(model.txtClassDef,'Max',20);
110)     set(model.txtClassDef,'Min',0);
111)     set(model.txtClassDef, 'FontName', 'FixedWidth')
112)     
113)     %Voxel
114)     nVoxelRows = 8;
115)     firstColumn  = 5.00;
116)     
117)     firstRow    = (nVoxelRows-0.5)*controlElementHeight;
118)     secondRow   = (nVoxelRows-7.5)*controlElementHeight;
119) 
120)     lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
121)     model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

122)         sprintf(DEFAULT.voxelstring));
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

123)     set(model.txtVoxelDef,'HorizontalAlignment','left');
124)     set(model.txtVoxelDef,'Max',20);
125)     set(model.txtVoxelDef,'Min',0);
126)     set(model.txtVoxelDef, 'FontName', 'FixedWidth')
127)                 
128)     % SVM
129)     firstColumn  =  5.00;
130)     firstRow     =  1.00 * controlElementHeight;
131) 
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

132)     model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],DEFAULT.svmoptstring);