NeurodataWithoutBorders / matnwb

A Matlab interface for reading and writing NWB files
BSD 2-Clause "Simplified" License
49 stars 32 forks source link

dataStub dimensions #70

Closed bendichter closed 5 years ago

bendichter commented 5 years ago

An extension with the shape

shape:
      - null
      - 3

should we stored in HDF5 as [any x 3], which means it should be input to the matnwb object as [3 x any]. I think the checker is backwards for the nwbext_ecog extension. faces has

shape:
      - null
      - 3

however when you input data as [3 x 7096] you get the following error:

Error using types.util.checkDims (line 36)
Values size [3 7096] is invalid.  Must be one of
{[Inf 3]}

Error in types.ecog.Surface/validate_faces (line
48)
        types.util.checkDims(valsz, validshapes);

Error in types.ecog.Surface/set.faces (line 33)
        obj.faces = obj.validate_faces(val);

Error in types.ecog.Surface (line 25)
        parse(p, varargin{:});obj.faces =
        p.Results.faces;

Error in TDT2NWB (line 91)
    surf = types.ecog.Surface('source',
    mesh_file, ...

(btw thanks for fixing this error printing)

If you save it transposed ([any x 3] in matlab), it runs and saves the data as [3 x any], but pynwb is unable to read it because it expects it to be [any x 3] on disk

lawrence-mbf commented 5 years ago

9d49aefba5dc16662c5a01ac5ddce93aeb4b2a37 Should flip the expected validations.