From eda0ab825e14c8679779aa00153305b4cab08d26 Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Sat, 31 Oct 2020 21:17:00 +0100 Subject: [PATCH 01/15] update function description for eyetarcker --- src/eyeTracker.m | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/eyeTracker.m b/src/eyeTracker.m index 7378bd3a..2705d658 100755 --- a/src/eyeTracker.m +++ b/src/eyeTracker.m @@ -1,29 +1,37 @@ % (C) Copyright 2020 CPP_PTB developers function [el, cfg] = eyeTracker(input, cfg, varargin) - % [el] = eyeTracker(input, cfg, varargin) % % Wrapper function that deals with all the necessery actions to implement - % Eye Tracker recording with eyelink. + % Eye Tracker recording with eyelink. % - % INPUT + % USAGE: % - % - action: Defines what we want the function to do - % - Calibration: to initialize EyeLink and run calibration - % -- 'default calibration' (default) will run a calibration with 6 points - % -- 'custom calibration' (cfg.eyeTracker.defaultCalibration = 'false') will run a - % calibration with 6 points but the experimenter can choose their position on the screen - % - StartRecording: to start eye movements recording - % - Message: will add a tag (e.g. 'Block_n1') in the ET output file, the tag is a string and it - % is input from `varargin` - % - StopRecordings: to stop eye movements recornding - % - Shutdown: to save the `.edf` file with BIDS compliant name, from cpp-lln-lab/CPP_BIDS, in - % the output folder and shut the connection between the stimulation computer and the EyeLink - % computer + % function [el, cfg] = eyeTracker(input, cfg, [message]) % - % OUTPUT + % :param input: action: Defines what we want the function to do: + % - Calibration: to initialize EyeLink and run calibration + % - 'default calibration' (default) will run a calibration with 6 points + % - 'custom calibration' (cfg.eyeTracker.defaultCalibration = 'false') will run + % a calibration with 6 points but the experimenter can choose their position + % on the screen % - % `el` is a structure where are stored EyeLink setup variables + % - StartRecording: to start eye movements recording + % - Message: will add a tag (e.g. 'Block_n1') in the ET output file, the tag is a + % string and it is input from `varargin` + % - StopRecordings: to stop eye movements recornding + % - Shutdown: to save the `.edf` file with BIDS compliant name, from + % cpp-lln-lab/CPP_BIDS, in the output folder and shut the connection between the + % stimulation computer and the EyeLink computer + % :type input: string + % :param cfg: structure that stores any info regarding the experiment + % :type cfg: struct + % :param message: optional argument to pass in when you want to tag the output in a specific + % moment of the experiment (for example ``Experiment-start``) + % :type message: string + % + % :returns: - :el: (struct) stores info related to the Eye Tracker + % - :cfg: (struct) if ~cfg.eyeTracker.do From e891e46bc59738cbceaf02aa0d68ea9be50ce5f7 Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Sat, 31 Oct 2020 21:34:22 +0100 Subject: [PATCH 02/15] update function details --- src/eyeTracker.m | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/eyeTracker.m b/src/eyeTracker.m index 2705d658..62a6771b 100755 --- a/src/eyeTracker.m +++ b/src/eyeTracker.m @@ -1,37 +1,37 @@ % (C) Copyright 2020 CPP_PTB developers function [el, cfg] = eyeTracker(input, cfg, varargin) - % - % Wrapper function that deals with all the necessery actions to implement - % Eye Tracker recording with eyelink. - % - % USAGE: - % - % function [el, cfg] = eyeTracker(input, cfg, [message]) - % - % :param input: action: Defines what we want the function to do: - % - Calibration: to initialize EyeLink and run calibration - % - 'default calibration' (default) will run a calibration with 6 points - % - 'custom calibration' (cfg.eyeTracker.defaultCalibration = 'false') will run - % a calibration with 6 points but the experimenter can choose their position - % on the screen - % - % - StartRecording: to start eye movements recording - % - Message: will add a tag (e.g. 'Block_n1') in the ET output file, the tag is a - % string and it is input from `varargin` - % - StopRecordings: to stop eye movements recornding - % - Shutdown: to save the `.edf` file with BIDS compliant name, from - % cpp-lln-lab/CPP_BIDS, in the output folder and shut the connection between the - % stimulation computer and the EyeLink computer - % :type input: string - % :param cfg: structure that stores any info regarding the experiment - % :type cfg: struct - % :param message: optional argument to pass in when you want to tag the output in a specific - % moment of the experiment (for example ``Experiment-start``) - % :type message: string - % - % :returns: - :el: (struct) stores info related to the Eye Tracker - % - :cfg: (struct) + % + % Wrapper function that deals with all the necessery actions to implement + % Eye Tracker recording with eyelink. + % + % USAGE: + % + % function [el, cfg] = eyeTracker(input, cfg, [message]) + % + % :param input: Defines what we want the function to do + % :type input: string + % :param cfg: structure that stores any info regarding the experiment + % :type cfg: struct + % :param message: optional argument to pass in when you want to tag the output in a specific + % moment of the experiment (for example ``Experiment-start``) + % :type message: string + % + % :returns: - :el: (struct) stores info related to the Eye Tracker + % - :cfg: (struct) + % + % - ``Calibration`` to initialize EyeLink and run calibration + % - ``default calibration`` (default) will run a calibration with 6 points + % - ``custom calibration`` (``cfg.eyeTracker.defaultCalibration = 'false'``) will run + % a calibration with 6 points but the experimenter can choose their position + % on the screen + % - ``StartRecording``: to start eye movements recording + % - ``Message``: will add a tag (e.g. ``Block_n1``) in the ET output file, the tag is a + % string and it is input from `varargin` + % - ``StopRecordings``: to stop eye movements recording + % - ``Shutdown``: to save the ``.edf`` file with BIDS compliant name, from + % cpp-lln-lab/CPP_BIDS, in the output folder and shut the connection between the + % stimulation computer and the EyeLink computer if ~cfg.eyeTracker.do From 2504eaef65dee5e762da32563b1e124742779cef Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Sat, 31 Oct 2020 21:46:15 +0100 Subject: [PATCH 03/15] fix ci --- src/eyeTracker.m | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/eyeTracker.m b/src/eyeTracker.m index 62a6771b..3e27016e 100755 --- a/src/eyeTracker.m +++ b/src/eyeTracker.m @@ -1,37 +1,37 @@ % (C) Copyright 2020 CPP_PTB developers function [el, cfg] = eyeTracker(input, cfg, varargin) - % - % Wrapper function that deals with all the necessery actions to implement - % Eye Tracker recording with eyelink. - % - % USAGE: - % - % function [el, cfg] = eyeTracker(input, cfg, [message]) - % - % :param input: Defines what we want the function to do - % :type input: string - % :param cfg: structure that stores any info regarding the experiment - % :type cfg: struct - % :param message: optional argument to pass in when you want to tag the output in a specific - % moment of the experiment (for example ``Experiment-start``) - % :type message: string - % - % :returns: - :el: (struct) stores info related to the Eye Tracker - % - :cfg: (struct) - % - % - ``Calibration`` to initialize EyeLink and run calibration - % - ``default calibration`` (default) will run a calibration with 6 points - % - ``custom calibration`` (``cfg.eyeTracker.defaultCalibration = 'false'``) will run - % a calibration with 6 points but the experimenter can choose their position - % on the screen - % - ``StartRecording``: to start eye movements recording - % - ``Message``: will add a tag (e.g. ``Block_n1``) in the ET output file, the tag is a - % string and it is input from `varargin` - % - ``StopRecordings``: to stop eye movements recording - % - ``Shutdown``: to save the ``.edf`` file with BIDS compliant name, from - % cpp-lln-lab/CPP_BIDS, in the output folder and shut the connection between the - % stimulation computer and the EyeLink computer + % + % Wrapper function that deals with all the necessery actions to implement + % Eye Tracker recording with eyelink. + % + % USAGE: + % + % function [el, cfg] = eyeTracker(input, cfg, [message]) + % + % :param input: Defines what we want the function to do + % :type input: string + % :param cfg: structure that stores any info regarding the experiment + % :type cfg: struct + % :param message: optional argument to pass in when you want to tag the output in a specific + % moment of the experiment (for example ``Experiment-start``) + % :type message: string + % + % :returns: - :el: (struct) stores info related to the Eye Tracker + % - :cfg: (struct) + % + % - ``Calibration`` to initialize EyeLink and run calibration + % - ``default calibration`` (default) will run a calibration with 6 points + % - ``custom calibration`` (``cfg.eyeTracker.defaultCalibration = 'false'``) will run + % a calibration with 6 points but the experimenter can choose their position + % on the screen + % - ``StartRecording``: to start eye movements recording + % - ``Message``: will add a tag (e.g. ``Block_n1``) in the ET output file, the tag is a + % string and it is input from `varargin` + % - ``StopRecordings``: to stop eye movements recording + % - ``Shutdown``: to save the ``.edf`` file with BIDS compliant name, from + % cpp-lln-lab/CPP_BIDS, in the output folder and shut the connection between the + % stimulation computer and the EyeLink computer if ~cfg.eyeTracker.do From 97ef11efbfd5966a4d3bd0317d82144cf4847ca8 Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Sat, 31 Oct 2020 23:00:33 +0100 Subject: [PATCH 04/15] fix part of sphynx warning in some functions --- docs/source/function_description.rst | 3 +- src/dot/initDots.m | 3 +- src/keyboard/checkAbort.m | 10 +-- src/keyboard/getResponse.m | 97 +++++++++++++--------------- src/readAndFilterLogfile.m | 31 +++++---- src/utils/degToPix.m | 15 ++--- src/waitForTrigger.m | 31 +++++---- 7 files changed, 91 insertions(+), 99 deletions(-) diff --git a/docs/source/function_description.rst b/docs/source/function_description.rst index a1de908f..5a897f5f 100644 --- a/docs/source/function_description.rst +++ b/docs/source/function_description.rst @@ -23,12 +23,13 @@ List of functions in the ``src`` folder. List of functions in the ``src/aperture`` folder. +(to add saveAperture) + .. module:: src.aperture .. autofunction:: apertureTexture .. autofunction:: eccenLogSpeed .. autofunction:: getApertureName -.. autofunction:: saveAperture .. autofunction:: saveApertures .. autofunction:: smoothOval .. autofunction:: smoothRect diff --git a/src/dot/initDots.m b/src/dot/initDots.m index 32175b50..65a6c243 100644 --- a/src/dot/initDots.m +++ b/src/dot/initDots.m @@ -20,8 +20,7 @@ % dots.isSignal : signal dots (1) and those are noise dots (0) % dots.directionAllDots % dots.lifeTime : in frames - % dots.speeds : [ndots, 2] ; horizontal and vertical speed ; in pixels per - % frame + % dots.speeds : [ndots, 2] ; horizontal and vertical speed ; in pixels per frame % dots.speedPixPerFrame dots.direction = thisEvent.direction(1); diff --git a/src/keyboard/checkAbort.m b/src/keyboard/checkAbort.m index ed2e0dfb..c367274d 100644 --- a/src/keyboard/checkAbort.m +++ b/src/keyboard/checkAbort.m @@ -1,13 +1,15 @@ % (C) Copyright 2020 CPP_PTB developers function checkAbort(cfg, deviceNumber) - % checkAbort(cfg, deviceNumber) % - % Check for experiment abortion from operator - % When no deviceNumber is set then it will check the default device - % When an abort key s detected this will set a global variable and throw a + % Check for experiment abortion from operator. When no deviceNumber is set then it will check + % the default device. When an abort key is detected this will set a global variable and throw a % specific error that can then be catched. % + % USAGE: + % + % function checkAbort(cfg, deviceNumber) + % % Maint script % try % % Your awesome experiment diff --git a/src/keyboard/getResponse.m b/src/keyboard/getResponse.m index 11aee4e1..11ee2f4f 100644 --- a/src/keyboard/getResponse.m +++ b/src/keyboard/getResponse.m @@ -1,60 +1,51 @@ % (C) Copyright 2020 CPP_PTB developers function responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress) - % responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress) % - % Wrapper function to use KbQueue - % - % The queue will be listening to key presses on a keyboard device: - % cfg.keyboard.responseBox or cfg.keyboard.keyboard are 2 main examples. - % - % When no deviceNumber is set then it will listen to the default device. - % - % Check the CPP_getResponseDemo for a quick script on how to use it. - % - % - % INPUT - % - % - action: Defines what we want the function to do - % - init: to initialise the queue - % - start: to start listening to keypresses - % - check: checks all the key presses events since 'start', or since last - % 'check' or 'flush' (whichever was the most recent) - % -- can check for demand to abort if the escapeKey is listed in the - % Keys of interest. - % -- can only check for demands to abort when getResponse('check') is called: - % so there will be a delay between the key press and the experiment stopping - % -- abort errors send specific signals that allow the catch to get - % them and allows us to "close" nicely - % - flush: empties the queue of events in case you want to restart from a clean - % queue - % - stop: stops listening to key presses - % - % - getOnlyPress: if set to true the function will only return the key presses and - % will not return when the keys were released (default=true) - % See the section on OUTPUT below for more info - % - % - % - % OUTPUT - % - % responseEvents: returns all the keypresses and return them as a structure - % with field names that make it easier to save the output of in a BIDS - % format - % - % responseEvents.onset : this is an absolute value and you should - % substract the "experiment start time" to get a value relative to when the - % experiment was started. - % - % responseEvents.trial_type = 'response'; - % - % responseEvents.duration = 0; - % - % responseEvents.keyName : the name of the key pressed - % - % responseEvents(iEvent,1).pressed : if - % pressed == 1 --> the key was pressed - % pressed == 0 --> the key was released + % Wrapper function to use KbQueue. The queue will be listening to key presses on a keyboard device: + % ``cfg.keyboard.responseBox`` or ``cfg.keyboard.keyboard`` are 2 main examples.When no deviceNumber + % is set then it will listen to the default device. Check the ``CPP_getResponseDemo`` for a quick + % script on how to use it. + % + % USAGE: + % + % responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress) + % + % :param action: Defines what we want the function to do + % :param deviceNumber: device number of the keyboard or trigger box in MRI + % :type deviceNumber: integer + % :param cfg: + % :param getOnlyPress: if set to true the function will only return the key presses and will not + % return when the keys were released (default=true). See the section on + % `Returns` below for more info + % + % :returns: - :responseEvents: returns all the keypresses and return them as a structure with + % field names that make it easier to save the output of in a BIDS format + % + % - ``responseEvents.onset``: this is an absolute value and you should substract the + % "experiment start time" to get a value relative to when the + % experiment was started. + % - ``responseEvents.trial_type = response``; + % - ``responseEvents.duration = 0;`` + % - ``responseEvents.keyName``: the name of the key pressed + % - ``responseEvents(iEvent,1).pressed``: if + % - pressed == 1 --> the key was pressed + % - pressed == 0 --> the key was released + % + % ``action`` options: + % + % - ``init``: to initialise the queue + % - ``start``: to start listening to keypresses + % - ``check``: checks all the key presses events since 'start', or since last 'check' or 'flush' + % (whichever was the most recent) + % - can check for demand to abort if the escapeKey is listed in the Keys of interest + % - can only check for demands to abort when ``getResponse('check')`` is called so there will be + % a delay between the key press and the experiment stopping + % - abort errors send specific signals that allow the catch to get + % them and allows us to "close" nicely + % - ``flush``: empties the queue of events in case you want to restart from a clean + % queue + % - ``stop``: stops listening to key presses if nargin < 2 || isempty(deviceNumber) deviceNumber = -1; diff --git a/src/readAndFilterLogfile.m b/src/readAndFilterLogfile.m index 9049b444..e6b6980b 100644 --- a/src/readAndFilterLogfile.m +++ b/src/readAndFilterLogfile.m @@ -1,27 +1,26 @@ % (C) Copyright 2020 CPP_PTB developers -function outputFiltered = readAndFilterLogfile(columnName, filterBy, varargin) - % outputFiltered = readOutputFilter(filterHeader, filterContent, varargin) +function [outputFiltered] = readAndFilterLogfile(columnName, filterBy, varargin) % % It will display in the command window the content of the `output.tsv' filtered by one element - % of a target column. + % of a target column. Dependecies: bids_matlab (from CPP_BIDS) % - % DEPENDENCIES: - % - bids_matlab (from CPP_BIDS) + % USAGE: % - % INPUT: + % [outputFiltered] = readOutputFilter(filterHeader, filterContent, varargin) % - % - columnName: string, the header of the column where the content of insterest is stored - % (e.g., for 'trigger' will be 'trial type') - % - filterBy: string, the content of the column you want to filter out. It can take just - % part of the content name (e.g., you want to display the triggers and you have - % 'trigger_motion' and 'trigger_static', 'trigger' as input will do) - % - varargin: either cfg (to display the last run output) or the file path as string + % :param columnName: the header of the column where the content of insterest is stored + % (e.g., for 'trigger' will be 'trial type') + % :type columnName: string + % :param filterBy: the content of the column you want to filter out. It can take just + % part of the content name (for example, you want to display the triggers and + % you have ``trigger_motion`` and ``trigger_static``, ``trigger``' as input + % will do) + % :type filterBy: string + % :param varargin: either ``cfg`` (to display the last run output) or the file path as string % - % OUTPUT: - % - % - outputFiltered: dataset with only the specified content, to see it in the command window - % use display(outputFiltered) + % :returns: - outputFiltered: dataset with only the specified content, to see it in the command + % window use display(outputFiltered) % Checke if input is cfg or the file path if ischar(varargin{1}) diff --git a/src/utils/degToPix.m b/src/utils/degToPix.m index a2a1c09e..92fdc64d 100644 --- a/src/utils/degToPix.m +++ b/src/utils/degToPix.m @@ -1,24 +1,21 @@ % (C) Copyright 2020 CPP_PTB developers function structure = degToPix(fieldName, structure, cfg) - % structure = degToPix(fieldName, structure, cfg) + % For a given field value in degrees of visual angle in the structure, this computes its value + % in pixel using the pixel per degree value of the cfg structure and returns a structure with + % an additional field with Pix suffix holding that new value. % - % For a given field value in degrees of visual angle in the structure, - % this computes its value in pixel using the pixel per degree value of the cfg structure - % and returns a structure with an additional field with Pix suffix holding that new value. + % USAGE: % + % structure = degToPix(fieldName, structure, cfg) % - % USAGE: - % ------ % fixation.width = 2; % cfg.screen.ppd = 10; % % fixation = degToPix('width', fixation, cfg); % - % Returns: - % ------- + % - Returns: % fixation.widthPix = 20; - % deg = getfield(structure, fieldName); %#ok diff --git a/src/waitForTrigger.m b/src/waitForTrigger.m index a8c8bace..147fe895 100644 --- a/src/waitForTrigger.m +++ b/src/waitForTrigger.m @@ -1,10 +1,23 @@ % (C) Copyright 2020 CPP_PTB developers -function lastTriggerTimeStamp = waitForTrigger(varargin) - % waitForTrigger(cfg, deviceNumber, quietMode, nbTriggersToWait) - % +function [lastTriggerTimeStamp] = waitForTrigger(varargin) % Counts a certain number of triggers coming from the scanner before returning. % + % USAGE: + % + % [lastTriggerTimeStamp] = waitForTrigger([cfg,] [deviceNumber,] [quietMode,] [nbTriggersToWait]) + % + % :param cfg: + % :type cfg: struct + % :param deviceNumber: device number of the keyboard or trigger box in MRI + % :type deviceNumber: integer + % :param quietMode: a boolean to make sure nothing is printed on the screen or the prompt + % :type quietMode: boolean + % :param nbTriggersToWait: number of triggers to wait + % :type nbTriggersToWait: integer + % + % :returns: - :lastTriggerTimeStamp: (optional) it can be used as experimentStart timestamp (``cfg.experimentStart``) + % % If you are not using the quietMode, it flips and waits for half a TR before starting to % check for the next trigger (unless this was the last trigger to wait for and in % this case it returns immediately). @@ -12,23 +25,13 @@ % Will print the count down in the command line and on the PTB window if one is % opened. % - % If the fMRI sequence RT is provided (cgf.MRI.repetitionTime) then it will wait + % If the fMRI sequence RT is provided (``cgf.MRI.repetitionTime``) then it will wait % for half a RT before starting to check for next trigger, otherwise it will % wait 500 ms. % % When no deviceNumber is set then it will check the default device: this is % probably only useful in debug as you will want to make sure you get the % triggers coming from the scanner in a real case scenario. - % - % INPUTS - % - varargin{1} = cfg - % - % - varargin{2} = deviceNumber - % - % - varargin{3} = quietMode: a boolean to make sure nothing is printed on the screen or - % the prompt - % - % - nvarargin{4} = nbTriggersToWait [cfg, nbTriggersToWait, deviceNumber, quietMode] = checkInputs(varargin); From ffd4154425aee3758ec0d258c965f808a81d6518 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 31 Oct 2020 23:35:28 +0100 Subject: [PATCH 05/15] partial fix help section readAndFilter --- src/readAndFilterLogfile.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/readAndFilterLogfile.m b/src/readAndFilterLogfile.m index e6b6980b..4f647780 100644 --- a/src/readAndFilterLogfile.m +++ b/src/readAndFilterLogfile.m @@ -2,8 +2,8 @@ function [outputFiltered] = readAndFilterLogfile(columnName, filterBy, varargin) % - % It will display in the command window the content of the `output.tsv' filtered by one element - % of a target column. Dependecies: bids_matlab (from CPP_BIDS) + % It will display in the command window the content of the `output.tsv` filtered + % by one element of a target column. Dependecies: bids_matlab (from CPP_BIDS) % % USAGE: % @@ -13,14 +13,18 @@ % (e.g., for 'trigger' will be 'trial type') % :type columnName: string % :param filterBy: the content of the column you want to filter out. It can take just - % part of the content name (for example, you want to display the triggers and - % you have ``trigger_motion`` and ``trigger_static``, ``trigger``' as input - % will do) + % part of the content name (for example, you want to display the triggers and + % you have ``trigger_motion`` and ``trigger_static``, ``trigger`` as input + % will do) % :type filterBy: string - % :param varargin: either ``cfg`` (to display the last run output) or the file path as string + % :param varargin: either ``cfg`` (to display the last run output) or + % the file path as string % - % :returns: - outputFiltered: dataset with only the specified content, to see it in the command - % window use display(outputFiltered) + % :returns: - :outputFiltered: dataset with only the specified content + % to see it in the command window use display(outputFiltered) + % + % + % Checke if input is cfg or the file path if ischar(varargin{1}) From 2cd37c24e7a835c5cf34c19d36e7a0521c6879e5 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 31 Oct 2020 23:51:16 +0100 Subject: [PATCH 06/15] fix readAndFilter --- src/readAndFilterLogfile.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/readAndFilterLogfile.m b/src/readAndFilterLogfile.m index 4f647780..153d70cd 100644 --- a/src/readAndFilterLogfile.m +++ b/src/readAndFilterLogfile.m @@ -17,11 +17,9 @@ % you have ``trigger_motion`` and ``trigger_static``, ``trigger`` as input % will do) % :type filterBy: string - % :param varargin: either ``cfg`` (to display the last run output) or - % the file path as string + % :param varargin: either ``cfg`` (to display the last run output) or the file path as string % - % :returns: - :outputFiltered: dataset with only the specified content - % to see it in the command window use display(outputFiltered) + % :returns: - :outputFiltered: dataset with only the specified content to see it in the command window use display(outputFiltered) % % From f0f3e1c47550c4d90325dd302881db6f3c24622e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 31 Oct 2020 23:51:32 +0100 Subject: [PATCH 07/15] fix help section getResponse --- src/keyboard/getResponse.m | 50 +++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/keyboard/getResponse.m b/src/keyboard/getResponse.m index 11ee2f4f..93805a77 100644 --- a/src/keyboard/getResponse.m +++ b/src/keyboard/getResponse.m @@ -3,7 +3,7 @@ function responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress) % % Wrapper function to use KbQueue. The queue will be listening to key presses on a keyboard device: - % ``cfg.keyboard.responseBox`` or ``cfg.keyboard.keyboard`` are 2 main examples.When no deviceNumber + % ``cfg.keyboard.responseBox`` or ``cfg.keyboard.keyboard`` are 2 main examples. When no deviceNumber % is set then it will listen to the default device. Check the ``CPP_getResponseDemo`` for a quick % script on how to use it. % @@ -19,33 +19,39 @@ % return when the keys were released (default=true). See the section on % `Returns` below for more info % - % :returns: - :responseEvents: returns all the keypresses and return them as a structure with - % field names that make it easier to save the output of in a BIDS format + % :returns: - :responseEvents: returns all the keypresses and return them as a structure with field names that make it easier to save the output of in a BIDS format + % + % - ``responseEvents.onset`` this is an absolute value and you should substract the "experiment start time" to get a value relative to when the experiment was started. + % + % - ``responseEvents.trial_type = response`` + % + % - ``responseEvents.duration = 0`` + % + % - ``responseEvents.keyName`` the name of the key pressed + % + % - ``responseEvents(iEvent,1).pressed`` if % - % - ``responseEvents.onset``: this is an absolute value and you should substract the - % "experiment start time" to get a value relative to when the - % experiment was started. - % - ``responseEvents.trial_type = response``; - % - ``responseEvents.duration = 0;`` - % - ``responseEvents.keyName``: the name of the key pressed - % - ``responseEvents(iEvent,1).pressed``: if % - pressed == 1 --> the key was pressed % - pressed == 0 --> the key was released % + % --- + % % ``action`` options: % - % - ``init``: to initialise the queue - % - ``start``: to start listening to keypresses - % - ``check``: checks all the key presses events since 'start', or since last 'check' or 'flush' - % (whichever was the most recent) - % - can check for demand to abort if the escapeKey is listed in the Keys of interest - % - can only check for demands to abort when ``getResponse('check')`` is called so there will be - % a delay between the key press and the experiment stopping - % - abort errors send specific signals that allow the catch to get - % them and allows us to "close" nicely - % - ``flush``: empties the queue of events in case you want to restart from a clean - % queue - % - ``stop``: stops listening to key presses + % - ``init`` to initialise the queue + % + % - ``start`` to start listening to keypresses + % + % - ``check`` checks all the key presses events since 'start', or since last 'check' or 'flush' (whichever was the most recent) + % + % - can check for demand to abort if the ``escapeKey`` is listed in the Keys of interest + % - can only check for demands to abort when ``getResponse('check')`` is called so there will be a delay between the key press and the experiment stopping + % - abort errors send specific signals that allow the catch to get them and allows us to "close" nicely + % + % - ``flush`` empties the queue of events in case you want to restart from a clean queue + % + % - ``stop`` stops listening to key presses + % if nargin < 2 || isempty(deviceNumber) deviceNumber = -1; From 91bdd7142aac0275d08353fe0a839ef16991e62e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 31 Oct 2020 23:57:53 +0100 Subject: [PATCH 08/15] fix help section pix to deg --- src/utils/pixToDeg.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/pixToDeg.m b/src/utils/pixToDeg.m index 728d558d..c5d32dcd 100644 --- a/src/utils/pixToDeg.m +++ b/src/utils/pixToDeg.m @@ -10,14 +10,14 @@ % 'Pix' suffix removed and replaced with the 'DegVA' suffix . % % USAGE: - % ------ + % % fixation.widthPix = 20; % cfg.screen.ppd = 10; % % fixation = degToPix('widthPix', fixation, cfg); % % Returns: - % ------- + % % fixation.widthDegVA = 2; % From d4adc6b7a562894c1783da98726d5bdfbe523b42 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 31 Oct 2020 23:59:05 +0100 Subject: [PATCH 09/15] fix help section deg to pix --- src/utils/degToPix.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/degToPix.m b/src/utils/degToPix.m index 92fdc64d..b694ea48 100644 --- a/src/utils/degToPix.m +++ b/src/utils/degToPix.m @@ -15,7 +15,8 @@ % fixation = degToPix('width', fixation, cfg); % % - Returns: - % fixation.widthPix = 20; + % fixation.widthPix = 20; + % deg = getfield(structure, fieldName); %#ok From e85321f15d4232b73673586de395d5b4bdda70aa Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Nov 2020 00:12:13 +0100 Subject: [PATCH 10/15] fix checkAbort --- src/keyboard/checkAbort.m | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/keyboard/checkAbort.m b/src/keyboard/checkAbort.m index c367274d..25836dec 100644 --- a/src/keyboard/checkAbort.m +++ b/src/keyboard/checkAbort.m @@ -6,22 +6,32 @@ function checkAbort(cfg, deviceNumber) % the default device. When an abort key is detected this will set a global variable and throw a % specific error that can then be catched. % - % USAGE: + % USAGE:: % - % function checkAbort(cfg, deviceNumber) + % checkAbort(cfg, deviceNumber) % - % Maint script - % try - % % Your awesome experiment - % catch ME % when something goes wrong - % switch ME.identifier + % Examples:: + % + % try + % + % % Your awesome experiment + % + % catch ME % when something goes wrong + % + % switch ME.identifier + % % case 'checkAbort:abortRequested' - % % stuff to do when an abort is requested (save data...) + % + % % stuff to do when an abort is requested (save data...) + % % otherwise - % % stuff to do otherwise - % rethrow(ME) % display the error - % end - % end + % + % % stuff to do otherwise + % rethrow(ME) % display the error + % + % end + % end + % if nargin < 1 || isempty(cfg) error('I need at least one input.'); From 12e8c8a9b2273d44ef17a57e5fd9f3f277bdc0fc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Nov 2020 00:13:20 +0100 Subject: [PATCH 11/15] mh fix --- src/keyboard/checkAbort.m | 6 +++--- src/readAndFilterLogfile.m | 3 +-- src/utils/pixToDeg.m | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/keyboard/checkAbort.m b/src/keyboard/checkAbort.m index 25836dec..c1201ae3 100644 --- a/src/keyboard/checkAbort.m +++ b/src/keyboard/checkAbort.m @@ -19,11 +19,11 @@ function checkAbort(cfg, deviceNumber) % catch ME % when something goes wrong % % switch ME.identifier - % + % % case 'checkAbort:abortRequested' - % + % % % stuff to do when an abort is requested (save data...) - % + % % otherwise % % % stuff to do otherwise diff --git a/src/readAndFilterLogfile.m b/src/readAndFilterLogfile.m index 153d70cd..338e1fe5 100644 --- a/src/readAndFilterLogfile.m +++ b/src/readAndFilterLogfile.m @@ -2,7 +2,7 @@ function [outputFiltered] = readAndFilterLogfile(columnName, filterBy, varargin) % - % It will display in the command window the content of the `output.tsv` filtered + % It will display in the command window the content of the `output.tsv` filtered % by one element of a target column. Dependecies: bids_matlab (from CPP_BIDS) % % USAGE: @@ -22,7 +22,6 @@ % :returns: - :outputFiltered: dataset with only the specified content to see it in the command window use display(outputFiltered) % % - % Checke if input is cfg or the file path if ischar(varargin{1}) diff --git a/src/utils/pixToDeg.m b/src/utils/pixToDeg.m index c5d32dcd..3eb29d05 100644 --- a/src/utils/pixToDeg.m +++ b/src/utils/pixToDeg.m @@ -10,14 +10,14 @@ % 'Pix' suffix removed and replaced with the 'DegVA' suffix . % % USAGE: - % + % % fixation.widthPix = 20; % cfg.screen.ppd = 10; % % fixation = degToPix('widthPix', fixation, cfg); % % Returns: - % + % % fixation.widthDegVA = 2; % From e9b886b99d2d7bcc9072d43ef296e2127283c9c2 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Nov 2020 00:15:34 +0100 Subject: [PATCH 12/15] add template functions --- src/templates/templateFunction.m | 29 +++++++++++++++++ src/templates/templateFunctionExample.m | 42 +++++++++++++++++++++++++ src/templates/templateFunctionNumpy.m | 21 +++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 src/templates/templateFunction.m create mode 100644 src/templates/templateFunctionExample.m create mode 100644 src/templates/templateFunctionNumpy.m diff --git a/src/templates/templateFunction.m b/src/templates/templateFunction.m new file mode 100644 index 00000000..a0437c67 --- /dev/null +++ b/src/templates/templateFunction.m @@ -0,0 +1,29 @@ +% (C) Copyright 2020 CPP_PTB developpers + +function [argout1, argout2] = templateFunction(argin1, argin2, argin3) + % + % Short description of what the function does goes here. + % + % USAGE:: + % + % [argout1, argout2] = templateFunction(argin1, [argin2 == default,] [argin3]) + % + % :param argin1: (dimension) obligatory argument. Lorem ipsum dolor sit amet, + % consectetur adipiscing elit. Ut congue nec est ac lacinia. + % :type argin1: type + % :param argin2: optional argument and its default value. And some of the + % options can be shown in litteral like ``this`` or ``that``. + % :type argin2: string + % :param argin3: (dimension) optional argument + % + % :returns: - :argout1: (type) (dimension) + % - :argout2: (type) (dimension) + % + % .. todo: + % + % - item 1 + % - item 2 + + % The code goes below + +end diff --git a/src/templates/templateFunctionExample.m b/src/templates/templateFunctionExample.m new file mode 100644 index 00000000..3c247b2a --- /dev/null +++ b/src/templates/templateFunctionExample.m @@ -0,0 +1,42 @@ +% (C) Copyright 2020 CPP_PTB developpers + +function templateFunctionExample() + % This function illustrates a documentation test defined for MOdox. + % Other than that it does absolutely nothinghort description of what + % the function does goes here. + % + % Examples: + % a=2; + % disp(a) + % % Expected output is prefixed by '%||' as in the following line: + % %|| 2 + % % + % % The test continues because no interruption through whitespace, + % % as the previous line used a '%' comment character; + % % thus the 'a' variable is still in the namespace and can be + % % accessed. + % b=3+a; + % disp(a+[3 4]) + % %|| [5 6] + % + % % A new test starts here because the previous line was white-space + % % only. Thus the 'a' and 'b' variables are not present here anymore. + % % The following expression raises an error because the 'b' variable + % % is not defined (and does not carry over from the previous test). + % % Because the expected output indicates an error as well, + % % the test passes + % disp(b) + % %|| error('Some error') + % + % % A set of expressions is ignored if there is no expected output + % % (that is, no lines starting with '%||'). + % % Thus, the following expression is not part of any test, + % % and therefore does not raise an error. + % error('this is never executed) + % + % + % % tests end here because test indentation has ended + + % The code goes below + +end diff --git a/src/templates/templateFunctionNumpy.m b/src/templates/templateFunctionNumpy.m new file mode 100644 index 00000000..4ae9a956 --- /dev/null +++ b/src/templates/templateFunctionNumpy.m @@ -0,0 +1,21 @@ +% (C) Copyright 2020 CPP_PTB developpers + +function [argout] = templateFunctionNumpy(argin1, argin2, argin3) + % + % Short description of what the function does goes here. + % + % y = templateFunction(argin1, argin2, argin3) + % + % Parameters: + % argin1: The first input value + % + % argin2: The second input value + % + % argin3: The third input value + % + % Returns: + % The input value multiplied by two + + % The code goes below + +end From e75246021068e54b21a720335640a44be5931ffe Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Nov 2020 06:23:56 +0100 Subject: [PATCH 13/15] mh fix --- src/readAndFilterLogfile.m | 5 +- src/templates/templateFunction.m | 48 ++++++++-------- src/templates/templateFunctionExample.m | 74 ++++++++++++------------- src/templates/templateFunctionNumpy.m | 32 +++++------ src/waitForTrigger.m | 10 +++- 5 files changed, 89 insertions(+), 80 deletions(-) diff --git a/src/readAndFilterLogfile.m b/src/readAndFilterLogfile.m index 338e1fe5..a1735b12 100644 --- a/src/readAndFilterLogfile.m +++ b/src/readAndFilterLogfile.m @@ -19,7 +19,10 @@ % :type filterBy: string % :param varargin: either ``cfg`` (to display the last run output) or the file path as string % - % :returns: - :outputFiltered: dataset with only the specified content to see it in the command window use display(outputFiltered) + % :returns: + % + % - :outputFiltered: dataset with only the specified content to see it in the + % command window use display(outputFiltered) % % diff --git a/src/templates/templateFunction.m b/src/templates/templateFunction.m index a0437c67..e71713b0 100644 --- a/src/templates/templateFunction.m +++ b/src/templates/templateFunction.m @@ -1,29 +1,29 @@ -% (C) Copyright 2020 CPP_PTB developpers +% (C) Copyright 2020 CPP_PTB developers function [argout1, argout2] = templateFunction(argin1, argin2, argin3) - % - % Short description of what the function does goes here. - % - % USAGE:: - % - % [argout1, argout2] = templateFunction(argin1, [argin2 == default,] [argin3]) - % - % :param argin1: (dimension) obligatory argument. Lorem ipsum dolor sit amet, - % consectetur adipiscing elit. Ut congue nec est ac lacinia. - % :type argin1: type - % :param argin2: optional argument and its default value. And some of the - % options can be shown in litteral like ``this`` or ``that``. - % :type argin2: string - % :param argin3: (dimension) optional argument - % - % :returns: - :argout1: (type) (dimension) - % - :argout2: (type) (dimension) - % - % .. todo: - % - % - item 1 - % - item 2 + % + % Short description of what the function does goes here. + % + % USAGE:: + % + % [argout1, argout2] = templateFunction(argin1, [argin2 == default,] [argin3]) + % + % :param argin1: (dimension) obligatory argument. Lorem ipsum dolor sit amet, + % consectetur adipiscing elit. Ut congue nec est ac lacinia. + % :type argin1: type + % :param argin2: optional argument and its default value. And some of the + % options can be shown in litteral like ``this`` or ``that``. + % :type argin2: string + % :param argin3: (dimension) optional argument + % + % :returns: - :argout1: (type) (dimension) + % - :argout2: (type) (dimension) + % + % .. todo: + % + % - item 1 + % - item 2 - % The code goes below + % The code goes below end diff --git a/src/templates/templateFunctionExample.m b/src/templates/templateFunctionExample.m index 3c247b2a..99670d10 100644 --- a/src/templates/templateFunctionExample.m +++ b/src/templates/templateFunctionExample.m @@ -1,42 +1,42 @@ -% (C) Copyright 2020 CPP_PTB developpers +% (C) Copyright 2020 CPP_PTB developers function templateFunctionExample() - % This function illustrates a documentation test defined for MOdox. - % Other than that it does absolutely nothinghort description of what - % the function does goes here. - % - % Examples: - % a=2; - % disp(a) - % % Expected output is prefixed by '%||' as in the following line: - % %|| 2 - % % - % % The test continues because no interruption through whitespace, - % % as the previous line used a '%' comment character; - % % thus the 'a' variable is still in the namespace and can be - % % accessed. - % b=3+a; - % disp(a+[3 4]) - % %|| [5 6] - % - % % A new test starts here because the previous line was white-space - % % only. Thus the 'a' and 'b' variables are not present here anymore. - % % The following expression raises an error because the 'b' variable - % % is not defined (and does not carry over from the previous test). - % % Because the expected output indicates an error as well, - % % the test passes - % disp(b) - % %|| error('Some error') - % - % % A set of expressions is ignored if there is no expected output - % % (that is, no lines starting with '%||'). - % % Thus, the following expression is not part of any test, - % % and therefore does not raise an error. - % error('this is never executed) - % - % - % % tests end here because test indentation has ended + % This function illustrates a documentation test defined for MOdox. + % Other than that it does absolutely nothinghort description of what + % the function does goes here. + % + % Examples: + % a=2; + % disp(a) + % % Expected output is prefixed by '%||' as in the following line: + % %|| 2 + % % + % % The test continues because no interruption through whitespace, + % % as the previous line used a '%' comment character; + % % thus the 'a' variable is still in the namespace and can be + % % accessed. + % b=3+a; + % disp(a+[3 4]) + % %|| [5 6] + % + % % A new test starts here because the previous line was white-space + % % only. Thus the 'a' and 'b' variables are not present here anymore. + % % The following expression raises an error because the 'b' variable + % % is not defined (and does not carry over from the previous test). + % % Because the expected output indicates an error as well, + % % the test passes + % disp(b) + % %|| error('Some error') + % + % % A set of expressions is ignored if there is no expected output + % % (that is, no lines starting with '%||'). + % % Thus, the following expression is not part of any test, + % % and therefore does not raise an error. + % error('this is never executed) + % + % + % % tests end here because test indentation has ended - % The code goes below + % The code goes below end diff --git a/src/templates/templateFunctionNumpy.m b/src/templates/templateFunctionNumpy.m index 4ae9a956..a5974bf0 100644 --- a/src/templates/templateFunctionNumpy.m +++ b/src/templates/templateFunctionNumpy.m @@ -1,21 +1,21 @@ -% (C) Copyright 2020 CPP_PTB developpers +% (C) Copyright 2020 CPP_PTB developers function [argout] = templateFunctionNumpy(argin1, argin2, argin3) - % - % Short description of what the function does goes here. - % - % y = templateFunction(argin1, argin2, argin3) - % - % Parameters: - % argin1: The first input value - % - % argin2: The second input value - % - % argin3: The third input value - % - % Returns: - % The input value multiplied by two + % + % Short description of what the function does goes here. + % + % y = templateFunction(argin1, argin2, argin3) + % + % Parameters: + % argin1: The first input value + % + % argin2: The second input value + % + % argin3: The third input value + % + % Returns: + % The input value multiplied by two - % The code goes below + % The code goes below end diff --git a/src/waitForTrigger.m b/src/waitForTrigger.m index 147fe895..6f603290 100644 --- a/src/waitForTrigger.m +++ b/src/waitForTrigger.m @@ -5,7 +5,10 @@ % % USAGE: % - % [lastTriggerTimeStamp] = waitForTrigger([cfg,] [deviceNumber,] [quietMode,] [nbTriggersToWait]) + % [lastTriggerTimeStamp] = waitForTrigger([cfg,] ... + % [deviceNumber,] ... + % [quietMode,] ... + % [nbTriggersToWait]) % % :param cfg: % :type cfg: struct @@ -16,7 +19,10 @@ % :param nbTriggersToWait: number of triggers to wait % :type nbTriggersToWait: integer % - % :returns: - :lastTriggerTimeStamp: (optional) it can be used as experimentStart timestamp (``cfg.experimentStart``) + % :returns: + % + % - :lastTriggerTimeStamp: (optional) it can be used as experimentStart + % timestamp (``cfg.experimentStart``) % % If you are not using the quietMode, it flips and waits for half a TR before starting to % check for the next trigger (unless this was the last trigger to wait for and in From 4400ab9b6be2a97c36c42a0d5bcfe6e0b32f9eb2 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Nov 2020 06:24:15 +0100 Subject: [PATCH 14/15] add headings to function description doc --- docs/source/function_description.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/source/function_description.rst b/docs/source/function_description.rst index 5a897f5f..0fe8f7e8 100644 --- a/docs/source/function_description.rst +++ b/docs/source/function_description.rst @@ -1,5 +1,5 @@ Function description -==================== +******************** The functions of our pipeline @@ -21,6 +21,9 @@ List of functions in the ``src`` folder. ---- +Aperture +======== + List of functions in the ``src/aperture`` folder. (to add saveAperture) @@ -36,6 +39,9 @@ List of functions in the ``src/aperture`` folder. ---- +Dot +=== + List of functions in the ``src/dot`` folder. .. module:: src.dot @@ -54,6 +60,9 @@ List of functions in the ``src/dot`` folder. ---- +Errors +====== + List of functions in the ``src/errors`` folder. .. module:: src.errors @@ -65,6 +74,9 @@ List of functions in the ``src/errors`` folder. ---- +Fixation +======== + List of functions in the ``src/fixation`` folder. .. module:: src.fixation @@ -74,6 +86,9 @@ List of functions in the ``src/fixation`` folder. ---- +Keyboard +======== + List of functions in the ``src/keyboard`` folder. .. module:: src.keyboard @@ -87,6 +102,9 @@ List of functions in the ``src/keyboard`` folder. ---- +Randomization +============= + List of functions in the ``src/randomization`` folder. .. module:: src.randomization @@ -97,6 +115,9 @@ List of functions in the ``src/randomization`` folder. ---- +Screen +====== + List of functions in the ``src/screen`` folder. .. module:: src.screen @@ -106,6 +127,9 @@ List of functions in the ``src/screen`` folder. ---- +Utilities +========= + List of functions in the ``src/utils`` folder. (to add makeGif) From 7dd40a0b2ddaa4ee863242df44ea0b5164ebfb9b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 1 Nov 2020 06:40:33 +0100 Subject: [PATCH 15/15] fix mh and sphinx --- src/keyboard/getResponse.m | 45 ++++++++++++++++++++++++-------------- src/readAndFilterLogfile.m | 4 ++-- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/keyboard/getResponse.m b/src/keyboard/getResponse.m index 93805a77..7e482e2d 100644 --- a/src/keyboard/getResponse.m +++ b/src/keyboard/getResponse.m @@ -2,12 +2,13 @@ function responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress) % - % Wrapper function to use KbQueue. The queue will be listening to key presses on a keyboard device: - % ``cfg.keyboard.responseBox`` or ``cfg.keyboard.keyboard`` are 2 main examples. When no deviceNumber - % is set then it will listen to the default device. Check the ``CPP_getResponseDemo`` for a quick - % script on how to use it. + % Wrapper function to use KbQueue. The queue will be listening to key presses + % on a keyboard device: + % ``cfg.keyboard.responseBox`` or ``cfg.keyboard.keyboard`` are 2 main examples. + % When no ``deviceNumber`` is set then it will listen to the default device. + % Check the ``CPP_getResponseDemo`` for a quick script on how to use it. % - % USAGE: + % USAGE:: % % responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress) % @@ -19,20 +20,25 @@ % return when the keys were released (default=true). See the section on % `Returns` below for more info % - % :returns: - :responseEvents: returns all the keypresses and return them as a structure with field names that make it easier to save the output of in a BIDS format + % :returns: % - % - ``responseEvents.onset`` this is an absolute value and you should substract the "experiment start time" to get a value relative to when the experiment was started. + % - :responseEvents: returns all the keypresses and return them + % as a structure with field names that make it easier + % to save the output of in a BIDS format % - % - ``responseEvents.trial_type = response`` + % - ``responseEvents.onset`` this is an absolute value and you should substract + % the "experiment start time" to get a value relative to when the experiment was started. % - % - ``responseEvents.duration = 0`` + % - ``responseEvents.trial_type = response`` % - % - ``responseEvents.keyName`` the name of the key pressed + % - ``responseEvents.duration = 0`` % - % - ``responseEvents(iEvent,1).pressed`` if + % - ``responseEvents.keyName`` the name of the key pressed % - % - pressed == 1 --> the key was pressed - % - pressed == 0 --> the key was released + % - ``responseEvents(iEvent,1).pressed`` if + % + % - ``pressed == 1`` --> the key was pressed + % - ``pressed == 0`` --> the key was released % % --- % @@ -42,11 +48,16 @@ % % - ``start`` to start listening to keypresses % - % - ``check`` checks all the key presses events since 'start', or since last 'check' or 'flush' (whichever was the most recent) + % - ``check`` checks all the key presses events since 'start', or since last 'check' + % or 'flush' (whichever was the most recent) + % + % - can check for demand to abort if the ``escapeKey`` is listed in the Keys of interest + % + % - can only check for demands to abort when ``getResponse('check')`` is called + % so there will be a delay between the key press and the experiment stopping % - % - can check for demand to abort if the ``escapeKey`` is listed in the Keys of interest - % - can only check for demands to abort when ``getResponse('check')`` is called so there will be a delay between the key press and the experiment stopping - % - abort errors send specific signals that allow the catch to get them and allows us to "close" nicely + % - abort errors send specific signals that allow the catch to get them and allows us + % to "close" nicely % % - ``flush`` empties the queue of events in case you want to restart from a clean queue % diff --git a/src/readAndFilterLogfile.m b/src/readAndFilterLogfile.m index a1735b12..00b54ad7 100644 --- a/src/readAndFilterLogfile.m +++ b/src/readAndFilterLogfile.m @@ -19,9 +19,9 @@ % :type filterBy: string % :param varargin: either ``cfg`` (to display the last run output) or the file path as string % - % :returns: + % :returns: % - % - :outputFiltered: dataset with only the specified content to see it in the + % - :outputFiltered: dataset with only the specified content to see it in the % command window use display(outputFiltered) % %