|
Group: Forum Members
Posts: 13,
Visits: 58
|
Hi, I am currently programming a fear conditioning task in Inquisit 7 and I would like to synchronize stimulus presentation with electrodermal activity recorded using an Empatica EmbracePlus device. My goal is to obtain, for each stimulus onset, an absolute timestamp that can be converted or matched to Empatica timestamps, which are expressed as UNIX timestamps in UTC, typically in microseconds. I understand that script.currentTime returns the current time only with second-level precision, while script.elapsedTime provides millisecond precision from the start of the script. However, I would like to know what is the cleanest and most accurate method to obtain an absolute stimulus onset time with millisecond precision. More specifically: 1. Is there a built-in property in Inquisit 7 that provides the absolute time of a stimulus onset with millisecond precision? 2. Should I use properties such as stimulusOnsetTime or stimulusOnsetTimestamp for this purpose? 3. Are these values based on the actual onset of the stimulus on screen, or on the scheduled onset in the trial? 4. Is it possible to export an absolute UTC timestamp directly from Inquisit? 5. If not, what would be the recommended procedure to reconstruct an absolute UNIX timestamp from script.elapsedTimeand the script start time? At the moment, my intended workflow is to export the Inquisit event script.currentTime, convert the stimulus onset times to UNIX timestamps in microseconds, and then align them with the Empatica EDA data in post-processing. Could you please confirm the most reliable way to do this in Inquisit 7? Thank you very much for your help. Best regards, Thierry
|
|
Group: Administrators
Posts: 13K,
Visits: 110K
|
+xHi, I am currently programming a fear conditioning task in Inquisit 7 and I would like to synchronize stimulus presentation with electrodermal activity recorded using an Empatica EmbracePlus device. My goal is to obtain, for each stimulus onset, an absolute timestamp that can be converted or matched to Empatica timestamps, which are expressed as UNIX timestamps in UTC, typically in microseconds. I understand that script.currentTime returns the current time only with second-level precision, while script.elapsedTime provides millisecond precision from the start of the script. However, I would like to know what is the cleanest and most accurate method to obtain an absolute stimulus onset time with millisecond precision. More specifically: 1. Is there a built-in property in Inquisit 7 that provides the absolute time of a stimulus onset with millisecond precision? 2. Should I use properties such as stimulusOnsetTime or stimulusOnsetTimestamp for this purpose? 3. Are these values based on the actual onset of the stimulus on screen, or on the scheduled onset in the trial? 4. Is it possible to export an absolute UTC timestamp directly from Inquisit? 5. If not, what would be the recommended procedure to reconstruct an absolute UNIX timestamp from script.elapsedTimeand the script start time? At the moment, my intended workflow is to export the Inquisit event script.currentTime, convert the stimulus onset times to UNIX timestamps in microseconds, and then align them with the Empatica EDA data in post-processing. Could you please confirm the most reliable way to do this in Inquisit 7? Thank you very much for your help. Best regards, Thierry I think what you want is the stimulusOnsetTime property, which should give you the precise onset date and time in UTC, including milliseconds. You can then apply Date.parse() to the value to get the UNIX timestamp. In a nutshell: <values> / onsetTimeUTC = null / unixTimestamp = null </values>
<text myText> / items = ("Press the space bar to continue") / fontStyle = ("Arial", 2.08%, false, false, false, false, 5, 1) </text>
<trial myTrial> / onTrialEnd = { values.onsetTimeUTC = text.myText.stimulusOnsetTime; values.unixTimestamp = Date.parse(text.myText.stimulusOnsetTime); } / preTrialPause = 500 / stimulusTimes = [1=myText] / validResponse = (" ") </trial>
<block myBlock> / trials = [1-10=myTrial] </block>
<expt myExpt> / blocks = [1=myBlock] </expt>
<data> / columns = (date, time, subject, group, session, blockNum, blockCode, trialNum, trialCode, response, latency, correct, values.onsetTimeUTC, values.unixTimestamp) </data> Example output: date time subject group session blockNum blockCode trialNum trialCode response latency correct onsetTimeUTC unixTimestamp 2026-06-19 14:16:27 1 1 1 1 myBlock 1 myTrial 57 719 0 2026-06-19T12:16:28.649Z 1781871388649 2026-06-19 14:16:27 1 1 1 1 myBlock 2 myTrial 57 297 0 2026-06-19T12:16:29.891Z 1781871389891 2026-06-19 14:16:27 1 1 1 1 myBlock 3 myTrial 57 1860 0 2026-06-19T12:16:30.715Z 1781871390715 2026-06-19 14:16:27 1 1 1 1 myBlock 4 myTrial 57 859 0 2026-06-19T12:16:33.087Z 1781871393087 2026-06-19 14:16:27 1 1 1 1 myBlock 5 myTrial 57 297 0 2026-06-19T12:16:34.453Z 1781871394453 2026-06-19 14:16:27 1 1 1 1 myBlock 6 myTrial 57 312 0 2026-06-19T12:16:35.257Z 1781871395257 2026-06-19 14:16:27 1 1 1 1 myBlock 7 myTrial 57 312 0 2026-06-19T12:16:36.081Z 1781871396081 2026-06-19 14:16:27 1 1 1 1 myBlock 8 myTrial 57 297 0 2026-06-19T12:16:36.904Z 1781871396904 2026-06-19 14:16:27 1 1 1 1 myBlock 9 myTrial 57 344 0 2026-06-19T12:16:37.729Z 1781871397729 2026-06-19 14:16:27 1 1 1 1 myBlock 10 myTrial 57 656 0 2026-06-19T12:16:38.573Z 1781871398573
|
|
Group: Forum Members
Posts: 13,
Visits: 58
|
+x+xHi, I am currently programming a fear conditioning task in Inquisit 7 and I would like to synchronize stimulus presentation with electrodermal activity recorded using an Empatica EmbracePlus device. My goal is to obtain, for each stimulus onset, an absolute timestamp that can be converted or matched to Empatica timestamps, which are expressed as UNIX timestamps in UTC, typically in microseconds. I understand that script.currentTime returns the current time only with second-level precision, while script.elapsedTime provides millisecond precision from the start of the script. However, I would like to know what is the cleanest and most accurate method to obtain an absolute stimulus onset time with millisecond precision. More specifically: 1. Is there a built-in property in Inquisit 7 that provides the absolute time of a stimulus onset with millisecond precision? 2. Should I use properties such as stimulusOnsetTime or stimulusOnsetTimestamp for this purpose? 3. Are these values based on the actual onset of the stimulus on screen, or on the scheduled onset in the trial? 4. Is it possible to export an absolute UTC timestamp directly from Inquisit? 5. If not, what would be the recommended procedure to reconstruct an absolute UNIX timestamp from script.elapsedTimeand the script start time? At the moment, my intended workflow is to export the Inquisit event script.currentTime, convert the stimulus onset times to UNIX timestamps in microseconds, and then align them with the Empatica EDA data in post-processing. Could you please confirm the most reliable way to do this in Inquisit 7? Thank you very much for your help. Best regards, Thierry I think what you want is the stimulusOnsetTime property, which should give you the precise onset date and time in UTC, including milliseconds. You can then apply Date.parse() to the value to get the UNIX timestamp. In a nutshell: <values> / onsetTimeUTC = null / unixTimestamp = null </values>
<text myText> / items = ("Press the space bar to continue") / fontStyle = ("Arial", 2.08%, false, false, false, false, 5, 1) </text>
<trial myTrial> / onTrialEnd = { values.onsetTimeUTC = text.myText.stimulusOnsetTime; values.unixTimestamp = Date.parse(text.myText.stimulusOnsetTime); } / preTrialPause = 500 / stimulusTimes = [1=myText] / validResponse = (" ") </trial>
<block myBlock> / trials = [1-10=myTrial] </block>
<expt myExpt> / blocks = [1=myBlock] </expt>
<data> / columns = (date, time, subject, group, session, blockNum, blockCode, trialNum, trialCode, response, latency, correct, values.onsetTimeUTC, values.unixTimestamp) </data> Example output: date time subject group session blockNum blockCode trialNum trialCode response latency correct onsetTimeUTC unixTimestamp 2026-06-19 14:16:27 1 1 1 1 myBlock 1 myTrial 57 719 0 2026-06-19T12:16:28.649Z 1781871388649 2026-06-19 14:16:27 1 1 1 1 myBlock 2 myTrial 57 297 0 2026-06-19T12:16:29.891Z 1781871389891 2026-06-19 14:16:27 1 1 1 1 myBlock 3 myTrial 57 1860 0 2026-06-19T12:16:30.715Z 1781871390715 2026-06-19 14:16:27 1 1 1 1 myBlock 4 myTrial 57 859 0 2026-06-19T12:16:33.087Z 1781871393087 2026-06-19 14:16:27 1 1 1 1 myBlock 5 myTrial 57 297 0 2026-06-19T12:16:34.453Z 1781871394453 2026-06-19 14:16:27 1 1 1 1 myBlock 6 myTrial 57 312 0 2026-06-19T12:16:35.257Z 1781871395257 2026-06-19 14:16:27 1 1 1 1 myBlock 7 myTrial 57 312 0 2026-06-19T12:16:36.081Z 1781871396081 2026-06-19 14:16:27 1 1 1 1 myBlock 8 myTrial 57 297 0 2026-06-19T12:16:36.904Z 1781871396904 2026-06-19 14:16:27 1 1 1 1 myBlock 9 myTrial 57 344 0 2026-06-19T12:16:37.729Z 1781871397729 2026-06-19 14:16:27 1 1 1 1 myBlock 10 myTrial 57 656 0 2026-06-19T12:16:38.573Z 1781871398573 Perfect ! thank you !
|