-
Notifications
You must be signed in to change notification settings - Fork 0
/
getModelDiff.m
51 lines (36 loc) · 1.7 KB
/
getModelDiff.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function pRFTSeries = getpRFTSeries(v,overlayNum,scanNum,roi)
for voxel = 1:roi.n
%% Get info on the voxel %%
% voxel coordinates
x = roi.scanCoords(1,voxel); y = roi.scanCoords(2,voxel); z = roi.scanCoords(3,voxel);
% grab computed analyses %
scanNum = 1; %% need to set this properly
a = viewGet(v,'Analysis');
d = viewGet(v,'d',scanNum);
r2 = viewGet(v,'overlayData',scanNum,viewGet(v,'overlayNum','r2'));
thisR2 = r2(x,y,z);
polarAngle = viewGet(v,'overlayData',scanNum,viewGet(v,'overlayNum','polarAngle'));
thisPolarAngle = polarAngle(x,y,z);
eccentricity = viewGet(v,'overlayData',scanNum,viewGet(v,'overlayNum','eccentricity'));
thisEccentricity = eccentricity(x,y,z);
rfHalfWidth = viewGet(v,'overlayData',scanNum,viewGet(v,'overlayNum','rfHalfWidth'));
thisRfHalfWidth = rfHalfWidth(x,y,z);
%% get params %%
scanDims = viewGet(v,'scanDims',scanNum);
whichVoxel = find(d.linearCoords == sub2ind(scanDims,x,y,z));
r = d.r(whichVoxel,:);
params = d.params(:,whichVoxel);
if isfield(d,'paramsInfo')
paramsInfo = d.paramsInfo;
else
paramsInfo = [];
end
%% get the model time series for the voxel **
m = pRFFit(v,scanNum,x,y,z,'stim',d.stim,'getModelResponse=1','params',params,'concatInfo',d.concatInfo,'fitTypeParams',a.params.pRFFit,'paramsInfo',paramsInfo);
pRFTSeries(x,y,z,:) = m.modelResponse;
if mod(voxel,10)
disp(sprintf('(getpRFTSeries) Voxel %s of %s, %s% complete',voxel,roi.n,voxel/roi.n);
disp(sprintf('(pRF) Running on scans %s:%s (restrict %s)',params.groupName,num2str(params.scanNum,'%i '),params.restrict ));
end
end
k=2