Browse code

schwimmen.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@139 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on 25/02/2009 16:53:36
Showing 5 changed files
... ...
@@ -6,6 +6,8 @@ vox = voxelList;
6 6
 nVoxel = size(vox,1);
7 7
 nImage = numel(V);
8 8
 
9
+rad = 0;
10
+
9 11
 for kImage=1:nImage
10 12
     roicenter = round(inv(V(kImage).mat)*[vox, ones(nVoxel,1)]');
11 13
     x = roicenter(1,:);
... ...
@@ -2,6 +2,9 @@ function main(model,task)
2 2
 
3 3
 % parse the GUI and pass parameters as structure
4 4
 disp('RUN');
5
+% disp('all warnings OFF')
6
+% warn = warning('off','all');
7
+
5 8
 timeLine = getTimeLineParams(model);
6 9
 subjects = getSubjectCellList(model);
7 10
 classDef = parseClassDef(model);
... ...
@@ -44,6 +47,8 @@ switch task
44 47
         disp('FBS')
45 48
 end
46 49
 
50
+% disp('warings restored');
51
+% warning('on',warn);
47 52
 end
48 53
 
49 54
 
... ...
@@ -14,14 +14,30 @@ function runCoordTable(args)
14 14
         map = load(fullfile(subjectStruct{s}.dir,'results','roi','coord_map.mat'));
15 15
         subjectStruct{s}.coords = getSubjectCoordinates(args.coords,map);
16 16
         
17
+        nVoxel = size(subjectStruct{s}.coords,1);
18
+        
17 19
         disp('fetching volume definitions, please wait');
18 20
         subjectStruct{s}.volumes = spm_vol(getImageFileList(subjectStruct{s}.dir,sessionlist,args.mask));
19
-
21
+      
22
+        extr = calculateImageData(subjectStruct{s}.volumes,subjectStruct{s}.coords);
23
+         
24
+        pstopts.des = subjectStruct{s}.des;
25
+        pstopts.eventList = args.eventList;
26
+        pstopts.sessionList = sessionlist;
20 27
         
21
-        rawData = calculateImageData(subjectStruct{s}.volumes,subjectStruct{s}.coords)
22
-        
23
-        disp('done');
28
+        disp('computing psth');
29
+        for iVoxel = 1:nVoxel
30
+            rawdata = [];
31
+            for iImage = 1:length(extr);
32
+                tmp = extr(iImage);
33
+                rawdata = [rawdata tmp.dat(iVoxel)];
34
+            end
35
+            subjectStruct{s}.pst{iVoxel} = calculatePST(args.timeline,pstopts,rawdata);
36
+        end
37
+       disp(sprintf('done %g // %g',s,nSubjects));
24 38
     end
39
+    
40
+    assignin('base','subjectStruct',subjectStruct);
25 41
 end
26 42
 
27 43
 
... ...
@@ -26,17 +26,24 @@ for s = 1:nSubjects
26 26
 
27 27
     disp('computing volume values, please wait');
28 28
     
29
-    rawData = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
29
+    extr = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
30
+    
31
+    nVoxel = size(extr(1).dat,1);
32
+
30 33
     % calculate psth
31 34
     pstopts.des = subjectStruct{s}.des;
32 35
     pstopts.eventList = args.eventList;
33 36
     pstopts.sessionList = sessionlist;
34
-    
35
-    assignin('base','pstopts',pstopts);
36
-    assignin('base','rawData',rawData);
37 37
 
38 38
     disp('computing psth');
39
-    subjectStruct{s}.psth    = calculatePST(args.timeline,pstopts,rawData);
39
+    for iVoxel = 1:nVoxel
40
+        rawdata = [];
41
+        for iImage = 1:length(extr);
42
+            tmp = extr(iImage);
43
+            rawdata = [rawdata tmp.dat(iVoxel)];
44
+        end
45
+        subjectStruct{s}.pst{iVoxel} = calculatePST(args.timeline,pstopts,rawdata);
46
+    end
40 47
     disp('done');
41 48
 end
42 49
 
... ...
@@ -256,13 +256,13 @@ function model = createFirstStepPanel(model,parent,DEFAULT)
256 256
 
257 257
         createLabel(pImage,[0.0 0.5 1 0.5],'Select Image Base');
258 258
         
259
-        imageRegExList = {'DUMMY swrf*.IMG','DUMMY wrf*.IMG'};
259
+        imageRegExList = {'DUMMY f*.IMG','DUMMY swrf*.IMG','DUMMY wrf*.IMG'};
260 260
         model.imageTypeSelection = uicontrol(pImage,'Style','popupmenu',...
261 261
         'Units','normalized',...
262 262
         'Position',[0.0 0.0 1 0.5],...
263 263
         'String',imageRegExList,...
264 264
         'UserData',imageRegExList,...
265
-        'Value',1);
265
+        'Value',3);
266 266
         set(model.imageTypeSelection,'BackgroundColor','w');
267 267
         
268 268