Closed bendichter closed 6 years ago
For trials:
columnNames = {'start'};
nwb.trials = types.core.DynamicTable(...
'colnames', columnNames,...
'description', 'trial data and properties', ...
'id', types.core.ElementIdentifiers('data', 1:10));
for i=1:length(columnNames)
nwb.trials.tablecolumn.set(columnNames{i}, ...
types.core.TableColumn('data', <some vector>));
end
Things to note that may impact compatibility:
id
)I believe all three can actually be worked around by subclassing DynamicTable and writing the checks manually.
perfect! Thanks for the speedy response!
OK, what did I do wrong?
nwb = nwbfile;
nwb.trials = types.core.DynamicTable(...
'colnames', {'start','stop','condition'},...
'description', 'trial data and properties', ...
'id', types.core.ElementIdentifiers('data', 1:3));
nwb.trials.tablecolumn.set('start', ...
types.core.TableColumn('data', [.5, 1.5, 2.5]));
nwb.trials.tablecolumn.set('stop', ...
types.core.TableColumn('data', [1., 2., 3.]));
nwb.trials.tablecolumn.set('condition', ...
types.core.TableColumn('data', [0,1,0]));
nwbExport(nwb, 'test_trials.nwb')
Is there an error message? It runs fine on my machine.
hmm let me update... yup, that was it. Thanks!
We have it working that you can create a dynamictable in pynwb and read it in matnwb, but I do not know how to do the reverse. Can you give me a minimal example for constructing a trials or units table in matnwb?