forked from neurolabusc/NiiStat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes.txt
70 lines (56 loc) · 2.27 KB
/
notes.txt
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
NiiStat includes some "global" values. These are for advanced uses. Be aware that a global value stay in effect until you quit matlab or you set it to empty. Therefore, once you set a global, all future calls to nii_stat will use this value.
global global_flContrast
global_flContrast = [1 -1]; %this will be zero padded, so if you have four conditions (plus implicit intercept) it will be [1 -1 0 0 0]
nii_stat
...
global_flContrast = []; %remove this so future calls treat each column as nuisance regressor
The value "global_roiMask" allows you to explicitly restrict regions of interest.
global global_roiMask
global_roiMask = [1 3 4];
nii_stat
l = load('LM1045.mat')
labels = cellstr(l.dti_jhu.label)
'1|SFG_L|superior frontal gyrus (posterior segment) left|1'
'3|SFG_PFC_L|superior frontal gyrus (prefrontal cortex) left|1'
'4|SFG_PFC_R|superior frontal gyrus (prefrontal cortex) right|1'
indx = roiMask;
labels = labels(indx,:);
labels
class(labels)
index = strfind(cellstr(labels),'|1');
index = ~cellfun('isempty',index);
smalllabels = labels(index,:);
class(smalllabels)
indx = [1 3 126 185 ]
labels3 = labels(indx,:);
index = strfind(cellstr(labels3),'|1');
size(les_names,1)
B = triu(ones(size(A)),1);
B = sum(sum(triu(ones(size(les_names,1)),1)))
(sum(sum(triu(ones(size(les_names,1)),1))) == numel( les(1, :)) || ;
numel(les(1, :))
B = sum(sum(triu(ones(size(les_names,1)),1)))
nRow = size(les_names,1))
nRow = 110
sum(sum(triu(ones(nRow),1)))
sum(sum(triu(ones(nRow,1)))
triu(zeros(110))
if (size(les_names,1) > 1) && (size(les_names,1) == numel( les(1, :))) %for ROI analyses
%this next bit allow us to remove ROIs
% global roiMask
% roiMask = [1 3 4]; %only include these regions of interest
global roiMask
if ~isempty(roiMask)
if min(roiMask(:)) < 1 || max(roiMask(:)) > size( les(1, :),2)
error('global roiMask must have values in the range 1..%d', size( les(1, :),2));
end
global roiMaskDeleteItems;
if ~isempty(roiMaskDeleteItems) && roiMaskDeleteItems
rMask = roiMask; %delete items in ROI mask, [1 2 5] removes 1st, 2nd, 5th col
else
rMask = 1: size(les_names,1); rMask(roiMask)=[]; %[1 2 5] preserves 1st, 2nd 5th
end
les(:, rMask)=[]; %remove columns
les_names(rMask,:) = [];
end
end