Closed bendichter closed 3 years ago
Do we eventually want this to be integrated into read/write?
I was imagining a one-line convert command before write, but I think integrating it in directly could be nice too. What would that look like?
There used to be a way to manually extend matNWB classes. I don't think that's around anymore but you would essentially make a subclass to DynamicTable as a container for the converted table, and have it run util.table2nwb() right before exporting normally. That might be farther down the line though.
OK, sounds good. I like the idea of having the ability to extend matNWB classes. Having to_table()
as a method, for instance, would be really nice.
One of the inputs of the DynamicTable GetRow/AddRow #267 supports tables as well. In fact, adding a full table to an DynamicTable will convert the table to its equivalent DynamicTable type. Indexing is also supported here.
We have a function
util.table2nwb
that takes in a MATLAB table and outputs an matnwbDynamicTable
that can be directly added to anNWBFile
object. This is a start, but is not fully functional enough to be used for all common table needs, like writing theunits
table. Here is a list of features that are needed:util.create_indexed_column
might be useful here)DynamicTableRegion
s (and indexedDynamicTableRegion
s)electrodes
,units
,trials
,invalid_times
, etc.) that handle default columns correctlyHow to do each of these is demonstrated here:
https://github.com/NeurodataWithoutBorders/matnwb/blob/fa4f8bdbd6f22cadca6f2d24901309d623a10947/tutorials/ecephys.m#L143-L225