NeurodataWithoutBorders / matnwb

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

Error reading nwb file: Unable to resolve the name types.hdmf_experimental.DynamicTableRegion #368

Closed lkeegan closed 2 years ago

lkeegan commented 2 years ago

When trying to read a nwb file, both v2.4.0 and master of matnwb give the following error:

f = nwbRead("nwbfile.nwb")
Unable to resolve the name types.hdmf_experimental.DynamicTableRegion

The file was created using mease-lab-to-nwb with pynwb 2.0.0

Possible duplicate of https://github.com/NeurodataWithoutBorders/matnwb/issues/304?

Reading the same file with pynwb:

>>> from pynwb import NWBHDF5IO
>>> io = NWBHDF5IO('nwbfile.nwb', mode='r')
>>> io.read()
root pynwb.file.NWBFile at 0x47219910669648
Fields:
  acquisition: {
    ElectricalSeries_raw <class 'pynwb.ecephys.ElectricalSeries'>
  }
  devices: {
    Device_ecephys <class 'pynwb.device.Device'>,
    ogen_device <class 'pynwb.device.Device'>
  }
  electrode_groups: {
    0 <class 'pynwb.ecephys.ElectrodeGroup'>
  }
  electrodes: electrodes <class 'hdmf.common.table.DynamicTable'>
  file_create_date: [datetime.datetime(2021, 12, 16, 12, 37, 27, 199592, tzinfo=tzoffset(None, 3600))]
  identifier: bf17de7a-cb90-4a13-b20d-2d9fb382efa4
  institution: EMBL - Heidelberg
  lab: Mease
  ogen_sites: {
    name <class 'pynwb.ogen.OptogeneticStimulusSite'>
  }
  session_description: no description
  session_id: Dual_S1_VPL_Freq_10mW
  session_start_time: 1970-01-01 00:00:00+01:00
  stimulus: {
    10mW Laser <class 'pynwb.ogen.OptogeneticSeries'>,
    10mW LaserStimulus <class 'pynwb.misc.IntervalSeries'>,
    MechanicalPressure <class 'pynwb.base.TimeSeries'>,
    MechanicalStimulus <class 'pynwb.misc.IntervalSeries'>
  }
  timestamps_reference_time: 1970-01-01 00:00:00+01:00

>>> 

I don't know if this is an issue with matnwb or an issue with the nwb file?

lawrence-mbf commented 2 years ago

I'm not aware of any schema which has DynamicTableRegion under the hdmf_experimental namespace. Can you run util.getSchemaVersion(<filename>) and post the output of that?

lkeegan commented 2 years ago
>> util.getSchemaVersion("nwbfile.nwb")

ans =

    '2.4.0'

But I have just generated the nwb file again, and this time it loads without the error message, so I guess I managed to corrupt the first version in some strange way - in any case doesn't look like an issue with matnwb, thanks!