e0049736a9efa9d6879494a634ae811c8daf0e16
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)     
29)     rawData = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

30)     % calculate psth
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

31)     pstopts.des = subjectStruct{s}.des;
32)     pstopts.eventList = args.eventList;
33)     pstopts.sessionList = sessionlist;
34)     
35)     assignin('base','pstopts',pstopts);
36)     assignin('base','rawData',rawData);
37) 
38)     disp('computing psth');
39)     subjectStruct{s}.psth    = calculatePST(args.timeline,pstopts,rawData);
40)     disp('done');
Christoph Budziszewski moved things

Christoph Budziszewski authored 15 years ago

41) end
42) 
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

43) assignin('base','subjectStruct',subjectStruct);
44)