Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and share BITSI code and examples on github #27

Open
robertoostenveld opened this issue Dec 6, 2023 · 8 comments
Open

Document and share BITSI code and examples on github #27

robertoostenveld opened this issue Dec 6, 2023 · 8 comments
Labels
behavior experiment issue related to behavioral experiments documentation Improvements or additions to documentation

Comments

@robertoostenveld
Copy link
Member

Mark @henneysq is using PsychoPy for his stimulation. Even though he was familiar with Python, stimulus presentation, decimal and binary representations, getting this to work still took quite some time and required input not only from Uriel @namrolyat, but also from Konstantinos @contsili and Vivian. Also @contsili recently spent quite some time on this, together with @schoffelen.

I think that we can make new researchers more independent and efficient and that we can benefit from existing researchers' expertise by making a bitsi-psychtoolbox and a bits-psychopy repository (or bitsi-matlab/python, or possibly one repo with two sections, or possibly also make one for NBS presentation) and use those to store and document the code snippets that Mark now received from the different people that provided input.

Questions to address could be

  • why is the ASCII character 1 different from the number 1
  • why is the hexadecimal code 10 different from the number 10
  • how should I choose the length of the trigger pulse
  • how to avoid staircasing, how to detect it, and how to deal with it when it happened
  • when to use which mode of the bitsi
  • how to test the timing using an oscilloscope and/or photodiode
  • how to validate that the correct number of triggers was recorded in the EEG or MEG file and with the right numbers

Furthermore, it could contain a few standard (but complete) stimulus presentation scripts for testing and for new people getting started.

The presentation database that we have on intranet since 2005 (thanks to Ingrid, Tineke and Shaozheng) could perhaps move over to the new repository

However, we should also consider the existing but significantly outdated Knowledge Database (that I think hardly anyone knows about any more), it documents Presentation, but not PsychoPy or PTB.

@robertoostenveld robertoostenveld added documentation Improvements or additions to documentation behavior experiment issue related to behavioral experiments labels Dec 6, 2023
@henneysq
Copy link

henneysq commented Dec 6, 2023

I would be happy to contribute with relevant python implementations. I have ended up programming my experiment in a fairly object-oriented manner, which is probably not very accessible. But I can break it down into independent scripts that demonstrate the basic use of psychopy for stimulus presentation and pyserial for communicating with the BITSI.

@schoffelen
Copy link
Collaborator

thanks for starting this discussion @robertoostenveld , let me explicitly ping @mekman and @marcelzwiers as well, before getting to electrophys centric. I agree that the documentation on the intranet and knowledge database is extremely scattered, relatively incomplete, and often outdated. It would be good to give this a fresh swing. Perhaps from a didactical point of view I would be in favour of a single repo, e.g. experimentprogramming_gettingstarted (or something more catchy), with a substructure linking to the different softwares used, presentation/matlab/python, to collect code and start (reorganizing) documentation. Perhaps not everything needs to be at 100% from the start, but it would be great to collect snippets of code, which probably need to be tested a bit before uploading.

Other questions:

  • what software should I use to implement my experiment and why?
  • can I just copy over 15-year old code from my lab mates?

@robertoostenveld
Copy link
Member Author

I think it is also important to consolidate and move (and not just copy) existing documentation over, to prevent inconsistent versions of code snippets to linger.

@schoffelen
Copy link
Collaborator

fair enough, and I'd say also label stale code as stale.

@robertoostenveld
Copy link
Member Author

can I just copy over 15-year old code from my lab mates?

Ingrid documented it in 2005 and it is still on the DCCN internet, so the answer would be "yes", right? 😄

@mekman
Copy link
Collaborator

mekman commented Dec 6, 2023

Thanks you Robert & co, I think this is an excellent initiative. I come by students with old bitsi code on a weekly basis, so very happy with the idea.

Just to make sure I understand it correctly. Is there anything M/EEG specific about the proposed code? My initial hope was, that the bitsi-ptb/bitsi-psychopy code would work for all modalities (behavioral, M/EEG, fMRI) equally well.

@schoffelen
Copy link
Collaborator

no the way in which one interfaces with bitsi from the stim PCs is the same in all labs. The exact details may differ with respect to other aspects of the coding (e.g.: fMRI people may get away with some sloppy timing, scanning pulses need to be sent, ...)

@robertoostenveld
Copy link
Member Author

What is EEG/MEG specific is - as JM writes - that the timing of the triggers is much more critical. I suspect that people would not bother with a photodiode and oscilloscope to check the timing on an fMRI or fNIRS experiment.

Furthermore, with EEG/MEG we tend to store (=code) all experimental details (stimuli and responses and their timing) in the numerical trigger channel of the acquisition system and less so as lines in an ASCII-formatted stimulus presentation log file. This has quite some consequences, such as a limited number of numeric codes, and triggers that not only need to turn on, but also need to turn off to make "room" for the next trigger.

But good documentation will benefit the users of all labs. So rather than highlighting the differences, I think we should build on the similarities between labs and the people using them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior experiment issue related to behavioral experiments documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants