cpp-lln-lab / CPP_PTB

a set of function to make it easier to create behavioral, EEG, fMRI experiment with psychtoolbox
https://cpp-ptb.readthedocs.io/en/latest/index.html#
MIT License
12 stars 13 forks source link

[BUG]: waitFor has been modified and the first input is now useless, not removing it because it will break things #179

Open marcobarilari opened 2 years ago

marcobarilari commented 2 years ago

Is there an existing issue for this?

Expected Behavior

no wait for trigger inside

Current Behavior

this is before where waitForTrigger was giving problems

function waitFor(cfg, timeToWait)
    %
    % Will either wait for a certain amount of time or a number of triggers.
    %
    % USAGE::
    %
    %   waitFor(cfg, timeToWait)
    %
    % (C) Copyright 2020 CPP_PTB developers
    if cfg.pacedByTriggers.do
        waitForTrigger( ...
                       cfg, ...
                       cfg.keyboard.responseBox, ...
                       cfg.pacedByTriggers.quietMode, ...
                       timeToWait);
    else
        WaitSecs(timeToWait);
    end

end

Error message

No response

Environment

- OS:
- Matlab:
- SPM:

Anything else?

No response

Remi-Gau commented 2 years ago

will look into this and I suspect we might be able to salvage this and revert that change but it might have to go along with some changes in the localizers code.

Remi-Gau commented 2 years ago

Some thoughts...

Some refactoring to some of the defaults for MRI from the localizers into the CPP PTB defaults: if cfg.testingDevice == 'mri' then we should expect some default value for

cfg.mri.triggerKey = 't';
cfg.mri.triggerNb = 5;
cfg.mri.repetitionTime = 1.8;
cfg.suffix.acq = ''; % ???
cfg.pacedByTriggers.do = false;

When cfg.pacedByTriggers.do == true, also use cfg.timing.IBI and cfg.timing.ISI but make sure those values are integer >=0 by having some early checks