Home > vbmeg > functions > gui > preAnalysis > meeg_processor > signal_processor > vb_signal_processor_view_data_file.m

vb_signal_processor_view_data_file

PURPOSE ^

View data(MEG/EEG) file.

SYNOPSIS ^

function vb_signal_processor_view_data_file(data, data_file)

DESCRIPTION ^

 View data(MEG/EEG) file.
 [USAGE]
    vb_signal_processor_view_data_file(data, data_file);
 [IN]
         data : Application data.
    data_file : MEG/EEG data file(.meg.mat/.eeg.mat)
 [OUT]
    none

 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 vb_signal_processor_view_data_file(data, data_file)
0002 % View data(MEG/EEG) file.
0003 % [USAGE]
0004 %    vb_signal_processor_view_data_file(data, data_file);
0005 % [IN]
0006 %         data : Application data.
0007 %    data_file : MEG/EEG data file(.meg.mat/.eeg.mat)
0008 % [OUT]
0009 %    none
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('data', 'var')
0018     error('data is a required parameter.');
0019 end
0020 if ~exist('data_file', 'var') || exist(data_file, 'file') ~= 2
0021     error('Specified MEG/EEG file not found.');
0022 end
0023 
0024 %
0025 % --- Main Procedure
0026 %
0027 data_info = vb_load_meg_info(data_file);
0028 
0029 file_type = 0;     % =0:Evoked, Averaged data format
0030                    % =1:Conitnuous data format
0031 % switch(acq_type)
0032 %     case {'Evoked_Ave', 'Evoked_Raw'}
0033 %         file_type = 0;
0034 %     case 'Continuous_Raw'
0035 %         file_type = 1;
0036 %     otherwise
0037 %         error('Unknown acquisition type was found in specified MEG/EEG file');
0038 % end
0039 if data_info.Nrepeat == 1
0040     file_type = 1;
0041 end
0042 
0043 % View data
0044 if file_type == 0
0045     job_plot_meg(data_file);
0046 else
0047     % Get file type('MEG' or 'EEG')
0048     measurement   = vb_info_get_measurement(data_info);
0049 
0050     % Get Active data channel
0051     ch_info  = vb_load_channel_info(data_file, measurement);
0052     ch_list  = ch_info.Name(ch_info.Active == 1);
0053 
0054     % Get Active Extra data channel
0055     ch_info  = vb_load_channel_info(data_file, 'EXTRA');
0056     ex_ch_list = ch_info.Name(ch_info.Active == 1);
0057 
0058     % Decide display channenl number about 50 channel
0059     Ndata_ch = size(ch_list, 1);
0060     if Ndata_ch > 100
0061         step = ceil(Ndata_ch / 50);
0062         disp_ch_list = ch_list(1:step:Ndata_ch);
0063     else
0064         disp_ch_list = ch_list;
0065     end
0066     [disp_ch_list, cancel] = vb_te_channel_selector_new(...
0067                                                       ch_list,...
0068                                                       disp_ch_list,...
0069                                          'Choose data channel to display');
0070     if cancel, return; end
0071 
0072     % Decide display extra channel number
0073     [disp_ex_ch_list, cancel] = vb_te_channel_selector_new(...
0074                                                       ex_ch_list,...
0075                                                       [],...
0076                                          'Choose extra channel to display');
0077     if cancel, return; end
0078 
0079     % Launch timeseries viewer
0080     window_len = 30;
0081 %    if isempty(disp_ch_list), disp_ch_list = {''}; end
0082 %    if isempty(disp_ex_ch_list), disp_ex_ch_list = {''}; end
0083     h = vb_timeseries_viewer_new(data_file, window_len, ...
0084                              disp_ch_list, [], disp_ex_ch_list);
0085     set(h, 'Name', [measurement ' file:' data_file]);
0086 end
0087

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