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
toTable method does not work on PlaneSegmentation objects
Steps to Reproduce
% generate fake image_mask data
imaging_shape = [100, 100];
x = imaging_shape(1);
y = imaging_shape(2);
n_rois =20;
image_mask = zeros(y, x, n_rois);
for i =1:n_rois
start = randi(90,2,1);
image_mask(start(1):start(1)+10, start(2):start(2)+10, 1) =1;
end% add data to NWB structures
plane_segmentation =types.core.PlaneSegmentation( ...
'colnames', {'image_mask'}, ...
'description', 'output from segmenting my favorite imaging plane', ...
'id', types.hdmf_common.ElementIdentifiers('data', int64(0:19)'), ...
'image_mask', types.hdmf_common.VectorData('data', image_mask, 'description', 'image masks') ...
);
Error Message
Errorusing tabular/horzcatAlltables being horizontally concatenated must have the same number of rows.Errorin matnwb.types.util.dynamictable.nwbToTable (line 81)
matlabTable = [matlabTableDynamicTable.getRow( ...
Errorinmatnwb.types.hdmf_common.DynamicTable/toTable (line124)
table =matnwb.types.util.dynamictable.nwbToTable(obj, varargin{:});
Proposed fix:
Permute arrays so that the last dimension of the array becomes the first dimension. This is needed for image masks, because a w x h x nRois sized array needs to be reshaped into nRois rows of a table and in order for this to work, the "nRois" dimension needs to come first.
The fix needs to happen in this function: +types/+util/+dynamictable/getRow.m
What happened?
toTable method does not work on PlaneSegmentation objects
Steps to Reproduce
Error Message
Operating System
macOS
Matlab Version
MATLAB_R2023
Code of Conduct
The text was updated successfully, but these errors were encountered: