This is the Crossmodal Perception and Plasticity lab (CPP) PsychToolBox (PTB) toolbox.
Those functions are mostly wrappers around some PTB functions to facilitate their use and their reuse (#DontRepeatYourself)
Make sure that the following toolboxes are installed and added to the matlab / octave path.
For instructions see the following links:
Requirements | Used version |
---|---|
PsychToolBox | >=3.0.14 |
Matlab | >=2015b |
or Octave | 4.? |
Tested:
- matlab 2015b or octave 4.2.2 and PTB 3.0.14.
All the documentation is accessible here.
├── demos # quick demo of how to use some functions
├── dev # templates for experiment (will be moved out soon)
├── docs # documentation
├── manualTests # all the tests that cannot be automated (yet)
├── src # actual code of the CPP_PTB
│ ├── aperture # function related to create apertur (circle, wedge, bar...)
│ ├── dot # functions to simplify the creations of RDK
│ ├── errors # all error functions
│ ├── fixation # to create fixation cross, dots
│ ├── keyboard # to collect responses, abort experiment...
│ ├── randomization # functions to help with trial randomization
│ └── utils # set of general functions
└── tests # all the tests that that can be run by github actions
cd fullpath_to_directory_where_to_install
# use git to download the code
git clone https://github.com/cpp-lln-lab/CPP_PTB.git
# move into the folder you have just created
cd CPP_PTB
Then get the latest commit to stay up to date:
# from the directory where you downloaded the code
git pull origin master
To work with a specific version, create a branch at a specific version tag number
# creating and checking out a branch that will be called version1 at the version tag v1.0.0
git checkout -b version1 v1.0.0
Add it as a submodule in the repo you are working on.
cd fullpath_to_directory_where_to_install
# use git to download the code
git submodule add https://github.com/cpp-lln-lab/CPP_PTB.git
To get the latest commit you then need to update the submodule with the information on its remote repository and then merge those locally.
git submodule update --remote --merge
Remember that updates to submodules need to be committed as well.
So say you want to clone a repo that has some nested submodules, then you would type this to get the content of all the submodules at once (here with my experiment repo):
git clone --recurse-submodules https://github.com/user_name/yourExperiment.git
This would be the way to do it "by hand"
# clone the repo
git clone https://github.com/user_name/yourExperiment.git
# go into the directory
cd yourExperiment
# initialize and get the content of the first level of submodules (CPP_PTB and CPP_BIDS)
git submodule init
git submodule update
# get the nested submodules JSONio and BIDS-matlab for CPP_BIDS
git submodule foreach --recursive 'git submodule init'
git submodule foreach --recursive 'git submodule update'
Download the code. Unzip. And add to the matlab path.
Pick a specific version from here.
Or take the latest commit - NOT RECOMMENDED.
This is NOT RECOMMENDED as this might create conflicts if you use different versions of CPP_PTB as sub-modules.
Also note that this might not work at all if you have not set a command line
alias to start Matlab from a terminal window by just typing matlab
. 😉
# from within the CPP_PTB folder
matlab -nojvm -nosplash -r "addpath(genpath(fullfile(pwd, 'src'))); savepath(); path(); exit();"
We use the camelCase
to more easily differentiates our functions from the ones
from PTB that use a PascalCase
.
In practice, we use the following regular expression for function names:
[a-z]+(([A-Z]|[0-9]){1}[a-z]+)*
.
Regular expressions look scary but are SUPER useful to sort through filenames:
A quick intro to regular expression
And many websites allow you to "design and test" your regular expression:
- regexper
- ...
We keep the McCabe complexity below 15 as reported by the
check_my_code function or the
MISS_HIT code checker. A couple of
code quality metrics are also checked automatically by MISS_HIT (avoiding
functions with too many nested if
blocks).
We use the MISS_HIT linter to automatically fix some linting issues.
The code style and quality is also checked during the continuous integration.
Unit tests are run with the mox unit toolbox and automated with github action on Octave.
Thanks goes to these wonderful people (emoji key):
Remi Gau 💻 🎨 📖 🐛 📓 🤔 🚇 🚧 |
marcobarilari 💻 🎨 📖 🐛 📓 🤔 |
CerenB 💻 🎨 📖 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!