DeepLabCut / DLC2NWB

Utilities to convert DeepLabCut (DLC), output to/from Neurodata Without Borders (NWB) format.
MIT License
14 stars 7 forks source link

create a separate method to write to existing nwbfile #10

Closed Saksham20 closed 2 years ago

Saksham20 commented 2 years ago

The current method of dlc2nwb library: convert_h5_to_nwb does not allow:

This PR adds a method write_subject_to_nwb that solves the 2 problems above. It also modularises the code a bit.

I think this would be a good feature addition to the library: writing to an existing nwbfile is a common use case for users that write ephys/ophys data types to an nwbfile in addition to behavior DLC data.

We are currently developing a tool (nwbconversion tools) to write various data formats to nwb. With this added feature, we can leverage this library directly.

bendichter commented 2 years ago

@jeylau and @AlexEMG, would you have availability to review this PR? We are trying to incorporate this library into NWB Conversion Tools, allowing us to easily compose conversion programs to NWB that include DLC data. In order to do this, we need to be able to write pose estimation data to an existing NWB file. This PR allows us to do that. Happy to answer any questions.

h-mayorquin commented 2 years ago

@jeylau and @AlexEMG, any chance we could some feedback on this? Is there anything we could do to help you move this forward?

jeylau commented 2 years ago

Sorry guys for the (very long) delay, but the PR looks great! Thanks a lot @Saksham20 for the effort you put into it!

jeylau commented 2 years ago

The tests fail though; could you please edit _get_pes_args to take (config_file, h5file, individual_name) in that order?

h-mayorquin commented 2 years ago

@jeylau Thanks for writing those suggestions. Let us know if anything else is needed.

jeylau commented 2 years ago

All good @h-mayorquin, thank you very much!