Home > data-access > list_missing_trials.m

list_missing_trials

PURPOSE ^

If trials are missing from a subject, say which ones

SYNOPSIS ^

function numbers = list_missing_trials( subject_id )

DESCRIPTION ^

If trials are missing from a subject, say which ones

   list_missing_trials( subject_id )
       If any trials have been marked as bad/missing in a subject's
       _info.txt file, then return their indices.  Otherwise, return [].

 Trials can be marked as "bad" for various reasons---fussy children, bad
 data collection, etc.  Sometimes they're also there for obscure reasons
 like a script expects 4 trials but there were only 2 in an experiment.  

 Bad trials are marked by putting "-1,-1" as the frame numbers of the
 trial in the _info.txt file of the subject. The multi-lib tools such as
 get_timing and get_trial_times are made to ignore those trials, since
 it's not obvious that this can happen.  If you need to know that the
 second trial returned by get_trial_times was actually trial 3, this
 function can help you.

 If the info file looks like:
     12,345
     567,890
     -1,-1
     1234,4567

 Then list_missing_trials(...) will return:
     3


 Another way to get this information is to call 
     get_timing(subject_id, 'include_missing')
 which will leave the -1,-1's in the trial list.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function numbers = list_missing_trials( subject_id )
0002 %If trials are missing from a subject, say which ones
0003 %
0004 %   list_missing_trials( subject_id )
0005 %       If any trials have been marked as bad/missing in a subject's
0006 %       _info.txt file, then return their indices.  Otherwise, return [].
0007 %
0008 % Trials can be marked as "bad" for various reasons---fussy children, bad
0009 % data collection, etc.  Sometimes they're also there for obscure reasons
0010 % like a script expects 4 trials but there were only 2 in an experiment.
0011 %
0012 % Bad trials are marked by putting "-1,-1" as the frame numbers of the
0013 % trial in the _info.txt file of the subject. The multi-lib tools such as
0014 % get_timing and get_trial_times are made to ignore those trials, since
0015 % it's not obvious that this can happen.  If you need to know that the
0016 % second trial returned by get_trial_times was actually trial 3, this
0017 % function can help you.
0018 %
0019 % If the info file looks like:
0020 %     12,345
0021 %     567,890
0022 %     -1,-1
0023 %     1234,4567
0024 %
0025 % Then list_missing_trials(...) will return:
0026 %     3
0027 %
0028 %
0029 % Another way to get this information is to call
0030 %     get_timing(subject_id, 'include_missing')
0031 % which will leave the -1,-1's in the trial list.
0032 %
0033 
0034 timing = get_timing(subject_id, 'include_missing');
0035 numbers = find(any(timing.trials == -1, 2));
0036 if isempty(numbers)
0037     numbers = [];
0038 end
0039

Generated on Tue 23-May-2017 02:00:59 by m2html © 2005