Christoph Budziszewski commited on 2009-03-16 21:07:46
Zeige 9 geänderte Dateien mit 45 Einfügungen und 19 Löschungen.
git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@158 83ab2cfd-5345-466c-8aeb-2b2739fb922d
| ... | ... |
@@ -3,6 +3,8 @@ function pst = calculatePST(timeline,pstopts,data) |
| 3 | 3 |
des = pstopts.des; |
| 4 | 4 |
eventList = pstopts.eventList; |
| 5 | 5 |
sessionList = pstopts.sessionList; |
| 6 |
+ col_bias_removal = pstopts.colBias; |
|
| 7 |
+ norm4SVM = pstopts.psthNorm; %Normalization method for SVM |
|
| 6 | 8 |
|
| 7 | 9 |
bstart = timeline.baselineStart; |
| 8 | 10 |
bend = timeline.baselineEnd; |
| ... | ... |
@@ -129,7 +131,7 @@ function pst = calculatePST(timeline,pstopts,data) |
| 129 | 131 |
end; |
| 130 | 132 |
|
| 131 | 133 |
%%%%COL BIAS REMOVAL, added 090110 %%%%% |
| 132 |
- col_bias_removal=1; |
|
| 134 |
+ |
|
| 133 | 135 |
if col_bias_removal |
| 134 | 136 |
|
| 135 | 137 |
for zr=1:evntrow % Event ROW |
| ... | ... |
@@ -155,8 +157,7 @@ function pst = calculatePST(timeline,pstopts,data) |
| 155 | 157 |
|
| 156 | 158 |
%%%%%%%%%%% new 090109 Axel: "Normalization" for SVM |
| 157 | 159 |
|
| 158 |
- norm4SVM='mean'; %Normalization method for SVM |
|
| 159 |
- disp(['normalization: ' norm4SVM]); |
|
| 160 |
+% disp(['normalization: ' norm4SVM]); |
|
| 160 | 161 |
% none - no normalization |
| 161 | 162 |
% mean - mean normalization (meanPSTH max at .5, baseline at -.5] |
| 162 | 163 |
% minmax - all PSTHs between [0 1] |
| ... | ... |
@@ -21,8 +21,11 @@ subjects = getSubjectCellList(model); |
| 21 | 21 |
classDef = parseClassDef(model); |
| 22 | 22 |
|
| 23 | 23 |
mask = ['^' cell2mat(getImageFileMask(model)) '.*\.img$']; |
| 24 |
-% images |
|
| 25 |
-% normalization |
|
| 24 |
+ |
|
| 25 |
+psthOpts = struct; |
|
| 26 |
+psthOpts.colBias = getColumnBiasRemoveOption(model); |
|
| 27 |
+psthOpts.psthNorm = getPsthNormalizationMethod(model); |
|
| 28 |
+ |
|
| 26 | 29 |
|
| 27 | 30 |
switch task |
| 28 | 31 |
case 'COORD' |
| ... | ... |
@@ -43,6 +46,8 @@ switch task |
| 43 | 46 |
coordargs.coords = parseCoordinateTextField(model); |
| 44 | 47 |
coordargs.mask = mask; |
| 45 | 48 |
coordargs.radius = getSearchlightRadius(model); |
| 49 |
+ coordargs.psthOpts = psthOpts; |
|
| 50 |
+ |
|
| 46 | 51 |
|
| 47 | 52 |
out.subjectdata = runCoordTable(coordargs); |
| 48 | 53 |
|
| ... | ... |
@@ -64,6 +69,7 @@ switch task |
| 64 | 69 |
roiargs.basedir = model.baseDir; |
| 65 | 70 |
roiargs.sessionList = 1:3; |
| 66 | 71 |
roiargs.eventList = classDef.eventMatrix; |
| 72 |
+ roiargs.psthOpts = psthOpts; |
|
| 67 | 73 |
|
| 68 | 74 |
out.subjectdata = runROIImageMaskMode(roiargs); |
| 69 | 75 |
|
| ... | ... |
@@ -6,6 +6,9 @@ subjects = args.subjects; |
| 6 | 6 |
|
| 7 | 7 |
nSubjects = numel(subjects); |
| 8 | 8 |
sessionlist = args.sessionList; |
| 9 |
+pstopts = args.psthOpts; |
|
| 10 |
+pstopts.eventList = args.eventList; |
|
| 11 |
+pstopts.sessionList = sessionlist; |
|
| 9 | 12 |
|
| 10 | 13 |
disp(sprintf('batch processing %g subjects.',nSubjects));
|
| 11 | 14 |
|
| ... | ... |
@@ -35,8 +38,6 @@ for s = 1:nSubjects |
| 35 | 38 |
|
| 36 | 39 |
% calculate psth |
| 37 | 40 |
pstopts.des = subjectStruct{s}.des;
|
| 38 |
- pstopts.eventList = args.eventList; |
|
| 39 |
- pstopts.sessionList = sessionlist; |
|
| 40 | 41 |
|
| 41 | 42 |
disp('computing psth');
|
| 42 | 43 |
for iVoxel = 1:nVoxel |
| ... | ... |
@@ -69,22 +69,26 @@ DEFAULT.wd = fullfile('d:','Analyze','Choice','24pilot');
|
| 69 | 69 |
model3 = createVisualStepPanel(model3,task.plot,DEFAULT); |
| 70 | 70 |
|
| 71 | 71 |
% TASK |
| 72 |
- task.taskSwitch = uipanel(frame,'Position',[0 1-0.13 1 0.10]); |
|
| 72 |
+ task.taskSwitch = uibuttongroup(frame,'Position',[0 1-0.13 1 0.10]); |
|
| 73 |
+ % controlls togglebuttons |
|
| 73 | 74 |
% set(task.taskSwitch,'Title','TASK'); |
| 74 | 75 |
set(task.taskSwitch,'BackgroundColor','w'); |
| 75 | 76 |
set(task.taskSwitch,'Units','normalized'); |
| 76 | 77 |
|
| 77 |
- btnSwitchPreprocessing = uicontrol(task.taskSwitch,'String','ImageProcessing',... |
|
| 78 |
+ btnSwitchPreprocessing = uicontrol(task.taskSwitch,'Style','pushbutton',... |
|
| 79 |
+ 'String','ImageProcessing',... |
|
| 78 | 80 |
'Units','normalized','Position',[0.0 0.0 0.33 1]); |
| 79 | 81 |
set(btnSwitchPreprocessing,'Callback',{@cbSwitchTask,'PRE',task});
|
| 80 | 82 |
set(btnSwitchPreprocessing,'Enable','on'); |
| 81 | 83 |
|
| 82 |
- btnSwitchClassify = uicontrol(task.taskSwitch,'String','Decode',... |
|
| 84 |
+ btnSwitchClassify = uicontrol(task.taskSwitch,'Style','pushbutton',... |
|
| 85 |
+ 'String','Decode',... |
|
| 83 | 86 |
'Units','normalized','Position',[0.33 0.0 0.33 1]); |
| 84 | 87 |
set(btnSwitchClassify,'Callback',{@cbSwitchTask,'CLASSIFY',task});
|
| 85 | 88 |
set(btnSwitchClassify,'Enable','on'); |
| 86 | 89 |
|
| 87 |
- btnSwitchPlot = uicontrol(task.taskSwitch,'String','Plot',... |
|
| 90 |
+ btnSwitchPlot = uicontrol(task.taskSwitch,'Style','pushbutton',... |
|
| 91 |
+ 'String','Plot',... |
|
| 88 | 92 |
'Units','normalized','Position',[0.66 0.0 0.33 1]); |
| 89 | 93 |
set(btnSwitchPlot,'Callback',{@cbSwitchTask,'PLOT',task});
|
| 90 | 94 |
set(btnSwitchPlot,'Enable','on'); |
| ... | ... |
@@ -106,7 +110,7 @@ DEFAULT.wd = fullfile('d:','Analyze','Choice','24pilot');
|
| 106 | 110 |
|
| 107 | 111 |
set(frame,'Visible','on'); |
| 108 | 112 |
|
| 109 |
-% assignin('base','model',model);
|
|
| 113 |
+ assignin('base','model',model1);
|
|
| 110 | 114 |
end |
| 111 | 115 |
|
| 112 | 116 |
function model = createFirstStepPanel(model,parent,DEFAULT) |
| ... | ... |
@@ -246,15 +250,15 @@ function model = createFirstStepPanel(model,parent,DEFAULT) |
| 246 | 250 |
'Value',2); |
| 247 | 251 |
set(model.selNormPST,'BackgroundColor','w'); |
| 248 | 252 |
|
| 249 |
- createLabel(pNorm,[0 0.25 1 0.25],'Col Bias removal'); |
|
| 250 |
- norm2Model = {'on','off'};
|
|
| 251 |
- model.selNormClass = uicontrol(pNorm,'Style','popupmenu',... |
|
| 253 |
+% createLabel(pNorm,[0 0.25 1 0.25],'Col Bias removal'); |
|
| 254 |
+% norm2Model = {'on','off'};
|
|
| 255 |
+ model.chkColBias = uicontrol(pNorm,'Style','checkbox',... |
|
| 252 | 256 |
'Units','normalized',... |
| 253 |
- 'Position',[0.0 0.0 1 0.25],... |
|
| 254 |
- 'String',norm2Model,... |
|
| 255 |
- 'UserData',norm2Model,... |
|
| 257 |
+ 'Position',[0.0 0.1 1 0.25],... |
|
| 258 |
+ 'String','column Bias removal',... |
|
| 259 |
+ 'Enable','on',... |
|
| 256 | 260 |
'Value',1); |
| 257 |
- set(model.selNormClass,'BackgroundColor','w'); |
|
| 261 |
+ set(model.chkColBias,'BackgroundColor','w'); |
|
| 258 | 262 |
|
| 259 | 263 |
%buttons |
| 260 | 264 |
pButtons = uipanel(parent,'Position',cell2mat(main_grid(1,4))); |
| 261 | 265 |