Home > demos > demo_generate_temporal_profile_by_cevent.m

demo_generate_temporal_profile_by_cevent

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear all;
0002 
0003 DEMO_ID = 3;
0004 
0005 % The function will only generate data for subjects that have all the
0006 % variables, and inform the user about the missing ones.
0007 sub_list = list_subjects(70);
0008 
0009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0010 %%% demo case 1: get temporal profile of mean size of target vs non-target
0011 %%% objects in the child's view, from 5 seconds before to 5 seconds after the
0012 %%% onsets of parent's naming cevents.
0013 if DEMO_ID == 1
0014     profile_input.sub_list = sub_list;
0015     profile_input.cevent_name = 'cevent_speech_naming_local-id';
0016     profile_input.whence = 'start';
0017     profile_input.interval = [-5 5];
0018     profile_input.sample_rate = 0.03334;
0019 
0020     profile_input.var_name = {'cont_vision_size_obj1_child', ...
0021         'cont_vision_size_obj2_child', 'cont_vision_size_obj3_child'};
0022     profile_input.var_category = [1 2 3];
0023     profile_input.cevent_category = [1 2 3];
0024     
0025     % Each row corresponding to each cont variable
0026     % Each column corresponding to one cevent value
0027     profile_input.groupid_matrix = ...
0028         [1 2 2;
0029          2 1 2;
0030          2 2 1];
0031 
0032     profile_data = temporal_profile_generate_by_cevent(profile_input);
0033     % The output will contain these fields:
0034     %     profile_data =
0035     %              sub_list: [147x1 double]
0036     %              exp_list: [147x1 double]
0037     %               cevents: [147x3 double]
0038     %        cevent_trialid: [147x1 double]
0039     %     cevent_instanceid: [147x1 double]
0040     %     probs_mean_per_instance: [147x2 double]
0041     %         groupid_label: {'target'  'non-target'}
0042     %      profile_data_mat: {[147x300 double]  [147x300 double]}
0043     %           sample_rate: 0.0333
0044     %             time_base: [1x300 double]
0045     %           cevent_name: 'cevent_speech_naming_local-id'
0046     %              var_name: {1x3 cell}
0047     
0048     % Then the result can be plotted and saved
0049     temporal_profile_save_csv_plot(profile_data, '.')
0050     % temporal_profile_save_csv_plot(profile_data, save_dir)
0051     
0052     
0053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0054 %%% demo case 2: get temporal probability profile of child looking at target vs non-target
0055 %%% object named by the parent, from 5 seconds before to 5 seconds after of
0056 %%% the onsets of parent's naming cevents.
0057 elseif DEMO_ID == 2
0058     profile_input.sub_list = sub_list;
0059     profile_input.cevent_name = 'cevent_speech_naming_local-id';
0060     profile_input.whence = 'start';
0061     profile_input.interval = [-5 5];
0062     profile_input.sample_rate = 0.03334;
0063 
0064     profile_input.var_name = 'cstream_eye_roi_child';
0065     profile_input.var_category = [1 2 3 4];
0066     profile_input.cevent_category = [1 2 3];
0067     
0068     % Each row corresponding to a cstream value
0069     % Each column corresponding to a cevent value
0070     profile_input.groupid_matrix = ...
0071         [1 2 2;
0072          2 1 2;
0073          2 2 1;
0074          3 3 3];
0075     profile_input.groupid_label = {'target', 'non-target', 'face'};
0076    
0077     profile_data = temporal_profile_generate_by_cevent(profile_input);
0078     temporal_profile_save_csv_plot(profile_data, '.');
0079 
0080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0081 %%% demo case 3: get temporal probability profile of child holding target vs non-target
0082 %%% object named by the parent, from 5 seconds before to 5 seconds after of
0083 %%% the onsets of parent's naming cevents.
0084 elseif DEMO_ID == 3
0085     profile_input.sub_list = sub_list;
0086     profile_input.cevent_name = 'cevent_speech_naming_local-id';
0087     profile_input.whence = 'start';
0088     profile_input.interval = [-5 5];
0089     profile_input.sample_rate = 0.03334;
0090 
0091     profile_input.var_category = [1 2 3];
0092     profile_input.cevent_category = [1 2 3];
0093     
0094     % Each row corresponding to a cstream value
0095     % Each column corresponding to a cevent value
0096     profile_input.groupid_matrix = ...
0097         [1 2 2;
0098          2 1 2;
0099          2 2 1];
0100 
0101     profile_input.var_name = 'cstream_inhand_left-hand_obj-all_child';
0102     profile_lefthand = temporal_profile_generate_by_cevent(profile_input);
0103     
0104     profile_input.var_name = 'cstream_inhand_right-hand_obj-all_child';
0105     profile_righthand = temporal_profile_generate_by_cevent(profile_input);
0106     
0107     % To get the probability of either the left or the right hand is
0108     % holding the object, function provides user the option to combine two
0109     % profile data using logical operators "or" "and"
0110     profile_data = temporal_profile_logical_operation(profile_lefthand, profile_righthand, 'or');
0111     temporal_profile_save_csv_plot(profile_data, '.');
0112 end

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005