Home > data-import > import_macro_speech_coding.m

import_macro_speech_coding

PURPOSE ^

This script will import the speech type macro coding for experiments. The

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 This script will import the speech type macro coding for experiments.  The
 coding was done in an excel file called [Subj_ID]_Macro.xlsx which was
 then saved as tab delimited text files called general.txt and naming.txt
 located in the subjects speech_transcription_p folders. This will merely
 read in the text files and save them as cevents in the derived folder for
 each subject in the experiment.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % This script will import the speech type macro coding for experiments.  The
0002 % coding was done in an excel file called [Subj_ID]_Macro.xlsx which was
0003 % then saved as tab delimited text files called general.txt and naming.txt
0004 % located in the subjects speech_transcription_p folders. This will merely
0005 % read in the text files and save them as cevents in the derived folder for
0006 % each subject in the experiment.
0007 
0008 % Experiment ID
0009 exp_id = 14;
0010 
0011 % Final Variable names:
0012 % general_var_name = 'cevent_speech_speech-type_parent';
0013 naming_var_name = 'cevent_speech_naming-type_parent';
0014 
0015 
0016 %Comment out one of the following:
0017 
0018     % To run all the subjects us this line:
0019     subjs = list_subjects(exp_id);
0020     % To run particular subjects, use this line:
0021 %     subjs = [3218:3219]';
0022 subjs = [3503 3509 3510 3513 3514 3516 3517 3414];
0023 subjs = 1412;
0024     
0025 
0026 
0027 for i = 1 : numel(subjs);
0028     
0029     sid = subjs(i)   % Printing sid.
0030     sid_dir = get_subject_dir(sid);
0031     
0032     % Load the text files.
0033 %     general_data = load(sprintf('%s/speech_transcription_p/general.txt', sid_dir));
0034     naming_data = load(sprintf('%s/speech_transcription_p/naming.txt', sid_dir));
0035     
0036     % Find the speech sync and update the timing from the coding.
0037     times = get_trial_times(sid); 
0038     offset = get_timing(sid); 
0039     
0040 %     general_data(:,1:2) = general_data(:,1:2) + offset.speechTime;
0041     naming_data(:,1:2) = naming_data(:,1:2) + offset.speechTime; 
0042     
0043     size(naming_data)   % Check Size before filtering
0044     
0045     % Load the data that is within the trial times as a new variable and
0046     % save it.
0047 %     new_general_data = cevent_in_event(general_data, times);
0048     new_naming_data = cevent_in_event(naming_data, times);
0049     
0050 %     size(new_general_data)   % Check size after filtering to just the trial times.
0051     
0052 %     record_variable(sid, general_var_name, new_general_data);
0053     record_variable(sid, naming_var_name, new_naming_data); 
0054     
0055 end;

Generated on Tue 23-May-2017 20:00:55 by m2html © 2005