Re: Special Case Random Dot Kinematogram

362 views
Skip to first unread message

dani

unread,
Dec 4, 2012, 3:53:47 AM12/4/12
to psychop...@googlegroups.com
Hello, did you have progress on this? 

I am facing a similar problem. I want to use DotStim in a way in which each dot is composed of two gaussian separate by some distance. I don't need them to move relative to each other. 

I modified the dot_gabors.py demo (attached) replacing the gabors by a costume texture that included two gaussians. My problem now is that the grey color is not transparent so the textures occluded themselves.  

dani

On Tuesday, 27 November 2012 16:50:46 UTC+9, Andy S wrote:
Hello, I'm just getting acquainted with Python and Psychopy and I have an issue that I haven't been able to find a solution for.

The stimuli I am trying to create involves something like a random dot kinematogram. However, each dot must be paired with another identical dot except its center is X pixels to the right of the original dot, and these pairs would then have some correlated motion direction (move in parallel, or move through each other, etc) and disappear at the same time.

I've had some success using ElementArrayStim, but the problem is I've been able to make N pairs of dots, but now all N pairs are correlated together and move in parallel, and all have the same life-time, but what I really want is to have each pair move around and disappear independently and uncorrelated with the other pairs.

How could I go about creating what I'm looking for (an rdk with two-dot elements rather than single dot elements)? If there was a way to record the position/velocities of the dots created using DotStim, and reproduce those (while adding a certain amount of displacement), I think that would help get me what I need, but I don't know of how to do this.

Thank you in advance for guidance,

Andy
pruOrientation.py

Jonathan Peirce

unread,
Dec 4, 2012, 4:38:41 AM12/4/12
to psychop...@googlegroups.com
Andy, Dani,

For both of you I think I would suggest simply using ElementArray and setting the XY positions of your elements on each frame. That's really all that DotStim is doing for you and that's the part that you're wanting done differently. Dani, especially for you, using a texture as a dot, you should use element arrays - it has more efficient rendering for complex elements than dotstim does.

You will need to do your own working through on getting the right algorithm for the dot motions (look at the contents of DotStim._update_dotsXY to see a few examples for different motions. Really try to avoid for-loops for these calculations - they're slow and unless you're using a really fast computer or very few dots it will cause dropped frames. You should try to use numpy array manipulations instead.

Jon
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/iYpXife8s5QJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk



Andy S

unread,
Dec 4, 2012, 1:04:46 PM12/4/12
to psychop...@googlegroups.com
Thanks for the responses. I'm really new to Python and a little confused about how to get to DotStim._update_dotsXY. I found a copy of the script online, but is there a way to get to the real version installed on my computer? I guess what I'm asking is if there's exists something analogous to the matlab "edit XXX" function.

Jonathan Peirce

unread,
Dec 5, 2012, 4:21:43 AM12/5/12
to psychop...@googlegroups.com
There isn't - you need to find the file manually. It's visual.py which will be in your Program Files on windows or contained within the app bundle on a mac.

But you probably don't need to edit the one that's installed - I'm just suggesting that you look at it to get ideas about how the update rules might work.

Jon
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/7030UmkFassJ.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
-- 
Jonathan Peirce
Nottingham Visual Neuroscience

Reply all
Reply to author
Forward
0 new messages