forked from sevimcengiz/Oryx-MRSI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExclusionCriteria.m
77 lines (58 loc) · 2.28 KB
/
ExclusionCriteria.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%% This function is written for spectra quality module.
% This helps to create a display for voxels included in the 1H-MRSI data analysis for each metabolite.
% Main Page of Oryx asks user to define some exclusion criteria values for the FWHM, SNR, CRLB, and fCSF.
% This function uses those information to create a binary mask of spectral
% quality at each voxel.
% Author: Sevim Cengiz. Bogazici University, 2020
% Contact: sevim_cengiz@icloud.com
function [includedvoxels]=ExclusionCriteria(Pinfo,AllFWHM,Allsnr,AllNumStd,Metname,Metabolites,outmat,Exc_struct);
fcsf=Pinfo.frac_CSF;
Naa_no=Metabolites(1,9).no;
Lip13a_no=Metabolites(1,6).no;
Lip13b_no=Metabolites(1,7).no;
Lip13comp_no=Metabolites(1,8).no;
cutoff_fcsf=Exc_struct.value(1,1);
cutoff_snr=Exc_struct.value(1,2);
cutoff_fwhm=Exc_struct.value(1,3);
cutoff_crlb=Exc_struct.value(1,4);
[sli row col]=size(Pinfo.littlevoxels);
sfcsf=squeeze(fcsf);
metnumre=size(Metname);
metnumree=metnumre(1,2);
includedvoxels=ones(metnumree,sli,row,col);
%Exlusion criteria: SNR<8 & FWHM>0.10 excluded -- (Recommended values)
for isli=1:sli
for irow=1:row
for icol=1:col
if Allsnr(isli,irow,icol)<cutoff_snr
includedvoxels(:,isli,irow,icol)=0;
end
if AllFWHM(isli,irow,icol)>cutoff_fwhm
includedvoxels(:,isli,irow,icol)=0;
end
if sfcsf(isli,irow,icol)>cutoff_fcsf
includedvoxels(:,isli,irow,icol)=0;
end
end
end
end
% Exclusion criteria: (Fraction of csf >0.30) AND (std of NAA>30 & std of
% LIPID<30) excluded -- (Recommended Values)
for n=1:numel(Metname)
for isli=1:sli
for irow=1:row
for icol=1:col
% if fcsf(n,isli,irow,icol)>cutoff_fcsf
% if fcsf(1,isli,irow,icol)>cutoff_fcsf
% includedvoxels(n,isli,irow,icol)=0;
% end
if AllNumStd(n,isli,irow,icol)>cutoff_crlb
includedvoxels(n,isli,irow,icol)=0;
end
end
end
end
end
outincludedvox=[outmat,filesep,Pinfo.sparname,'_includedvoxels.mat'];
save(outincludedvox, 'includedvoxels');
end