vbmeg2_load_functions

vb_load_cortex

Description

Loads cortical model of standard brain.

Syntax

[V, F, xx, inf_C] = vb_load_cortex(brain_file, coord_type);

Parameters

brain_file
<<string>> VBMEG Cortical model file(.brain.mat).
coord_type
<<string>> The coordinate system of the V to be loaded.
(not specified)
return value Standard cortex vertices in VBMEG coordinate. [Default]
'Inflate'
return value Inflated standard cortex vertices in VBMEG coordinate.
'MNI'
return value Standard cortex vertices in MNI coordinate.

Returns

V
Cortex vertex coordinates. [Nvertex x 3]
F
<<structure>> Triangle patch index structure.
.F3R
Triangle patch index of right hemisphere. [NRfaces x 3]
.F3L
Triangle patch index of left hemisphere. [NLfaces x 3]
.F3
Triangle patch index of both hemisphere. [Nfaces x 3]
xx
Normal vector to cortical surface. [Nvertex x 3]
inf_C
Color correspoding to Gyrus in inflate data.(When 'Inflated' is specified for coord_type [Nvertex x 1]

vb_load_current

Description

Loads estimated cortical current of standard brain.

syntax

[Jinfo, J] = vb_load_current(curr_file, curr_type, ave_mode, trial);

Parameters

curr_file
<<string>> VBMEG Cortical current file(.curr.mat).
curr_type
<<integer>> loading current type.
0
Cortical current excluding zero activity vertex.
1
Cortical current on reduced vertex. (due to bayes_parm.reduce)
2
Cortical current on all vertex. [Default]
ave_mode
<<integer>> average mode of loading current.
0
No trial average.
1
trial average is done. [Default]
trial
<<vector>> trial number to load. if isempty or not specifed, all the trials are loaded.

Returns

Jinfo
<<structure>> Information structure of loaded current. The fields are as below.
.NJact
The number of current vertices.
.Ntrial
The number of trials.
.SampleFreq
Sample Frequency [Hz].
.Pretrigger
Pretrigger period [sample].
.Tmsec
Time in msec.
J
Cortical current timecourse. [Jinfo.NJact x time]

vb_load_channel

Description

Loads channel position ​​for plotting M/EEG data.

Remarks : difference between vb_load_channel and vb_load_sensor: In case of MEG, one channel is composed of multiple coils. vb_load_channel averages the coordinate values ​​of the pair of coils and loads them as channel coordinates. For EEG, these two functions are almost synonymous.

syntax

[pos, channel_info] = vb_load_channel(meg_file, active_swt);

Parameters

meg_file
<<string>> VBMEG M/EEG file(.meg.mat/.eeg.mat)
active_swt
<<integer>> (optional)active switch
0
return all the channels
1
load only active channels [Default]

Returns

pos
Channel position [Nchannel x 3]
channel_info
<<structure>> loaded channel information.
.Active
Channel Active information(=0:Inactive, =1:Active).[Nchannel x 1]
.Name
channel name. {Nchannel x 1}
.Type
channel Type. [Nchannel x 1]
.ID
channel id. [Nchannel x 1]

vb_load_meg_data

Description

Loads M/EEG data.

Syntax

[data, channel_info, time_info] = vb_load_meg_data(meg_file, load_spec, new_file)

Parameters

meg_file
<<string>> VBMEG M/EEG file (.meg.mat/.eeg.mat)
load_spec
<<structure>> (optional) specification of loading data.
.ChannelName
target channel name list. [Nch x 1]

all the channels are specified. [Default]
e.g. {'1';'2';'3';'4'}

.ChannelSwitch
<<boolean>> how to treat target channel.(.ChannelName)
true
Read target channel. [Default]
false
Read except for target channel.
.ActiveChannel
active channel filter switch.
true
load active channels [Default]
false
load all the channels.
.ActiveTrial
active trial filter switch.(valid only when data type is Evoked_Raw.)
true
load active trials. [Default]
false
load all the trials.
new_file
<<string>> (optional) Create a new M/EEG file from loaded M/EEG data according to load_spec.

Returns

data
M/EEG timeseries data. [Nchannel x Nsample x Ntrial]
channel_info
<<structure>> loaded channel information.
.Active
Channel Active info list. (=0:Inactive, =1:Active).[Nchannel x 1]
.Name
channel name. {Nchannel x 1}
.Type
channel type. [Nchannel x 1]
.ID
channel id. [Nchannel x 1]
time_info
<<structure>> time infomation of loaded data.
.time
time list in sec. [1 x Nsample]
.sample_frequency
sampling frequency of the data. [double]

Example

  1. Load active channels and trials.

    data = vb_load_meg_data(meg_file);

  2. Load all channels including inactive channels and trials.

    load_spec.ActiveChannel = false;
    load_spec.ActiveTrial = false;
    data = vb_load_meg_data(megfile, load_spec);

vb_load_sensor

Description

Loads sensor position. The main use is to load sensor position for computing leadfield.

Remarks : difference between vb_load_channel and vb_load_sensor: In case of MEG, one channel is composed of multiple coils. vb_load_channel averages the coordinate values ​​of the pair of coils and loads them as channel coordinates. For EEG, these two functions are almost synonymous.

Syntax

[pick, Qpick, CoilWeight, Vcenter] = vb_load_sensor(meg_file);

Parameters

meg_file
<<string>> VBMEG M/EEG file(.meg.mat/.eeg.mat)

Returns

pick
n-th coil position. [Ncoil x 3]
Qpick
n-th coil direction.[Ncoil x 3]
CoilWeight
n-th coil weight for m-th channel. [Nchannel x Ncoil]
Vcenter
Center of spherical head model. [1x3]

vb_get_keyset_area

Description

Gets a list of keys for accessing area data stored in VBMEG Cortical area file(.area.mat).

Syntax

key_list = vb_get_keyset_area(area_file);

Parameters

area_file
<<string>>VBMEG Cortical area file(.area.mat)

Returns

key_list
<<cell string>> area name list.

vb_get_area

Description

Loads specified area data from VBMEG Cortical area file(.area.mat).

Syntax

area = vb_get_area(area_file, key);

Parameters

area_file
<<string>>VBMEG Cortical area file(.area.mat)
key
<<string>>key to load the area data(see vb_get_keyset_area).

Returns

area
<<structure>> area data.
.Iextract
<<vector>> Vertex index of cortical model V(see vb_load_cortex).
.key
<<string>> key of loaded area data.

vb_get_keyset_act

Description

Gets a list of keys for accessing activity data stored in VBMEG Cortical activity file(.act.mat).

Syntax

key_list = vb_get_keyset_act(act_file);

Parameters

act_file
<<string>>VBMEG Cortical activity file(.act.mat)

Returns

key_list
<<cell string>> area name list.

vb_get_act

Description

Loads specified activity data from VBMEG Cortical activity file(.act.mat).

Syntax

act = vb_get_area(act_file, key);

Parameters

act_file
<<string>>VBMEG Cortical activity file(.act.mat)
key
<<string>>key to load the act data(see vb_get_keyset_act).

Returns

act
<<structure>> activity data.
.xxP
<<vector>> Normalized activity of prior information(T-value). xxP (n) is prior to cortical model:V(n).(V:see vb_load_cortex). [Nvertex x 1]
.key
<<string>> key of loaded activity data.




























.