Repository navigation
Expand file tree
/
Copy pathfigure4A.m
More file actions
executable file
·70 lines (62 loc) · 2.6 KB
/
Copy pathfigure4A.m
File metadata and controls
executable file
·70 lines (62 loc) · 2.6 KB
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
%% Plot mean of sham conditions for Figure 4A
%
% If this code is used in a publication, please cite the manuscript:
% "H Huang, KN Kay, NM Gregg, G Ojeda Valencia, M In, C Kapeller, Y Shu, GA Worrell, KJ Miller, and D Hermes.
% Single pulse electrical stimulation in white matter modulates iEEG visual responses in human early visual cortex. (Under Review)"
%
% A preprint is available currently at doi: https://doi.org/10.1101/2025.05.05.652264.
%
% The dataset corresponding to this code and manuscript is in BIDS format (version 1.10.0) on OpenNeuro (ds006485),
% and it will be made publicly available upon manuscript acceptance.
%
% Copyright (C) 2025 Harvey Huang
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% colormap for image coh condition
load('broc10.mat');
imgCondColors = [0, 0, 0; broc10([3, 4, 5, 8, 7, 6], :)];
sub = '1';
chName = 'LOC1';
site = 'LOC4-LOC5';
outdir = fullfile('output', sub, sprintf('%s_%s', chName, site));
mkdir(outdir);
saveOutputs = true;
xlims = [-0.2, 1];
ylims = [-450, 450];
dsFactor = 8; % We need vsegData (data saved for model fitting) for the img, e2v info
vsegData = load(fullfile(outdir, sprintf('Vseg_%s_%s_%s_ds-%d.mat', sub, chName, site, dsFactor)));
imgs = vsegData.imgs;
e2vs = vsegData.e2vs;
ttseg = vsegData.ttseg;
Vseg = vsegData.Vseg;
% holds trial means for each sham condition
trialMeans = nan(length(ttseg), 7);
for ii = 1:7
trialMeans(:, ii) = mean(Vseg(:, imgs(ii).idxSite & e2vs(1).idxSite), 2);
end
% plot trial means
figure('Position', [200, 200, 300, 300]); hold on
yline(0);
for ii = 1:7
plot(ttseg, trialMeans(:, ii), 'Color', imgCondColors(ii, :), 'LineWidth', 0.75);
end
hold off
set(gca, 'xtick', -0.2:0.2:1); xlim(xlims); ylim(ylims);
if saveOutputs
saveas(gcf, fullfile(outdir, sprintf('%s_%s_shamImgAvgs', chName, site)), 'png');
saveas(gcf, fullfile(outdir, sprintf('%s_%s_shamImgAvgs', chName, site)), 'svg');
end