-
Notifications
You must be signed in to change notification settings - Fork 5
/
pipeline_brainstorm_meg_hcp.m
46 lines (41 loc) · 1.48 KB
/
pipeline_brainstorm_meg_hcp.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
function [ K] = pipeline_brainstorm_meg_hcp(nVertices, colormap, fs_folder, MriFile)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
%% initial values...
load(fs_folder);
load(colormap);
nVertices = 6000; % must be defined by the user...
resamplingMethod = 'reducepatch';
erodeFactor = 0;
fillFactor = 1;
headVertices = 1922;
isMEG = 1;
SnrFixed = 3;
NoiseReg = 0.1;
conductivity = 0.0125;
showFigure = 0;
ThetaJJ = [];
SJJ = [];
indms = [];
count = 0;
verbosity = 1; % must be defined by the user...
ind_act = 39;
addpath external;
%% sensor position estimation...
elect = zeros(length(data.label),3);
for ii = 1:length(data.label)
for jj = 1:length(data.hdr.grad.label)
if strcmp(data.label{ii},data.hdr.grad.label{jj})
elect(ii,:) = data.hdr.grad.chanpos(jj,:);
break;
end
end
end
%% head model estimation...
disp('************************************');
disp('* estimating BEM head model... *');
disp('************************************');
[Gain,Cortex,sHeadBEM] = pipeline_brainstorm_gain(MriFile,elect,nVertices,...
resamplingMethod,erodeFactor,fillFactor,headVertices,...
isMEG,SnrFixed,NoiseReg,conductivity,showFigure);
K = bst_gain_orient(Gain,Cortex.VertNormals);