|
Size: 1924
Comment:
|
Size: 4028
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| When using E-Prime with a SMI eye tracker, E-Prime should communicate with iView X, the eye tracking software, to stop and stop the recording, indicate the start of each trial and save the data. The way SMI prefer to do this is using an ethernet connection and the UDP protocol, but E-Prime cannot handle this. The only way, at the moment, is by using the serial port. To do this you wil have to add the following things to your E-Prime script: | == Running an Eye tracking experiment with E-Prime == |
| Line 3: | Line 3: |
| 1 - Create a 'Serial' device, by going to 'Experiment object' properties, then selecting the 'Devices' tab, then 'Add' and 'Serial'. The default settings should work. | When using E-Prime with a SMI eye tracker, E-Prime should communicate with iView X, the eye tracking software, to start and stop the recording, indicate the start of each trial, specify the stimulus used and finally save the data. The way SMI prefer to do this is by using an ethernet connection and the UDP protocol, but E-Prime cannot handle this. The only way, at the moment, is by using the serial port. To do this you wil have to add the following things to your E-Prime script: 1 - Create a 'Serial' device, by going to 'Experiment object' properties, then selecting the 'Devices' tab, then 'Add' and 'Serial'. The default settings should work. In the next sections I assume you have named the device 'Serial'. |
| Line 7: | Line 9: |
| ' Flush serial connection and clear eye tracker recording buffer Serial.FlushOutBuffer | {{{ ' Flush serial connection and clear eye tracker recording buffer |
| Line 9: | Line 12: |
| dim strData as string strData = "ET_CLR" & Chr(10) & Chr(13) | Serial.FlushOutBuffer |
| Line 11: | Line 14: |
| dim strData as string strData = "ET_CLR" & Chr(10) & Chr(13) |
|
| Line 15: | Line 20: |
| strData = "ET_REC" & Chr(10) & Chr(13) Serial.WriteString strData | strData = "ET_REC" & Chr(10) & Chr(13) Serial.WriteString strData }}} |
| Line 17: | Line 24: |
| 3 - at the start of each trial, or just before your main stimulus is being presented, add this: | 3 - At the start of each trial, or just before your main stimulus is being presented, add a 'remark line', preferably with your stimulus name as an argument (NB if you are presenting images, sending the name of the image file you are presenting will greatly facilitate analysis using the BeGaze software, as the associations between the trial and image will then be made automatically by the software. For more info, see BeGaze): |
| Line 19: | Line 26: |
| {{{ | |
| Line 20: | Line 28: |
| strData = "ET_REM " & c.GetAttrib("stim") & Chr(10) & Chr(13) Serial.WriteString strData }}} 4 - Finally, at the end of th experiment put these lines in an inline object: {{{ ' Stop eye tracking recording |
|
| Line 21: | Line 35: |
| strData = "ET_REM " & c.GetAttrib("facestim") & Chr(10) & Chr(13) |
strData = "ET_STP" & Chr(10) & Chr(13) |
| Line 25: | Line 38: |
| 4 - Finally, at the end of th experiment put these lines in an inline object: | ' Save eyetracking data in a file with a subject, session etc. dim filename as string fileName = str(c.GetAttrib("Subject")) & "_" & str(c.GetAttrib("Session")) & ".idf" strData = "ET_SAV C:\\" & fileName & Chr(10) & Chr(13) Serial.WriteString strData }}} Obviously, the filename can be changed to whatever is best for you. Note that iView X cannot save to a directory that doesn't exist, so make sure to either create the correct directory, or write to root. |
| Line 27: | Line 46: |
| ' Stop eye tracking recording strData = "ET_STP" & Chr(10) & Chr(13) Serial.WriteString strData | == Running the script == |
| Line 29: | Line 48: |
| ' save eyetracking data in a file with a subject, session, and scan run-dependent filename: dim filename as string fileName = str(c.GetAttrib("Subject")) & "_" & str(c.GetAttrib("Session")) & ".idf" strData = "ET_SAV C:\\" & fileName & Chr(10) & Chr(13) Serial.WriteString strData | When running the script you should go through these steps: |
| Line 31: | Line 50: |
| Obviously, the filename can be changed to whatever is best for you. Note that iView X cannot save to a directory that doesn't exist, so make sure to either create the correct directory, or write to root. | 1 - Switch on the eye tracking hardware and install your subject. 2 - Start the iView X program on the eye tracking computer. 3 - Make sure the eye picture looks good and the eye gaze is correctly tracked. Verify this by asking the subject to look at all 4 corners of the screen. 4 - Start the 'WinCal' program on the stimulus presentation computer. 5 - Click on the calibration button in iView X. The stimulus presentation machine should now present a screen with a calibration dot. Press space on the eye tracking machine to start calibration. The dot should move around the screen. 6 - After succesful calibration, close down WinCal on the stimulus presentation machine. 7 - Start your E-Prime script. iView X should indicate that it is recording. == Calibration from within E-Prime == The calibration can also be performed by E-Prime. To be able to do this you need to incorporate a bit of inline code in your E-Prime script. This code will communicate with the eye tracker software and put targets on the screen in response to requests from iView X. The inline code is currently only available from Maarten van Casteren, but will hopefully be published on this page when it has been proved stable enough for general use. The main advantage of letting E-Prime take care of the calibration is that you don't have to use WinCal any more. Just start your E-Prime script and it will start the recording, do the calibration, mark the trials, stop the recording and save the results to disk. |
Running an Eye tracking experiment with E-Prime
When using E-Prime with a SMI eye tracker, E-Prime should communicate with iView X, the eye tracking software, to start and stop the recording, indicate the start of each trial, specify the stimulus used and finally save the data. The way SMI prefer to do this is by using an ethernet connection and the UDP protocol, but E-Prime cannot handle this. The only way, at the moment, is by using the serial port. To do this you wil have to add the following things to your E-Prime script:
1 - Create a 'Serial' device, by going to 'Experiment object' properties, then selecting the 'Devices' tab, then 'Add' and 'Serial'. The default settings should work. In the next sections I assume you have named the device 'Serial'.
2 - At the start of your experiment, when you want the eye tracker to start recording, add these lines, in an inline object:
' Flush serial connection and clear eye tracker recording buffer Serial.FlushOutBuffer dim strData as string strData = "ET_CLR" & Chr(10) & Chr(13) Serial.WriteString strData ' Start eye tracker recording strData = "ET_REC" & Chr(10) & Chr(13) Serial.WriteString strData
3 - At the start of each trial, or just before your main stimulus is being presented, add a 'remark line', preferably with your stimulus name as an argument (NB if you are presenting images, sending the name of the image file you are presenting will greatly facilitate analysis using the BeGaze software, as the associations between the trial and image will then be made automatically by the software. For more info, see BeGaze):
Dim strData As String
strData = "ET_REM " & c.GetAttrib("stim") & Chr(10) & Chr(13)
Serial.WriteString strData4 - Finally, at the end of th experiment put these lines in an inline object:
' Stop eye tracking recording
strData = "ET_STP" & Chr(10) & Chr(13)
Serial.WriteString strData
' Save eyetracking data in a file with a subject, session etc.
dim filename as string
fileName = str(c.GetAttrib("Subject")) & "_" & str(c.GetAttrib("Session")) & ".idf"
strData = "ET_SAV C:\\" & fileName & Chr(10) & Chr(13)
Serial.WriteString strDataObviously, the filename can be changed to whatever is best for you. Note that iView X cannot save to a directory that doesn't exist, so make sure to either create the correct directory, or write to root.
Running the script
When running the script you should go through these steps:
1 - Switch on the eye tracking hardware and install your subject.
2 - Start the iView X program on the eye tracking computer.
3 - Make sure the eye picture looks good and the eye gaze is correctly tracked. Verify this by asking the subject to look at all 4 corners of the screen.
4 - Start the 'WinCal' program on the stimulus presentation computer.
5 - Click on the calibration button in iView X. The stimulus presentation machine should now present a screen with a calibration dot. Press space on the eye tracking machine to start calibration. The dot should move around the screen.
6 - After succesful calibration, close down WinCal on the stimulus presentation machine.
7 - Start your E-Prime script. iView X should indicate that it is recording.
Calibration from within E-Prime
The calibration can also be performed by E-Prime. To be able to do this you need to incorporate a bit of inline code in your E-Prime script. This code will communicate with the eye tracker software and put targets on the screen in response to requests from iView X. The inline code is currently only available from Maarten van Casteren, but will hopefully be published on this page when it has been proved stable enough for general use.
The main advantage of letting E-Prime take care of the calibration is that you don't have to use WinCal any more. Just start your E-Prime script and it will start the recording, do the calibration, mark the trials, stop the recording and save the results to disk.
