7a4d366647d777ab28ae3142cf229323d1098420
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

1) function runROIImageMaskMode(args)
Christoph Budziszewski moved things

Christoph Budziszewski authored 15 years ago

2) 
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

3) subjects = args.subjects;
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

4)    
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

5) nSubjects = size(subjects);
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

6) sessionlist = args.sessionList;
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

7) 
8) 
9) for s = 1:nSubjects
10)     subjectStruct{s}.dir = fullfile(args.basedir,cell2mat(subjects(s)));
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

11)     d = load(fullfile(subjectStruct{s}.dir,'results','SPM.mat'));
12)     subjectStruct{s}.des = d.SPM;
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

13)     subjectStruct{s}.name = cell2mat(subjects(s));
14)     subjectStruct{s}.roiFile = ui_selectRoiImage(...
15)         sprintf('Select ROI Files for %s',subjectStruct{s}.name),...
16)         fullfile(subjectStruct{s}.dir,'results','roi'));
17) end
18) 
19) 
20) 
21) for s = 1:nSubjects
22)     % load image data
23)    
24)     disp('fetching volume definitions, please wait');
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

25)     subjectStruct{s}.volumes = spm_vol(getImageFileList(subjectStruct{s}.dir,sessionlist,args.mask));
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

26) 
27)     disp('computing volume values, please wait');
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

28)     
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

29)     extr = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
30)     
31)     nVoxel = size(extr(1).dat,1);
32) 
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

33)     % calculate psth
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

34)     pstopts.des = subjectStruct{s}.des;
35)     pstopts.eventList = args.eventList;
36)     pstopts.sessionList = sessionlist;
37) 
38)     disp('computing psth');
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

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
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

47)     disp('done');
Christoph Budziszewski moved things

Christoph Budziszewski authored 15 years ago

48) end
49) 
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

50) assignin('base','subjectStruct',subjectStruct);
51)