NeurodataWithoutBorders / matnwb

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

[Bug]: Unexpected Properties in iEEG Data #478

Closed raphaelguex closed 1 year ago

raphaelguex commented 1 year ago

What happened?

When I try to access trials data of iEEG, i got the error: "Error using assert (line 5) Unexpected properties {AD CAR LF LO LT Marker OF PD PST TP}.".

I tried to upgrade the version of matNWB I am using, but this did not solve this issue.

I thought I could fix this by identifying the trials with NaN but I could not find these data after having loaded the file with nwbRead. I am not new to matlab/iEEG but totally new to NWB. I am trying to analyze the open dataset of Woolnough – Tandon. The code I am using is working with other files; but not this one e.g..

Lawrence Niu suggested me to try: to install the debugging utility program [HDFView] in order to more deeply diagnose the issue with reading the file. > But I did not manage I believe to install it (no .exe); i am on windows.

Many thanks for your help!

Steps to Reproduce

I am simply trying here to load the file: by using this command window:
"nwb2 = nwbRead(char(fileH));"

Error Message

Error using assert (line 5)
Unexpected properties {AD CAR LF LO LT Marker OF PD PST TP}.

Your schema version may be incompatible with the file.  Consider checking the schema version of the file with `util.getSchemaVersion(filename)` and comparing with the YAML namespace version present in nwb-schema/core/nwb.namespace.yaml

Error in types.util.checkUnset (line 13)
assert(isempty(dropped),...

Error in types.core.Device (line 27)
            types.util.checkUnset(obj, unique(varargin(1:2:end)));

Error in io.parseGroup (line 85)
    parsed = eval([Type.typename '(kwargs{:})']);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in io.parseGroup (line 38)
    subg = io.parseGroup(filename, group, Blacklist);

Error in nwbRead (line 59)
nwb = io.parseGroup(filename, h5info(filename), Blacklist);

Error in plot_NWB_places_RGb3 (line 12)
    nwb2 = nwbRead(char(fileH));

Prob2: I receive the following error messages: 
Error using util.loadTimeSeriesData (line 30)
Size inputs must be integers.

Error in util.loadEventAlignedTimeSeriesData (line 38)
        D(i,:,:) = reshape(util.loadTimeSeriesData(timeseries, window + times(i), ...

Error in util.loadTrialAlignedTimeSeriesData (line 71)
D = util.loadEventAlignedTimeSeriesData(timeseries, window, times, ...

Error in plot_NWB_places_RGb3 (line 37)
    parfor (amCond = 1:length(trial_conditions),2) %(trials x channels x time)

Operating System

Windows

Matlab Version

2021b

Code of Conduct

lawrence-mbf commented 1 year ago

As mentioned in the Slack thread, Device objects should not have these property names and if they do they should have been added as schema extensions.

Debugging without a visualization with HDFView will be tough as there's no way to check for sure if an embedded spec doesn't actually exist for Device or if this is a separate issue entirely.

@raphaelguex is this dataset available publicly? The only other way forward on this is for someone with HDFView to inspect the data. If not then unfortunately there's not much to be done since this Device object doesn't conform to the provided schemas.

lawrence-mbf commented 1 year ago

The issue was the NWB file itself which had /general/devices/ and /general/extracellular_ephys/ as typed groups (they should not be). Simply deleting the type attributes in these groups allowed for normal reading of the file.

bendichter commented 1 year ago

@raphaelguex how did you create these files?

raphaelguex commented 1 year ago

I did not create these files, it comes from an open database. many thanks again for your help ! Le mercredi 23 novembre 2022 à 00:07:40 UTC+1, Ben Dichter @.***> a écrit :

@raphaelguex how did you create these files?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>