Skip to content

Commit fb6bfc1

Browse files
iandoliandoliandoliandolcog
authored
Merge Dev (#9)
* tweak * add sync test option to UI * tweak * iRec GUI work * [wip] testing blur shaders * [wip] * tweak * [wip] multi-image and video selection tweaks * [mm, conversionFactor] = pupilConversion(value, cal, calSizel diameter tweaks) * [wip] image handling refactor * improve movie and image stimuli to use folders of items, selectable using selection variable * tweak movie recording * fix * WIP * improve screen recording * add polar checkerboard stimulus * tweak polar checkerboard * lots of polar checkerboard changes * [wip] add a 2D rigid body simulator via animationManager * [wip] animation mamager * [wip] animation manager * compress png * [wip] animation manager * [wip] animation manager and touch manager updates * tweak * tweak * small fixes to barStimulus * allow fixation time to accumulate when strict is false * update to latest Titta for Tobii * fix bug in spot stimulus when changing contrast in multiple trials * small tweaks to behavioural reverse correlation task and stimulus * improve movie recording * Small refactor of trial start / end for eyetrackers We use trackerTrialStart() and trackerTrialEnd() functions to wrap the message sending, makes state machine function lists a bit simpler * refactor some eyetracker code * tweak * tweak * more updates for new Titta functionality * [wip] ongoing tobii improvements * fix imageStimulus not clearing the image matrix, other refactoring * anim manager assets * tmp * anim msanager tweak * add dotlineStimulus * Add drawPupilCoreMarker to draw the pupil core calibration marker * small fixes * Update LabJack T strobes from 2^8 to 2^11 values Before, sendStrobe would use EIO0:7 for 0-255 values and 256+ would send TTLs on CIO. We can use FIO for TTLs so we just expand to use EIO0:7 and CIO0:3 we reserve CIO4 for a read bit if needed... * add pupil core marker as a calibration marker option * add stop property to pupilCoreStimulus * tweaks * fix tobii movie calibration * allow use of pupil core marker from ui * more eyetracking updates * dotline fixes * aloow use of images for calibration marker for tobii and iRec * more eyetracker tweaks * Tobii analysis work * more tobii anal fixes * Fix logging in behavioural record caused by stateinfo file Other small fixes and some GUI tweaks * tweak * allow image file names to be added to task log if images are randomised, we can add them to the task log as a backup just in case the filenames stored in the stimulus itself are not synced * [wip] tobiiAnalysis * wip analysis improvements * [wip] * [wip] eyetracker anal * [wip] tobii analysis * [wip] * add random position shift to dotline stimuli * [wip] nirSmartManager * [wip] * add NIRSmart Control to opticka UI * more robust saving of tobii validation data * improve vars parsing in tobiiAnalysis * fix some dataConnection server bugs * more nirSmart fixes * MOC fix for nirSmart * nirSmart tweaks * add isOff to eyetracker objects to check if the eyetracker was disabled completely * add a sample fNIRS protocol * more nirSmart integration * fNIRS.m tweak * fix * [wip] move animationManager to use a full 2D physics engine dyn4j This engine is great, with a nice API and fully featured and more or less as fast as my home made physics code (but able to scale to many more bodies)... * tweak * refactor * improve protocol loading; eyetracker refactoring * small fixes * tweak * [wip] * [wip] animationManager * [wip] * [wip] * [wip] * fix timing bug if stim is not visible for barStimulus the phase reverse time is defined by the me.tick counter, but this was running even when the stimulus was not visible, thus the timing was off for the first phase reversal. Fixed. * convert comment to string array * fix dummy mode for eyelink, update uix also more gui work for ALF file saving support * doc * delete +uix and fix EDF filenaming * tweak * wip * wip * improve animationManager * tweak * docs * [wip] add training protocols for saccade tasks * [wip] animationManager changes * change nanmean to mean(...,'omitnan') * [wip] get titta advanced calibration integrated * [wip] titta stuff * tweak * fix titta crash * video size * fixes for gui changes * add circularMask to movieStimulus and better shuffle of many videos turn off audio sync if movies freeze * Use multiple videos for iRec calibration/validation * fix antisaccade task, add delayTime as parameter * tweaks * [wip] add simia joystick manager * small fixes for eyelink manager * tobiiAnalysis fixes * more tobiiAnalysis fixes * New makeReport() method to make a PDf report for the main opticka class objects * [wip] better display of state table * tweaks * start alyxManager work * tweak paths * More alyxManager work * fixes * Alyx GUI in Opticka * tweaks * more alyx work * [wip] * [wip] integrate AWS * tweak * add HED tag enumeration class * fix dummy strobe log values * refactor logging * [wip] * refactor timeLogger to log messages with a duration (start+end time) * tweak * tweak * tweak * tweak * tweak * several fixes * improve animation manager * anim tweaks * refactor animation and stimulus handling for improved clarity and efficiency * feat: enhance nirSmartManager and animationManager improved property handling and new methods for better functionality * fix arduinoManager default reward types * Update labJackT.m tweak * Update labJackT.m typo * fix: fix empty x crash * tweak * [wip] ZMQ * wip * wip * wip * feat: 🎨 add ZMQ context and socket management functions * refactor: 🚑️ Improve ZMQ command handling and documentation * wip * wip * docs: ✍️ Enhance documentation for Context and Socket classes * refactor: 🚑️ Enhance error handling and cleanup in Context and Socket classes * wip * feat: ⚡ add zeromq poll function * feat: ✨ Implement context creation and cleanup improvements in Context and zmqConnection classes * wip * tweak * feat: ✨ Enhance touch event handling and improve verbose logging in touchManager * wip * feat: ✨ Add circular mask shader for soft-edged image masking in imageStimulus * refactor: 🔥 Remove deprecated ØMQ functions and classes, switching to jzmq * refactor: Remove deprecated ØMQ functions and classes, switching to jzmq * behaviouraRecord fix * jzmq update * [wip] jzmq * refactor: Update event handling in touchManager and improve error reporting in jzmqConnection * I've refactored the `movieStimulus` circularMask to use a shader method. Here's what I did: (#8) - Modified `movieStimulus.m` to use a direct texture shader for its `circularMask` property, aligning its approach with `imageStimulus`. - Removed the previous technique of drawing a second texture (`masktex`) on top of the movie. - Added a `sigma` property for controlling mask edge smoothness. - Introduced a `makeMaskShader` method to load and configure `circularMask.frag`. - Updated `setup`, `loadMovie`, `draw`, and `reset` methods to integrate the new shader-based masking and remove the old procedural disc mask. - The `circularMask.frag` shader is now used directly in the drawing pipeline for movies when `circularMask` is enabled. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * feat: Add HTTP proxy support in jzmqConnection for sending messages * refactor: Clean up argument formatting and improve method documentation in jzmqConnection * wip * feat: Enhance sendViaProxy method to accept custom proxy URL and improve error handling * feat: 🎨 On linux we can enable/disable touch devices, if a named device is passed touchManager will try to enable it otherwise PTB cannot find it. * feat: Enhance addOptickaToPath function to add specific folders to MATLAB path and improve path management * feat: enhance checkTouchWindows to optionally use existing event, add isTouch method to touchManager * refactor: checkwin reporting * refactor: extract xinput handling into separate checkXInput method for better readability and maintainability * fix: handle potential empty dataOut in jzmqConnection open method * refactor: replace checkXInput method with static xinput method for enabling touch interfaces * refactor: enhance grid layout properties in baseStimulus for improved UI spacing * docs: changelog --------- Co-authored-by: iandol <iandol@cog5.org> Co-authored-by: iandol <iandol@seneca.org> Co-authored-by: iandol <iandol@cog10> Co-authored-by: cog <iandol@cog8> Co-authored-by: iandol <iandol@cog8.org> Co-authored-by: iandol <cog5@win> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 8521544 commit fb6bfc1

75 files changed

Lines changed: 10162 additions & 2815 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Junk
1010
.idea
1111
.bzrignore
1212
.vscode
13-
doxygen.log
13+
doxygen.log
14+
resources/

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Changelog
22

3-
Note only changes which may affect your use of Opticka will be detailed here, starting with V2.16.x
3+
Note changes which may affect your use of Opticka will be detailed here, starting with V2.16.x
44

5+
## V2.17.0
6+
7+
* Add support for ØMQ for communication messages (command + serialised MATLAB data packet) across networked PTB instances using the `jzmqConnection` class. This is *much more robust* than raw TCP/UDP used by `pnet` & `dataConnection` and we are using it for communication across [CageLab devices](https://github.com/cogplatform/CageLab). This adds a dependency on <https://github.com/cogplatform/matlab-jzmq>, a MATLAB wrapper for [JeroMQ](https://github.com/zeromq/jeromq). The class explicitly supports a new neuroscience-targetted middleware called [cogmoteGO](https://github.com/Ccccraz/cogmoteGO) with an API designed to manage multiple remote PTB instances and broadcast behavioural data and results back to clients.
8+
* Major update to the opticka UI for Alyx integration. There is an Alyx panel where you can connect to your Alyx instance to retrieve data from the server. Opticka can create a new Alyx session, and will upload the task data as a copy to the Alyx server. The data is sent to an AWS compatible data store linked to the Alyx session. The data is stored in a folder structure that matches the [International Brain Lab ONE Protocol](https://int-brain-lab.github.io/ONE/alf_intro.html) (see "A modular architecture for organizing, processing and sharing neurophysiology data," The International Brain Laboratory et al., 2023 Nat. Methods, [DOI](https://doi.org/10.1038/s41592-022-01742-6)).
9+
* Add **awsManager** to support AWS S3 storage. This is used to upload the task data to the AWS compatible data store linked to the Alyx session. This relies on the awscli command line tool to upload the data. You will need to install the AWS CLI and configure it with your AWS credentials. See [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) for more information. We use the cross-platform pixi package manager to install AWS CLI, using `pixi global install awscli` to install it.
10+
* **HED Tagging** -- we now support HED tagging of the session data. This is used to tag parameters with metadata that can be used for search / analysis. The tags are stored in a TSV file in the same folder as the raw session data. See `tools/HEDTags.m` and `tools/HEDTagger.m`. The HED tags are generated from the task sequence and the task parameters. We want to support better data sharing and Alyx / ONE protocol do not have any task metadata so we chose HED from the EEGLab / BIDS projects. See <https://www.hedtags.org> for details.
11+
* runExperiment -- big improvements to the logging system. Previously task events were stored in several places, but for Alyx / HED we need to centralise the event data. This is used to generate the HED tags and the Alyx session data.
12+
* Add **joystickManager** — we have built our own HID compatible joystick hardware and this manager interfaces with this hardware.
13+
* labJackT — we now send an 11bit strobed word rather than 8bit word. In theory this is backwards compatible, but you need to update the Lua server code running on the LabJack to use the 11bit word (`t = labJackT; t.initialiseServer`). 0-2047 controls EIO0-8 & CIO0-3.
14+
* Tobii eyetrackers — update Titta interface to support the new adaptive monkey calibration. See Niehorster, D. C., Whitham, W., Lake, B. R., Schapiro, S. J., Andolina, I. M., & Yorzinski, J. L. (2024). Enhancing eye tracking for nonhuman primates and other subjects unable to follow instructions: Adaptive calibration and validation of Tobii eye trackers with the Titta toolbox. Behavior Research Methods, 57(1), 0. https://doi.org/10.3758/s13428-024-02540-y for details.
15+
* **makeReport** — a new method in optickaCore thus available to all opticka objects. Uses the MATLAB report generator to make a PDF report of the data and property values contained in the core opticka classes (runExperiment, taskSequence, stateMachine, behaviouralRecord, tobii/eyelink/irec). Useful when analysing an experiment to get an overview of all experiment parameters for that session.
16+
* **circularMask Shader** — add a simple texture shader that provides a circular mask for any texture stimulus (like an image). This is better than using a separate disc shader. Used in imageStimulus and movieStimulus so you can alpha blend a masked image/movie against a complex background.
517

618
## V2.16.1 -- 106 files changed
719

820
> [!TIP]
921
> Please double-check changes in `DefaultStateInfo.m` to see the changes for state machine files, this may inform changes you could add to your own state machine files...
1022
1123

12-
* **BREAKING CHANGE**: we want to support the [International Brain Lab ONE Protocol](https://int-brain-lab.github.io/ONE/alf_intro.html) (see "A modular architecture for organizing, processing and sharing neurophysiology data," The International Brain Laboratory et al., 2023 Nat. Methods, [DOI](https://doi.org/10.1038/s41592-022-01742-6)), and we are now follwoing ALF filenaming for saved files. the root folder is still `OptickaFiles/savedData/` but now we use a folder hierarchy: ` subjectName / YYYY-MM-DD / SessionID /` -- the opticka `MAT` file will **not** change structure or content, but we will add extra metadata files to help data sharing in future releases.
24+
* **BREAKING CHANGE**: we want to support the [International Brain Lab ONE Protocol](https://int-brain-lab.github.io/ONE/alf_intro.html) (see "A modular architecture for organizing, processing and sharing neurophysiology data," The International Brain Laboratory et al., 2023 Nat. Methods, [DOI](https://doi.org/10.1038/s41592-022-01742-6)), and we are now follwoing ALF filenaming for saved files. the root folder is still `OptickaFiles/savedData/` but now we use a folder hierarchy: if the `labName` field is empty we use the shorter ` / subjectName / YYYY-MM-DD / SessionID-namedetails.mat` otherwise we use `/ labName / subjects / subjectName / YYYY-MM-DD / SessionID-namedetails.mat` -- the opticka `MAT` file will **not** change structure or content (it will remain backwards compatible), but we will add extra metadata files to help data sharing in future releases. We will add an ALYX API call to start a session in a future release.
1325
* **BREAKING CHANGE**: LabJack T4 -- we increased the strobe word from 8 to 11 bits, now on EIO1:8 CIO1:3, this should in theory be backwards compatible as 8bits is still the same lines. Upgrade the LabJack T4 (connected over USB) like this:
1426
```matlab
1527
t = labJackT();

CoreProtocols/PupillaryReflex.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@
6363
% rectangular.
6464
tS.firstFixRadius = 3;
6565
% do we forbid eye to enter-exit-reenter fixation window?
66-
tS.strict = true;
66+
tS.strict = false;
6767
% add an exclusion zone where subject cannot saccade to?
6868
tS.exclusionZone = [];
6969
% time to maintain fixation during stimulus state
70-
tS.stimulusFixTime = 1.25;
70+
tS.stimulusFixTime = 0.5;
7171
% Initialise eyetracker with X, Y, FixInitTime, FixTime, Radius, StrictFix values
7272
updateFixationValues(eT, tS.fixX, tS.fixY, tS.firstFixInit, tS.firstFixTime, tS.firstFixRadius, tS.strict);
7373

0 commit comments

Comments
 (0)