Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bucanl_pipelines
bids_lossless_eeg
Commits
9c1d4732
Commit
9c1d4732
authored
Oct 11, 2018
by
tk11br
Browse files
Update new diagnostics to include more info
parent
e5ae41ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
derivatives/lossless/code/tools/diagnostics/main_diagnostics.m
View file @
9c1d4732
...
@@ -8,7 +8,7 @@ function main_diagnostics(filePath)
...
@@ -8,7 +8,7 @@ function main_diagnostics(filePath)
fOut
=
fopen
(
fName
,
'w'
);
fOut
=
fopen
(
fName
,
'w'
);
% Update this eventually...
% Update this eventually...
header
=
'fname,nbchan,pnts,srate,manual,ch_s_sd-m,ch_s_sd_b-m,ch_s_sd_b-m-ch_sd_b,ch_s_sd_b-m-ic_sd1_b,ch_sd-m,ch_sd_b-m,ch_sd_b-m-ic_sd1_b,low_r-m,ic_sd1-m,ic_sd1_b-m,ic_sd2,ch_s_sd,ch_sd,low_r,bridge,LtModelMean,LtModelStd,quant_0.05,quant_0.15,quant_0.25,quant_0.5,quant_0.75,quant_0.85,quant_0.95,
pre_qc_comp
'
;
header
=
'fname,nbchan,pnts,srate,manual,ch_s_sd-m,ch_s_sd_b-m,ch_s_sd_b-m-ch_sd_b,ch_s_sd_b-m-ic_sd1_b,ch_sd-m,ch_sd_b-m,ch_sd_b-m-ic_sd1_b,low_r-m,ic_sd1-m,ic_sd1_b-m,ic_sd2,ch_s_sd,ch_sd,low_r,bridge,LtModelMean,LtModelStd,
Lt_
quant_0.05,
Lt_
quant_0.15,
Lt_
quant_0.25,
Lt_
quant_0.5,
Lt_
quant_0.75,
Lt_
quant_0.85,
Lt_
quant_0.95,
manual_comp_1,ic_rt_1,linkpvaluesMean,linkpvaluesStd,lpv_quant_0.05,lpv_quant_0.15,lpv_quant_0.25,lpv_quant_0.5,lpv_quant_0.75,lpv_quant_0.85,lpv_quant_0.95
'
;
fprintf
(
fOut
,
'%s\n'
,
header
);
fprintf
(
fOut
,
'%s\n'
,
header
);
% Read line by line of the specified diag list
% Read line by line of the specified diag list
...
...
derivatives/lossless/code/tools/diagnostics/single_diagnostic.m
View file @
9c1d4732
...
@@ -6,6 +6,9 @@ function single_diagnostic(fOutID, singleSetFile)
...
@@ -6,6 +6,9 @@ function single_diagnostic(fOutID, singleSetFile)
% a buffer. Line starts with filename.
% a buffer. Line starts with filename.
outString
=
[
singleSetFile
,
','
];
outString
=
[
singleSetFile
,
','
];
% Quantile breakdown used as a constant:
quantBreakdown
=
[
0.05
,
0.15
,
0.25
,
0.5
,
0.75
,
0.85
,
0.95
];
% Load:
% Load:
EEG
=
pop_loadset
(
'filepath'
,
''
,
'filename'
,
singleSetFile
);
EEG
=
pop_loadset
(
'filepath'
,
''
,
'filename'
,
singleSetFile
);
EEG
=
eeg_checkset
(
EEG
);
EEG
=
eeg_checkset
(
EEG
);
...
@@ -49,12 +52,29 @@ function single_diagnostic(fOutID, singleSetFile)
...
@@ -49,12 +52,29 @@ function single_diagnostic(fOutID, singleSetFile)
% Amica diagnostic info:
% Amica diagnostic info:
outString
=
[
outString
,
num2str
(
mean
(
EEG
.
amica
(
2
)
.
models
.
Lt
)),
','
];
outString
=
[
outString
,
num2str
(
mean
(
EEG
.
amica
(
2
)
.
models
.
Lt
)),
','
];
outString
=
[
outString
,
num2str
(
std
(
EEG
.
amica
(
2
)
.
models
.
Lt
)),
','
];
outString
=
[
outString
,
num2str
(
std
(
EEG
.
amica
(
2
)
.
models
.
Lt
)),
','
];
quants
=
quantile
(
EEG
.
amica
(
2
)
.
models
.
Lt
,
[
0.05
,
0.15
,
0.25
,
0.5
,
0.75
,
0.85
,
0.95
]
);
quants
=
quantile
(
EEG
.
amica
(
2
)
.
models
.
Lt
,
quantBreakdown
);
for
i
=
1
:
length
(
quants
)
for
i
=
1
:
length
(
quants
)
outString
=
[
outString
,
num2str
(
quants
(
i
)),
','
];
outString
=
[
outString
,
num2str
(
quants
(
i
)),
','
];
end
end
% Pre QC comp count:
% Manual QC comp count:
outString
=
[
outString
,
num2str
(
length
(
EEG
.
icachansind
)),
','
];
outString
=
[
outString
,
num2str
(
length
(
find
(
EEG
.
marks
.
comp_info
(
1
)
.
flags
==
1
))),
','
];
% Components marked as ic_rt
outString
=
[
outString
,
num2str
(
length
(
find
(
EEG
.
marks
.
comp_info
(
2
)
.
flags
==
1
))),
','
];
% ISCtest:
a
=
[];
for
i
=
2
:
length
(
EEG
.
amica
);
a
(:,:,
i
-
1
)
=
EEG
.
amica
(
i
)
.
models
(
1
)
.
A
;
end
[
~
,
~
,
linkpvalues
,
~
]
=
isctest
(
a
,
0.05
,
0.05
,
'mixing'
);
outString
=
[
outString
,
num2str
(
mean
(
linkpvalues
)),
','
];
outString
=
[
outString
,
num2str
(
std
(
linkpvalues
)),
','
];
quants
=
quantile
(
linkpvalues
,
quantBreakdown
);
for
i
=
1
:
length
(
quants
)
outString
=
[
outString
,
num2str
(
quants
(
i
)),
','
];
end
% disp('hold');
% Final write - includes newline
% Final write - includes newline
fprintf
(
fOutID
,
'%s\n'
,
outString
);
fprintf
(
fOutID
,
'%s\n'
,
outString
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment