How to include ElectricalSeries/SpatialSeries in trials ? #79
Replies: 3 comments 1 reply
-
I would generally keep the You are right that then if you wanted to associate a single trial to a particular range of those other objects, you would use for example a The philosophy being that 'trials' are just another data stream occurring during the session, and NWB containerizes all data streams related to the session, such that you can associate events between and across all the contents. Links between objects are, from that perspective, just there as 'helpers' or 'convenience' to draw attention or simplify indexing during analysis |
Beta Was this translation helpful? Give feedback.
-
Does it mean that it is not relevant for non-continuous data with unknown time gaps? (such as multiple trials without the information of starting time of trial) Or would you store the trial's data using velocity_x = []
velocity_y = []
features = []
for i_trial in range(n_trials):
velocity_x.append(np.random.rand(n_times))
velocity_y.append(np.random.rand(n_times))
features.append(np.random.rand(n_times, n_channels, n_features))
velocity_nwb = pynwb.behavior.SpatialSeries(
name="velocity_x",
description="velocity",
data=velocity_x,
reference_frame="unknown",
timestamps=np.arange(n_times),
)
features_nwb = pynwb.base.ProcessingModule(
description="features",
name="features",
data_interfaces=[pynwb.ecephys.FeatureExtraction(
name=f"features_{i_trial}",
electrodes=all_table_region,
description=[
f"feature no {i_feat}" for i_feat in range(n_features)
],
times=np.arange(n_times),
features=np.random.rand(n_times, n_channels, n_features)
) for i_trial in range(n_trials)
])
nwbfile.add_acquisition(features_nwb)
nwbfile.add_acquisition(velocity_nwb) |
Beta Was this translation helpful? Give feedback.
-
Wouldn't that mean that you also don't know the In general, unknown time gaps are not supported by core NWB. There are some extensions in progress that try to deal with this but none I know of that are popular or in common use yet In general it also represents quite a significant loss of information that can impede other types of data reuse, one example being plasticity studies (looking at how the neural activity being monitored might change over time). Just knowing that trial index 5 occurred 'some time' after trial index 4, but with an unknown delay between them may not be sufficient in that case Out of curiosity, is there a hardware constraint that would prevent this information from being recorded? Even if they are not perfectly aligned signals such as TTLs to a common clock, relying on something less precise like wallclock time would still be better than nothing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using a public dataset from which I have Spatial data ((x,y)-hand velocity) and LFP (spectral) features for multiple trials. I don't have continuous data, so I plan to store them under
pynwb.file.NWBFile.trials
like in the example code below. Is it the standard way of storing such data for trials ?I also tried using
Timeseries
property oftrials
, butpynwb.ecephys.FeatureExtraction
are notTimeseries
.Any help would be much appreciated !
Beta Was this translation helpful? Give feedback.
All reactions