Pupil tracking using Bonsai

208 views
Skip to first unread message

Subhiksha S

unread,
May 2, 2021, 11:13:44 PM5/2/21
to Bonsai Users
Hello, 

I'm pretty new to Bonsai and I'm using it to do pupil tracking for mice. I found a couple of reference workflows to work with for this. All I need with the pupil tracking are the X and  Y cooridnates of the pupil as it moves. What would you suggest I do?

Gonçalo Lopes

unread,
May 9, 2021, 6:11:21 PM5/9/21
to Subhiksha S, Bonsai Users
Hi Subhiksha,

You mention finding reference workflows you tried to use for this, can you share them with us and explain what you have tried so far? Also example videos would be very useful to understand your imaging conditions, which may make the problem much easier or much harder.

On Mon, 3 May 2021 at 04:13, Subhiksha S <subhi...@gmail.com> wrote:
Hello, 

I'm pretty new to Bonsai and I'm using it to do pupil tracking for mice. I found a couple of reference workflows to work with for this. All I need with the pupil tracking are the X and  Y cooridnates of the pupil as it moves. What would you suggest I do?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/9cd7fa33-5b13-43f3-8694-6de5def1f58en%40googlegroups.com.

Subhiksha S

unread,
May 9, 2021, 6:18:58 PM5/9/21
to Gonçalo Lopes, Bonsai Users
 I used a similar workflow I found on one this forum to implement it. It's working now, kind of, but the contrast isn't too great with the video we captured - could be a problem with data acquisition that we're working on fixing. Pupil is the trial video. I've also attached the video we recorded and are trying to work with. I got it to plot the centroid but I wanted to know if there was an easy way to automate the thresholding based on imaging conditions - preferably while capturing data realtime and feeding it into bonsai. (Attaching the videos as a drive link as it's too large to upload) 

Another follow up I had was how to get this plot for the centroid from Bonsai to an Analog system using NI DAQ. 

Thank you so much for your help!  

Pupiltracking.bonsai
Message has been deleted

Gonçalo Lopes

unread,
May 16, 2021, 2:05:25 PM5/16/21
to Subhiksha S, Bonsai Users
Hi Subhiksha,

On the video you sent it looks like one of the whiskers is blocking the pupil almost completely. That will make it much harder to develop a stable algorithm. Is there a way you could change the camera orientation to have an unobstructed view of the pupil?


On Sun, 9 May 2021 at 23:19, Subhiksha S <subhi...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages