MWorks Draft for Monkey Hexagonal Grid Task

Hi Chris,

I hope you’re doing well. My name is Kanishka Mitra, and I recently joined Mehrdad Jazayeri’s lab as a new graduate student. I’ve not previously worked with MWorks and could use some guidance to get started.

Mehrdad and I have designed a specific monkey task, and I’ve been informed that you’re experienced with MWorks and could help create an initial draft and backbone for this task. I’ve prepared a detailed description of the task and attached a PowerPoint presentation as a visual aid:

Hexagonal Grid Interaction Task

Project Overview:

We are developing an experimental task for rhesus macaques involving interaction with a dynamically adjustable hexagonal grid displayed on a screen. The monkey’s interaction will initially be simulated through mouse clicks. This software forms the backbone of our research experiment, and future phases will integrate motion-capture (hand-tracking) and eye-tracking systems.

Detailed Task Description:

  1. Hexagonal Grid Structure:

    • Create a symmetrical hexagonal grid composed of multiple hexagons.
    • The size of the grid should be dynamically adjustable through a parameter specifying the number of hexagons per side (refer to the attached PowerPoint for a visual reference).
    • Each hexagon should initially appear white with clear black borders.
  2. Pattern Management:

    • Patterns will consist of certain hexagons being “greyed-out” or set to specific colors.
    • Patterns will be managed separately (e.g., external script or easily editable JSON/Python list). Each pattern explicitly identifies which hexagons are involved and their colors.
    • The software should allow easy addition and modification of these patterns. Initially, the default pattern color is black, but this must be a configurable variable.
  3. Trial Structure: Each trial should follow these phases clearly:

    • Phase A – Initiation:

      • A plain white screen with an orange hexagon button at the bottom-center is presented.
      • The monkey initiates the trial by clicking and holding the orange button for a preset duration (default: 1 second). This hold duration must be adjustable via an easily modifiable parameter.
    • Phase B – Planning:

      • Upon successful initiation, display the hexagonal grid with a randomly selected pattern (from the patterns list) visibly “greyed-out.” Hexagons marked in this planning phase should not be interactive (no clicks registered).
      • The planning duration should be set via a configurable parameter (default: 1 second).
    • Phase C – Execution:

      • After the planning period, present an auditory “go” cue sound (e.g., bell sound).
      • Immediately after this cue, the previously greyed-out hexagons should become their assigned color (defined by the selected pattern).
      • The monkey can now interact with these colored hexagons through mouse clicks.
      • Upon clicking a hexagon correctly, it should fade from its colored state back to white (matching the other hexagons).
      • Once all hexagons in the current pattern have been clicked (and thus returned to white), the trial successfully concludes.
    • Phase D – Reward & Reset:

      • Upon trial completion, the software should trigger a reward event (for now, this can simply be indicated by printing “Reward Delivered” to the console—actual reward delivery hardware integration will come later).
      • Automatically reset the screen to Phase A for the next trial.
  4. Pattern Randomization:

    • Patterns must be presented in a fully randomized order for each new trial, ensuring no predictable sequences.
  5. Future Considerations:

    • Mouse clicks currently simulate the monkey’s touch. Ensure the software architecture allows easy future integration of hand-position data from a motion-capture system (the 2D mouse coordinates can be set from an external source).
    • The structure should also be compatible with the future integration of eye-tracking data.

Please let me know if you’re available to help with this and if you have any questions or need further clarification. I’d greatly appreciate your support and expertise!

Thank you very much in advance.

Best,
Kanishka

Hi Kanishka,

Thank you for the detailed description of your task. I will try to get an initial implementation of it to you sometime in the next two weeks.

Cheers,
Chris

Sounds great! Thanks for your help!

Best,
Kanishka

Hi Kanishka,

Quick update: I’m making progress on this, but I won’t be able to finish it this week. I’m going to be away on vacation next week, so hopefully I’ll be able to get it to you the week of Aug. 18.

Also, a few questions:

  1. Does the order in which the monkey clicks the hexagons matter, or is any order OK, so long as all the colored hexagons are clicked?
  2. When you say each clicked hexagon “should fade from its colored state back to white”, do you mean you want a literal fade (extended in time), or can the color transition be instantaneous? An extended fade is possible but more difficult to implement.

Thanks,
Chris

Hi Chris,

No worries - the week of the 18th works for me.

Here are the answers to your questions:

  1. Yes, any order is fine.

  2. That is a good point, I think the fading is irrelevant. So, let’s have it instantaneous.

Best,
Kanishka

Hi Kanishka,

I’ve attached a first draft of the hexagonal grid task. To run it, unzip the archive, then load task.mwel in MWorks.

The experiment uses Python code to generate and select the patterns. At present, the patterns are random, but you can change the code to work any way you like.

The active touch area for each hexagon is just the circle it inscribes, because that was easy to implement. If you want the entire hexagon to be touch sensitive, you’ll need to modify the macro touch_on_hexagon.

When you have a chance, please try this out, and let me know if you have any questions.

Cheers,
Chris
hexagonal_grid_task.zip (76.4 KB)

Hi Chris,

Thank you so much! I have been traveling back at home, so I’m going to test this out tomorrow and let you know how it goes.

Best,
Kanishka