1d0d6061924799f3b434e968b09c6cc75bdc2f9e
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) 
Christoph Budziszewski moving things to private, s...

Christoph Budziszewski authored 15 years ago

6)     % DELETE THIS when Project chooser is ready
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

7)  
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

64)     createLabel(pSubject,[0.68*frameWidth firstRow*2  0.25*frameWidth controlElementHeight],'Smooth Data');
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

65)     model.chkSmoothed     = uicontrol(pSubject,'Style','checkbox','Position',[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'Value',DEFAULT.smoothed);
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

66) 
67)     createLabel(pSubject,[0.68*frameWidth firstRow*4  0.25*frameWidth controlElementHeight],'Crossvalidation');
68)     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

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

Christoph Budziszewski authored 15 years ago

91)     model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pststart);
92)     model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pstend);
93)     model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselinestart);
94)     model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselineend);
95)     model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftstart);
96)     model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftend);
97)     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

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

Christoph Budziszewski authored 15 years ago

108)     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

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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