Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combine data over sessions
#1
Hi all,

I'm running some benchtests and testing my protocols atm. What I would like to do is plot an average (over several sessions) performance plot as well as an outcome plot. I would like to extract the data from one subfolder (so for each protocol) and from this, plot averages. However, I cannot get it running in Matlab. Could somebody help me out with this problem?

Cheers,
David
Reply
#2
Hi David

Data from Bpod sessions are saved to disk, as a .mat file containing a MATLAB struct.
The fields of the struct are:
-nTrials (the number of trials recorded in the session)
-RawEvents (a human-readable data structure, containing timestamps for each trial's state transitions and recorded events)
-RawData (a data structure with a copy of the raw data returned from the state machine; this is an uglier version of same data contained in fields: RawEvents and TrialStartTimestamp)
-TrialStartTimestamp (the time when the trial started as recorded by Bpod's clock) Note: Timestamps in RawEvents are relative to each trial's start
-SettingsFile (the settings file you selected in the launch manager)

Also, any fields your protocol added to BpodSystem.Data are stored as additional fields of the data struct.

To combine data across sessions, you'd write a MATLAB script to iterate across the session files you want to combine, and concatenate their fields into a new "master" struct. Since it's hard to anticipate how user-added fields of BpodSystem.Data are formatted, we left the task of writing this code to the user.

-Josh
Reply
#3
(12-20-2017, 01:45 PM)Josh Wrote: Hi David

Data from Bpod sessions are saved to disk, as a .mat file containing a MATLAB struct.
The fields of the struct are:
-nTrials (the number of trials recorded in the session)
-RawEvents (a human-readable data structure, containing timestamps for each trial's state transitions and recorded events)
-RawData (a data structure with a copy of the raw data returned from the state machine; this is an uglier version of same data contained in fields: RawEvents and TrialStartTimestamp)
-TrialStartTimestamp (the time when the trial started as recorded by Bpod's clock) Note: Timestamps in RawEvents are relative to each trial's start
-SettingsFile (the settings file you selected in the launch manager)

Also, any fields your protocol added to BpodSystem.Data are stored as additional fields of the data struct.

To combine data across sessions, you'd write a MATLAB script to iterate across the session files you want to combine, and concatenate their fields into a new "master" struct. Since it's hard to anticipate how user-added fields of BpodSystem.Data are formatted, we left the task of writing this code to the user.

-Josh

Thanks for your reply.


I have a question related to the following. In the SessionData structure, all events are being tracked. Say, input event 'Port1In' (a nose poke) occurs at different timepoints throughout the session. Does Bpod store all of these timepoints, independently of whether they were programmed in the protocol to cause a StateChangeCondition? Or is data related to an event like Port1In only stored if that specific input causes a transition to the next state?

Cheers,
David

(12-20-2017, 01:45 PM)Josh Wrote: Hi David

Data from Bpod sessions are saved to disk, as a .mat file containing a MATLAB struct.
The fields of the struct are:
-nTrials (the number of trials recorded in the session)
-RawEvents (a human-readable data structure, containing timestamps for each trial's state transitions and recorded events)
-RawData (a data structure with a copy of the raw data returned from the state machine; this is an uglier version of same data contained in fields: RawEvents and TrialStartTimestamp)
-TrialStartTimestamp (the time when the trial started as recorded by Bpod's clock) Note: Timestamps in RawEvents are relative to each trial's start
-SettingsFile (the settings file you selected in the launch manager)

Also, any fields your protocol added to BpodSystem.Data are stored as additional fields of the data struct.

To combine data across sessions, you'd write a MATLAB script to iterate across the session files you want to combine, and concatenate their fields into a new "master" struct. Since it's hard to anticipate how user-added fields of BpodSystem.Data are formatted, we left the task of writing this code to the user.

-Josh

Thanks for your reply.


I have a question related to the following. In the SessionData structure, all events are being tracked. Say, input event 'Port1In' (a nose poke) occurs at different timepoints throughout the session. Does Bpod store all of these timepoints, independently of whether they were programmed in the protocol to cause a StateChangeCondition? Or is data related to an event like Port1In only stored if that specific input causes a transition to the next state?

Cheers,
David
Reply
#4
Hi David

All events (regardless of whether they caused state transitions) are recorded in your data file.

-Josh
Reply


Forum Jump: