rly / ndx-pose

NWB extension to store pose estimation data
BSD 3-Clause "New" or "Revised" License
13 stars 11 forks source link

Redundant definition of node names #17

Open calebweinreb opened 1 year ago

calebweinreb commented 1 year ago

In the tutorial, each body part is named in two separate places: once in the PoseEstimationSeries object and then again in the PoseEstimation object (nodes=['front_left_paw', 'front_right_paw']). I think this is kind of awkward. What if the names disagree?

rly commented 1 year ago

@calebweinreb Good question. The nodes field establishes an ordering to the different PoseEstimationSeries objects, by referring to them by name. Unfortunately, the way that PyNWB and MatNWB currently works with the HDF5 backend does not guarantee an intuitive ordering to items with a group. The order is important for the edges field, which uses the indices of the nodes field. e.g., in your example, to say that there is an edge between 'front_left_paw' and 'front_right_paw', you would set edges=[[0, 1]].

rly commented 1 year ago

There is potential that the names listed in nodes are not found as the names of objects in PoseEstimationSeries. We should add a check for that in the setter for PoseEstimation.nodes.