LED light for trigger signal

256 views
Skip to first unread message

Iris HongChae B.

unread,
Jun 10, 2019, 11:30:06 AM6/10/19
to Bonsai Users
Hello, I am a new user for Bonsai and I'm having a trouble how to put the trigger signal in my final results.

I am tracking mouse movement while I am stimulating its brain, and the stimulation is every 5 second for 300 ms duration.
I used matlab code to sync the Arduino LED with function generator which triggers the stimulation.
But, now I don't know how to use another region of interest to monitor the LED region separate from the mouse arena, and somehow merge that blinking signal into final results (centroid X, Y).
I attached the matlab code and my current work flow. Please let me know if you know any better ways to solve this problem.

Thank you!
FunctionGeneratorBlocks_v4_wArduino.m
TrackMouse_locomotion.bonsai

Gonçalo Lopes

unread,
Jun 15, 2019, 8:27:09 AM6/15/19
to Iris HongChae B., Bonsai Users
Hi Iris

You can create another branch to process an independent ROI just for the stimulation LED, for example:

branch_led.png

You just need to configure the second Crop to point at your LED. I would remove the ObjectDetection condition from data logging, otherwise you will not know when the animal was visible versus not. This also makes sure that all results in each file come from the same video frame.

You can create branches in the workflow by holding Alt while you insert a node, more information here:

Hope this helps.


--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/bonsai-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/64cd30b6-7b74-4bd8-ac9c-b2f5e21fe7e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages