Home > functions > common > loadfunc > vb_load_current_data.m

vb_load_current_data

PURPOSE ^

Load estimated current from cortical current file (.curr.mat).

SYNOPSIS ^

function Jact = vb_load_current_data(currfile,curr_type,ave_mode,trial,ix_area,verbose)

DESCRIPTION ^

 Load estimated current from cortical current file (.curr.mat). 

 [syntax]
 Jact = vb_load_current_data(currfile,curr_type, ...
                             ave_mode,trial,ix_area,verbose)

 [input]
 currfile : <<string>> Cortical current file (.curr.mat). 
 curr_type: <optional> <<int>> Specifying type of current. 
            = 0; J-current, original vertex current [Default]
            = 1; Z-current, internal current correspond to locally
                 spread source (see Yoshioka et al., 2008; appendix B). 
                 If currfile is old format (version 0.7 or before), this
                 variable is ignored and J-current is returned. 
 ave_mode : <optional> <<bool>> Specifying trial average mode. 
            = ON;  trial average is done  [Default]
            = OFF; Raw timecourses are returned. 
 trial    : <optional> <<int vector>> Trial number to be loaded.
            If empty, all trials are loaded  [Default]
 ix_area  : <optional> <<int vector>> (absolute) vertex index to load. 
            If empty, all vertices are loaded  [Default]
 verbose  : <optional> <<int>> Verbose mode for trial file loading. 
            0 (No print) , 1 ('.') , 2 ('session , trial').

 [output]
 Jact    : <<double matrix>> Current timecourse. 
           Jact(Nact,Nsample)          for ave_mode = ON 
           Jact(Nact,Nsample,Ntrials)  for ave_mode = OFF
           Nact     = Lact * Nvact,  Nvact = length(ix_act)
           Nsample  : # of time sample, 
           Ntrials  : # of trials in all session]

   Jact( n + Nvact*(i-1), t, :) 
    current at the vertex 'ix_act(n)', 'i-th' direction, time index 't'
    Time sample in MEG data : Tsample(t)
    Time (ms)   in MEG data : Tmsec(t)

 [history]
 2011-11-15 taku-y, originally written by M. Sato. This function is a
 subset of 'vb_load_current'. 

 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:

SOURCE CODE ^

0001 function Jact = vb_load_current_data(currfile,curr_type, ...
0002                                        ave_mode,trial,ix_area,verbose)
0003 % Load estimated current from cortical current file (.curr.mat).
0004 %
0005 % [syntax]
0006 % Jact = vb_load_current_data(currfile,curr_type, ...
0007 %                             ave_mode,trial,ix_area,verbose)
0008 %
0009 % [input]
0010 % currfile : <<string>> Cortical current file (.curr.mat).
0011 % curr_type: <optional> <<int>> Specifying type of current.
0012 %            = 0; J-current, original vertex current [Default]
0013 %            = 1; Z-current, internal current correspond to locally
0014 %                 spread source (see Yoshioka et al., 2008; appendix B).
0015 %                 If currfile is old format (version 0.7 or before), this
0016 %                 variable is ignored and J-current is returned.
0017 % ave_mode : <optional> <<bool>> Specifying trial average mode.
0018 %            = ON;  trial average is done  [Default]
0019 %            = OFF; Raw timecourses are returned.
0020 % trial    : <optional> <<int vector>> Trial number to be loaded.
0021 %            If empty, all trials are loaded  [Default]
0022 % ix_area  : <optional> <<int vector>> (absolute) vertex index to load.
0023 %            If empty, all vertices are loaded  [Default]
0024 % verbose  : <optional> <<int>> Verbose mode for trial file loading.
0025 %            0 (No print) , 1 ('.') , 2 ('session , trial').
0026 %
0027 % [output]
0028 % Jact    : <<double matrix>> Current timecourse.
0029 %           Jact(Nact,Nsample)          for ave_mode = ON
0030 %           Jact(Nact,Nsample,Ntrials)  for ave_mode = OFF
0031 %           Nact     = Lact * Nvact,  Nvact = length(ix_act)
0032 %           Nsample  : # of time sample,
0033 %           Ntrials  : # of trials in all session]
0034 %
0035 %   Jact( n + Nvact*(i-1), t, :)
0036 %    current at the vertex 'ix_act(n)', 'i-th' direction, time index 't'
0037 %    Time sample in MEG data : Tsample(t)
0038 %    Time (ms)   in MEG data : Tmsec(t)
0039 %
0040 % [history]
0041 % 2011-11-15 taku-y, originally written by M. Sato. This function is a
0042 % subset of 'vb_load_current'.
0043 %
0044 % Copyright (C) 2011, ATR All Rights Reserved.
0045 % License : New BSD License(see VBMEG_LICENSE.txt)
0046 
0047 if ~exist('curr_type','var'), curr_type = 0; end;
0048 if ~exist('ave_mode','var'), ave_mode = ON; end;
0049 if ~exist('trial','var'), trial = []; end;
0050 if ~exist('ix_area','var'), ix_area = []; end;
0051 if ~exist('verbose','var'), verbose = 0; end;
0052 
0053 %[J_type, file_type] = vb_load_current_type(currfile);
0054 %  J_type = 0 : J-current
0055 %  J_type = 1 : Z-current
0056 %  file_type = 0: single file
0057 %  file_type = 1: parent file with trial files
0058 % ver. 0.7 or before not supported here. 2011-11-15 taku-y
0059 J_type    = 1;
0060 file_type = 1;
0061 
0062 %[Jinfo] = vb_load_current_info(currfile);
0063 
0064 if ave_mode==OFF && file_type==1
0065   % trial mode & each trial current file
0066   if J_type==1
0067     [Jact,ix_act] = ...
0068         vb_load_current_z_tr(currfile,curr_type,trial,ix_area,verbose);
0069     %Jinfo.curr_type = curr_type;
0070   else
0071     if curr_type==1,
0072       fprintf('No Z-current and J-current is returned\n');
0073     end
0074     [Jact,ix_act] = ...
0075         vb_load_current_j_tr(currfile,trial,ix_area,verbose);
0076     %Jinfo.curr_type = 0;
0077   end
0078 else
0079   % single current file
0080   if J_type==1
0081     [Jact,ix_act] = ...
0082         vb_load_current_z(currfile,curr_type,ave_mode,trial,ix_area);
0083     %Jinfo.curr_type = curr_type;
0084   else
0085     if curr_type==1,
0086       fprintf('No Z-current and J-current is returned\n');
0087     end
0088     [Jact,ix_act] = ...
0089         vb_load_current_j(currfile,ave_mode,trial,ix_area);
0090     %Jinfo.curr_type = 0;
0091   end
0092 end
0093 
0094 %Jinfo.trial = trial;
0095 %Jinfo.NJact = length(ix_act);
0096 
0097 return;

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005