WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 06-13-2006, 03:00 PM
eagle112800 eagle112800 is offline
Join Date: Jun 2006
Posts: 2
python for psychophysical test

Vizar works great and the lab I am in uses it all of the time, but we are going to do an experement which requrers very acuret time stamping and of less then a milisecond.
I need to either find a way to make the VR see through headset load and run from matlab, or a way to create a meternome accuret to the milisicend and then record the keyboard imput with a time stamp and be able to make histograms matching the inital point of the key press with the closest time to the sound (this is much harder since I have the code written in matlab already). I need to also insert a delay in the headset at spific points and the intersence cube is not needed for this experement. Another optionwhich may be the easiest is to interface matlab and vizard, but I am not complytly sure how to do tell the programs what to do.


Reply With Quote
Old 06-13-2006, 10:50 PM
tobin tobin is offline
WorldViz Team Member
Join Date: Feb 2003
Posts: 251
I'm not sure how to start helping you out. Your questions are a bit vague. I'm sure there's a way to invoke a Vizard simulation from Matlab--at the very least you could write a MEX file that evokes a system call that runs a .PY script. Whether this satisfies your timing needs or not I have no idea.

Vizard 2.53 is generally only considered good for reaction time measurements to the nearest 1/60 s. Vizard R3 improves on this greatly and is expected to provide millisecond accurate timing information about keyboard events. If you're not already a beta tester for R3, you should write to and join so that you can try out one of the included sample programs that provides accurate timing.

Finally, there's a company called Cedrus that makes response boxes that contain their own timing circuits to allow you to collect button-press data with high-precision. Vizard has a plug-in to synchronize with Cedrus hardware.
Reply With Quote
Old 06-14-2006, 06:49 AM
eagle112800 eagle112800 is offline
Join Date: Jun 2006
Posts: 2
PY. script

Thank you for your help. As I am new to programing; how can I run the python script from matlab? Does that mean I can just drop the phython code into matlab add a few extra lines of code to let it know I am using phytopn. Then have matlab run the program using the phyton code for the headset, my program for the test and data recovory all at the same time. If that is true that would be great and the simplest way to make what I need to work.
Moreover, what do I need to tell matlab to do so it wil read the phyton code?

Reply With Quote
Old 06-14-2006, 10:19 AM
Gladsomebeast Gladsomebeast is offline
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
To run a Vizard/Python script from MathLab you should include a line in MathLab that executes the winviz.exe program with the Vizard/Python script you want to run as an argument. If you were executing a Vizard/Python program from the command line it would look like this: c:\winviz.exe

To do this in MathLab, you will have to look up how to execute an external program from a MathLab script. I am unfamiliar with MathLab so I don't know how this is done. Probably some function called fork, exec, or spawn.

This assumes that there is no interaction between Vizard/Python and the MathLab code.
Paul Elliott
WorldViz LLC
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 10:41 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC