Issues with writing the new extension on an NWB file #59
Replies: 2 comments 4 replies
-
Hi @Hamidreza-Alimohammadi , I ran your example script after adding with NWBHDF5IO('test_ecg.nwb', 'w') as io:
io.write(nwb_file) at the end. I got the error
as you reported. Looking at your script and extension, I found a few issues and likely errors. It looks like you create a generic recording_channels_table.add_row(
channel_name='ch_0',
channel_type='single',
electrodes=DynamicTableRegion(
name='',
data=[0],
table=ecg_electrodes_table,
description=''
)
) This is not the correct usage of
Option 2 is probably easier. Then to add rows, you would use something like: recording_channels_table.add_row(
channel_name='ch_0',
channel_type='single',
electrodes=[0]
)
recording_channels_table.add_row(
channel_name='ch_1',
channel_type='differential',
electrodes=[0, 1]
) The You defined
Once you solve that, the script now generates this error:
which you reported. This usually means a group (usually a subtype of
Let me know how this goes and if you have any questions. |
Beta Was this translation helpful? Give feedback.
-
As a first check, can you check that the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
As mentioned in the slack channel, I've been working with developing a new extension to incorporate ECG data standards to the NWB. Here's a link to the repository:
https://github.com/Defense-Circuits-Lab/ndx_ecg
The specs have been successfully defined and the defined groups can be also successfully imported and used to store what they are intended to store (As is testable by running a sample script in src/pynwb/tests/test_script_ecg.py), however, when it comes to writing it on the file this error comes up:
hdmf.build.errors.OrphanContainerBuildError: ecg_raw (ecg_raw): Linked ECGChannelsGroup '' has no parent. Remove the link or ensure the linked container is added properly.
ECGChannelsGroup
is an extension to the NWBContainer base and it seems to be orphaned. I tried to take care of this problem by removing this NWBContainer extension and implementing it's data through a direct dataset into theCardiacSeries
itself and put a soft link to the extended Device-typeECGRecDevice
, but as mentioned in the slack got another error:TypeError: GroupBuilder.set_dataset: incorrect type for 'builder' (got 'GroupBuilder', expected 'DatasetBuilder')
So, I would definitely appreciate any comments, and would really prefer if the already exisiting extension scheme at the provided repository could be put into working.
I hope I have provided enough information regarding this issue,
Thank you for your time in advance!
Beta Was this translation helpful? Give feedback.
All reactions