Home > vbmeg > functions > device > meg > vb_meginfo_convert_raw2vbmeg.m

vb_meginfo_convert_raw2vbmeg

PURPOSE ^

make MEGinfo struct by picking up data from raw information

SYNOPSIS ^

function [MEGinfo] = vb_meginfo_convert_raw2vbmeg(raw_info)

DESCRIPTION ^

 make MEGinfo struct by picking up data from raw information

 [usage]
   [MEGinfo] = vb_meginfo_convert_raw2vbmeg(raw_info)

 [input]
   raw_info : <required> <<struct>> raw information

 [output]
    MEGinfo : <<struct>> MEGinfo

 [note]

 [history]
   2007-07-10 (Sako) initial version
   2007-08-22 (Sako) remove temporary field of saveman
   2008-01-31 (Sako) renewed due to new specification
   2008-04-23 (Sako) added ActiveChannel and ActiveTrial
   2011-02-17 (Sako) delete checking temporary field of saveman
   2011-05-26 (Sako) some fields were moved to device_info
   2011-07-21 (Sako) modified how to deal with sensor_weight_ref

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [MEGinfo] = vb_meginfo_convert_raw2vbmeg(raw_info)
0002 % make MEGinfo struct by picking up data from raw information
0003 %
0004 % [usage]
0005 %   [MEGinfo] = vb_meginfo_convert_raw2vbmeg(raw_info)
0006 %
0007 % [input]
0008 %   raw_info : <required> <<struct>> raw information
0009 %
0010 % [output]
0011 %    MEGinfo : <<struct>> MEGinfo
0012 %
0013 % [note]
0014 %
0015 % [history]
0016 %   2007-07-10 (Sako) initial version
0017 %   2007-08-22 (Sako) remove temporary field of saveman
0018 %   2008-01-31 (Sako) renewed due to new specification
0019 %   2008-04-23 (Sako) added ActiveChannel and ActiveTrial
0020 %   2011-02-17 (Sako) delete checking temporary field of saveman
0021 %   2011-05-26 (Sako) some fields were moved to device_info
0022 %   2011-07-21 (Sako) modified how to deal with sensor_weight_ref
0023 %
0024 % Copyright (C) 2011, ATR All Rights Reserved.
0025 % License : New BSD License(see VBMEG_LICENSE.txt)
0026 
0027 % --- CHECK ARGUMENTS --- %
0028 if ~exist('raw_info', 'var'), raw_info = []; end
0029 [raw_info] = inner_check_arguments(raw_info);
0030 
0031 % --- MAIN PROCEDURE --------------------------------------------------------- %
0032 %
0033 % MEGinfo.device            % device name
0034 % MEGinfo.sensor_weight     % coil weight
0035 % MEGinfo.Nchannel          % number of active gardiometers
0036 % MEGinfo.Nsample           % number of sample
0037 % MEGinfo.Pretrigger        % number of sample before trigger
0038 % MEGinfo.SampleFreq        % sampling frequency
0039 % MEGinfo.Nrepeat           % number of trial
0040 % MEGinfo.Trial             % <<struct>> trial information
0041 %                           %  .number : trial index number
0042 %                           %  .sample : sample list of this trial
0043 % MEGinfo.MEGch_id          % Active MEG channel index
0044 % MEGinfo.MEGch_name        % Active MEG channel name
0045 % MEGinfo.MEG_ID            % MEG filename(no extention)
0046 % MEGinfo.MRI_ID            % MRI hash key
0047 % MEGinfo.Vcenter           % origin of sphere model [m]
0048 % MEGinfo.ExtraChannelInfo  % information struct of eeg in MEG
0049 % MEGinfo.ActiveChannel     % active channel flag list
0050 % MEGinfo.ActiveTrial       % active trial flag list
0051 %
0052 % MEGinfo.device_info.sensor_weight_ref % coil weight
0053 
0054 MEGinfo.device        = raw_info.device;
0055 MEGinfo.sensor_weight = raw_info.sensor_weight;
0056 MEGinfo.Nchannel      = raw_info.Nchannel;
0057 MEGinfo.Nsample       = raw_info.Nsample;
0058 
0059 pretrigger = vb_meginfo_get_pre_trigger(raw_info);
0060 MEGinfo = vb_meginfo_set_pre_trigger(MEGinfo, pretrigger);
0061 
0062 MEGinfo.SampleFreq    = raw_info.SampleFreq;
0063 MEGinfo.Nrepeat       = raw_info.Nrepeat;
0064 
0065 MEGinfo.Trial         = raw_info.Trial;
0066 
0067 MEGinfo.MEGch_id      = raw_info.MEGch_id;
0068 MEGinfo.MEGch_name    = raw_info.MEGch_name;
0069 MEGinfo.MEG_ID        = raw_info.MEG_ID;
0070 MEGinfo.MRI_ID        = raw_info.MRI_ID;
0071 MEGinfo.Vcenter       = raw_info.Vcenter;
0072 MEGinfo.Vradius       = raw_info.Vradius;
0073 
0074 % --- added ActiveChannel
0075 MEGinfo = ...
0076   vb_info_set_active_channel(MEGinfo, vb_info_get_active_channel(raw_info));
0077 
0078 % --- added ActiveTrial
0079 active_trial_flag = ones(length(MEGinfo.Trial),1);
0080 MEGinfo = vb_info_set_active_trial(MEGinfo, active_trial_flag);
0081 
0082 % --- added ChannelInfo (temporarily)
0083 MEGinfo.ChannelInfo = raw_info.ChannelInfo;
0084 
0085 MEGinfo.saveman       = raw_info.saveman;
0086 
0087 MEGinfo.ExtraChannelInfo = raw_info.ExtraChannelInfo;
0088 
0089 % ----- device dependent fields
0090 %
0091 % MEGinfo.device_info       % device dependent data struct
0092 %                           %   .sensor_weight_ref
0093 %                           %   .acq_type
0094 %                           %   .acq_info
0095 %                           %   .TransInfo
0096 %
0097 % device_info.sensor_weight_ref
0098 %
0099 % device_info.acq_type      % data acquisition type
0100 % device_info.acq_info      % data acquisition information
0101 %                           %   .data_file
0102 %                           %   .type
0103 %                           %   .data_bit_len
0104 % device_info.TransInfo     % transform coordinate information
0105 %
0106 MEGinfo = vb_meginfo_set_sensor_weight_refmg(MEGinfo,  ...
0107   vb_meginfo_get_sensor_weight_refmg(raw_info));
0108 
0109 MEGinfo = vb_meginfo_set_acqtype(MEGinfo, ...
0110             vb_meginfo_get_acqtype(raw_info));
0111 
0112 MEGinfo = vb_meginfo_set_acqinfo(MEGinfo, ...
0113             vb_meginfo_get_acqinfo(raw_info));
0114 
0115 MEGinfo = vb_info_set_transinfo(MEGinfo, ...
0116             vb_info_get_transinfo(raw_info));
0117 return;
0118 %
0119 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0120 
0121 % --- INNER FUNCTIONS -------------------------------------------------------- %
0122 %
0123 % --- inner_check_arguments()
0124 %
0125 function [raw_info] = inner_check_arguments(raw_info)
0126 func_ = mfilename;
0127 if isempty(raw_info)
0128   error('(%s)raw_info is a required parameter', func_);
0129 end
0130 return;
0131 %
0132 % --- end of inner_check_arguments()
0133 %
0134 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0135 
0136 % --- END OF FILE --- %

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005