matnwb
matnwb copied to clipboard
[Bug]: Removing neurodata type from file does not work
What happened?
If a group or dataset is removed from an NWB file object which is read from disk, and the NWB file object is exported to the same file path, the group or dataset will still be present the next time the file is read in.
Steps to Reproduce
>> run('ophys');
- - -
>> nwb = nwbRead('ophys_tutorial.nwb');
>> nwb.processing.get('ophys').nwbdatainterface
ans =
3×1 Set array with properties:
Fluorescence: [types.core.Fluorescence]
ImageSegmentation: [types.core.ImageSegmentation]
MotionCorrection: [types.core.MotionCorrection]
>> nwb.processing.get('ophys').nwbdatainterface.remove("Fluorescence")
ans =
2×1 Set array with properties:
ImageSegmentation: [types.core.ImageSegmentation]
MotionCorrection: [types.core.MotionCorrection]
>> nwbExport(nwb, 'ophys_tutorial.nwb')
>> nwb = nwbRead('ophys_tutorial.nwb');
>> nwb.processing.get('ophys').nwbdatainterface
ans =
3×1 Set array with properties:
Fluorescence: [types.core.Fluorescence]
ImageSegmentation: [types.core.ImageSegmentation]
MotionCorrection: [types.core.MotionCorrection]
>>
Error Message
No error
Operating System
Windows
Matlab Version
R2023b
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
- [x] Have you ensured this bug was not already reported?