[Discussion] Adding support for writing to nwb file. #10
Replies: 4 comments 5 replies
-
Hi @h-mayorquin, This sounds great! Thanks for the help. Some answers below.
For example, why not just build up the pose series directly instead of coercing them into a dataframe first? Numpy arrays may be a reasonable intermediate for things that strictly need to be series, i.e., for inference data. (See rly/ndx-pose#9 regarding training data.)
Yes, we can add some more fixtures that are more complex. We've been doing it on an as-needed basis to prevent the repo from getting too bloated.
A
A An For final inference results not used in labeling, we will typically want every
Maybe it's best that you just try it out and send a PR. It looks like it's almost done, so feel free to finish it off with whatever approach is easiest and we'll iterate from there.
Pandas is no problem, thanks! |
Beta Was this translation helpful? Give feedback.
-
@talmo It seems to me that the only way that the current organization of the nwbfile that you have in the main repo works is if only A can occur. In fact, your current implementation assumes that there is only one skeleton in the whole labels object (so all the instances share the same skeleton): Are your files working with only skeleton usually? Can the examples B or C in the diagram occur? If so, what should we do? the Related is the issue in: As a reminder for myself, the organization that we have in the nwb file is:
|
Beta Was this translation helpful? Give feedback.
-
Hi, so I am adding a second set of improvements related to metadata propagation (See #15). For this, it would also be good to have a file that is up to data on its provenance (see #14) so we can discuss how to better add the information available. The design idea that I have is that by default I would really like to have an up-to date dataset that you consider a good example for provenance information. I am wondering about the dataset example that you have right now in the repo ( Another small question that I have is: what is the reference frame for your trajectories? That is, I think that you get x and y positions for the coordinates of the nodes (in pixels) but are they referenced to which corner? bottom-left (0, 0), top-left (1,0)? which one? |
Beta Was this translation helpful? Give feedback.
-
I added a small PR to extract backend information as its is, a dict: #18.
|
Beta Was this translation helpful? Give feedback.
-
Hi,
So we want to help you guys to add support to nwb. I am opening this issue to have some preliminary discussion with you so we can align on design issues (I already read your helpful contributing document).
I have spent the day looking at your code base here and in your main repo and so far my assesment is the following. I think that the task of offering nwb writing support can be divided into two big steps:
The latter (2) is sort of straighfroward for us as we have done this many times so I will concentrate on the former (1). I already built a prototype using a hierarchy of tidy data frames that reads all the data using the objects in your models module:
https://gist.github.com/h-mayorquin/2c20eb7c7dbb3849ce5e45bc4a8afc5d
Which produces data like this:
So, design questions that I have:
I think that the prototype method can be easily used to fulfill point 1 (I already tested it with some data) but I wanted to discuss with you if you had in mind another way of providing similar functionality. The reason for this is that I would rather help you to implement your design vision rather than using my ad-hoc method for this (I could not find anything equivalent on the library).
Where should the functionality to write to nwb should be located? Is the idea to create another module under the io directory called
ndx_pose
ornwb
that could be used for this or do you have other ideas for the organization.Concerning testing I am using the example that you provide in your main repo (the
centered_pair_predictions.slp
file) as is more complex . However, this file is not available in this repo, could we add it so we can have automatic testing with more complex files? The one currently available seem to only have two tracks and one labeled frame so some parts of the code would be harder to test.I have a question about your data model. I don't understand the set theoretical relationships between Track and Skeleton (and maybe that's why the data above in the data-frame might look confused). An instance object contains both a skeleton and a track. However, is their relationship 1-to-1, can a track contain multiple skeletons? can the skeleton be assigned to multiple tracks (this makes less sense to me)?
If you are fine with the prototype above (question 1) I can move forward and implement it quickly so you can see it working on code. All the other questions are of less immediate importance I think.
P.D. Pandas a dependency is implied by the use of
ndx_pose
.Beta Was this translation helpful? Give feedback.
All reactions