PDA

View Full Version : Another question ("Flagger???")


Elittdogg
08-31-2007, 07:36 AM
If I wanted to be able to "flag" (something like an event marker) a point (in time) in the data/output, how would I do that? I currently have no script for this nor do I know where to begin to look in the help menu. Basically, (if you've seen my previous thread) if there are objects on the wall, and I need to be able to determine when I get to each object (in the course of my scanning of the wall) how would I mark that so I could see that in the data?

If that's clear, then ignore what's next, but essentially, if I'm going from point A to point B to point C etc. is there a way to "flag" a point in the data for when I get to point A, B, C, etc. Like if someone were holding a clicker or an event marker.

I hope that's clear. Thank you for the help.

farshizzo
08-31-2007, 11:31 AM
Is your data output a text file? If so, you can mark the special event by writing some description to the file when it occurs.

Elittdogg
09-05-2007, 10:13 AM
I'm not sure if it's a text file. Here's a sample line of what I've got:

head_data = str(Subnum) + '\t' + str(HEADAP) + '\t' +str(HEADLAT) + '\t' +str(HEADVERT) + '\t' +str(HEADYAW) + '\t' +str(HEADPITCH) + '\t' +str(HEADROLL) +'\n'
tracking_data.write(head_data)

I don't know what kind of file that saves into. I think it might be the default file with vizard. But I need somehow to be able to indicate where in the data the user reaches each "landmark."

So again if you were traveling from A to B to C to D. I'd need to mark off when they get to B and then C and then D and so on.

farshizzo
09-05-2007, 01:12 PM
Vizard does not perform any automatic file saving. You are probably creating a file somewhere in your script and writing data to it. If you want to flag an event then you can do something like this:tracking_data.write('*** FLAG: reached A\n')If you are reading the data into another program you will need to modify the program so it can properly read in the flags.

Elittdogg
09-06-2007, 09:53 AM
What will this let me do? I don't really follow--how do I flag the data with this? Press a button? Hook an event marker up? Etc?

I think I'm just creating a text file and then writing the data from Vizard to the text file. That being said, will this "flag" work in that?

What I need to be able to do is for someone to be able to press a button, hit a key, or something that will "mark" that exact point in the data. So if I'm collecting data at 30Hz per second and I have "X" pts of data, I want to know how I could "flag/mark/identify" when I reach a certain point in the maze. So if I reach checkpoint 1 after 6 seconds, I want to be able to indicate that on the data in the text file. (But like if I could press a button on an event marker and have that somehow indicate in the data when I press that button on the event marker.)

(In this case, I'd need to hook up the event marker to the computer, get Vizard to recognize it, and then somehow utilize the pressing of the button on the event marker to "flag" a specific data point/point in time).

Sorry for all of the confusion, but I really appreciate the help. I'm very stuck.

farshizzo
09-06-2007, 10:33 AM
Based on the code you posted previously, your script will create some text file that contains a bunch of tab delimited numbers. By executing the line of code I mentioned, when the user reaches some point or when you press a button your text file will look something like this:1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
*** Reached point A
1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
*** Reached point B
1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
1 1.1 6.2 0.8 1.8 7.8 3.4
.
.
.
This will let you know at which point in the data the event occurred. It is up to you to know when to write this flag to the text file. If you want to add it when a key or button is pressed, then you will need to register an event callback. For example, the following code will write the flag to the file when the space key is pressed:def WriteFlag():
tracking_data.write('*** Reached point A\n')
vizact.onkeydown(' ',WriteFlag)If you want to add it when the user reaches some location, then you will need to manually detect if the user has reached the checkpoint, then write the flag to the file. Hope this clears it up a little, let me know if you still have questions.

Elittdogg
09-10-2007, 08:12 AM
Thank you so much. That really helps. Sorry for any confusion.