-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfeatureedgemasks.m
More file actions
25 lines (18 loc) · 906 Bytes
/
featureedgemasks.m
File metadata and controls
25 lines (18 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function feat = featureedgemasks(strFold)
% compare high zstat voxels against original EPI mean image intensities
% (in some artefacts the mean FMRI image is dark)
% Similar to above - compare zstat against original EPI *edge* image
% and/or the original PCA residual image
global icThreshold;
feat = [];
for i = 1:5
imgMaskEdge = read_avw(sprintf('%sedge%d',[strFold 'fix/'],i));
imgIc = abs(read_avw(sprintf('%sfix/dummy', strFold)))>icThreshold;
whatPercentOnEdgeB = sum(imgIc(:).*imgMaskEdge(:))/(eps+sum(imgIc(:)));
whatPercentOfEdge = sum(imgIc(:).*imgMaskEdge(:))/(eps+sum(imgMaskEdge(:)));
imgIc = read_avw(sprintf('%sfix/dummyabs', strFold));
wch = imgIc(:)>icThreshold;
whatPercentOnEdgeC = sum(imgIc(wch).*imgMaskEdge(wch))/(eps+sum(imgIc(wch)));
feat = [feat whatPercentOnEdgeB whatPercentOnEdgeC whatPercentOfEdge]; %#ok<AGROW>
end
return