You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a DynamicTableRegion is added as a last column to a dynamic table, the toColumn method with the second argument (index flag) set to false does not work.
Steps to Reproduce
T = table([1;2;3], {'a';'b';'c'}, 'VariableNames', {'col1', 'col2'});
T.Properties.VariableDescriptions = {'column #1', 'column #2'};
T =util.table2nwb(T);
dtr_col =types.hdmf_common.DynamicTableRegion( ...
'description', 'references multiple rows of earlier table', ...
'data', [0; 1; 1; 0], ... # 0-indexed'table',types.untyped.ObjectView(T) ... % object view of target table
);
data_col =types.hdmf_common.VectorData( ...
'description', 'data column', ...
'data', {'a'; 'b'; 'c'; 'd'} ...
);
dtr_table =types.hdmf_common.DynamicTable( ...
'description', 'test table with DynamicTableRegion', ...
'colnames', {'dtr_col', 'data_col'}, ...
'dtr_col', dtr_col, ...
'data_col',data_col, ...
'id',types.hdmf_common.ElementIdentifiers('data', [0; 1; 2; 3]) ...
);
dtr_table.toTable() % Works
ans =4×3 tableiddtr_col data_col_________ ________00 {'a'} 11 {'b'} 21 {'c'} 30 {'d'} dtr_table.toTable(false) % Works
ans =4×3 tableiddtr_col data_col_____________ ________0 {1×2 table} {'a'}
1 {1×2 table} {'b'}
2 {1×2 table} {'c'}
3 {1×2 table} {'d'}
% If instead the dtr_col is added as the last column of the table:
dtr_table =types.hdmf_common.DynamicTable( ...
'description', 'test table with DynamicTableRegion', ...
'colnames', {'data_col', 'dtr_col'}, ... % Columns changed places'dtr_col', dtr_col, ...
'data_col',data_col, ...
'id',types.hdmf_common.ElementIdentifiers('data', [0; 1; 2; 3]) ...
);
dtr_table.toTable() % Works
ans =4×3 tableiddata_col dtr_col__________ _______0 {'a'} 01 {'b'} 12 {'c'} 13 {'d'} 0dtr_table.toTable(false) % Does not work
ans =4×3 tableiddata_col dtr_col__________ _______0 {'a'} 01 {'b'} 12 {'c'} 13 {'d'} 0
Error Message
No error, but the last column in the last example should contain table elements
What happened?
If a DynamicTableRegion is added as a last column to a dynamic table, the
toColumn
method with the second argument (index
flag) set tofalse
does not work.Steps to Reproduce
Error Message
No error, but the last column in the last example should contain table elements
Operating System
macOS
Matlab Version
R2023b
Code of Conduct
The text was updated successfully, but these errors were encountered: