Closed florianduclot closed 1 year ago
Sorry for the terrible display of the table here... The horizontal scrolling seems to work just fine with editing the message and looking at the "Preview" tab. Here's a screenshot to circumvent this oddity:
A nit: could we make
_is_new_boris_version
a standalone function inthird_party_label_appenders.tools
, so a single function called by both the old and the new BORIS appender methods?
Glad you bring this up... I wondered about that and forgot to mention it in the PR. I was a bit confused as to whether or not one of the ways to import annotations would be deprecated so I was unsure about using one to refer a function from the other. I'll include your request then!
Done: 7e3d3ac
I tested again the same way as described above and it still gives the same results and log outputs.
Hi @florianduclot! You don't happen to have a very small CSV example of the new BORIS format? Something that we can stick in the repo I can link to in the docs as expected input?
Hi @sronilsson, Here's the file I used to test that branch (it's less than 20 Kb but it can of course be cut down further if preferred): boris_new_example.csv
Thanks!
In recent BORIS versions (v8+?), the export of behavioral events in a tabular format used as annotations files in SimBA has changed. This commit thus enables SimBA to import these annotations files in a new format, while maintaining compatibility with the now-older format. I'm uncertain as to when exactly the format changed, but exporting the list of events as a tabular file in BORIS now yields a nice data frame without having to skip lines:
Unfortunately, this means SimBA cannot directly import these newly-formatted files from BORIS (not without manually editing them, of course). This pull request simply enables SimBA to do just that.
This is done by adding a quick version checker seeking for the presence of a column name found only in the new format, followed by the adjustment of expected columns headers to match what SimBA is already expecting. This way, importing a BORIS annotation file that uses the now-older format should still work.
@sronilsson, I have tested using both importing ways:
using the "Import BORIS Annotation (select folder with .csv files)" button. This does give a csv file with the behaviors appended as the last columns in
project_folder/csv/targets_inserted
. The log in the main SimBA window is:using the (newer?) "Append third-party annotations" window. This also gives a csv file with the behaviors appended as the last columns in
project_folder/csv/targets_inserted
. The log in the main SimBA window is:I have not tested using an older BORIS format file as I do not have one with matching video and pose tracking files.
Hope this helps,