-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for polygonal objects in NOR #9
base: master
Are you sure you want to change the base?
Conversation
…s any raw polygon" This reverts commit fd05a59.
…h >=4 square transformed points
Resulting zones don't seem to be properly defined. Trying to fix... |
Thanks Davor for these contributions! I am travelling a lot over the next month, but I'll review this ASAP. The current implementation just does an affine transform, but it will be great to have full correction for off-centre cameras incorporated (also planned for circular arenas). Note that the definition of arenas for the pre-defined experiment types is very rigid (open field MUST be square, MWM MUST be circular; and the size of the zones is not user-editable). This is by design so that the models are transferrable - otherwise the 'zero-config' workflow that makes Rtrack special won't work. The idea is to define new experiment types for customised tasks (this is planned for future versions but is a logistical undertaking that would require a fundamental rebuild of the R package - we have solutions in the pipeline though). The polygon support is going to be most useful for defining complex zones in new arena types. This is where the development of Rtrack is heading, so you are preempting some of this work :) |
Thanks, happy to hear these changes could be of help. With these few modifications, the package is saving me a ton of work and particularly debugging for my own analysis of SLEAP-generated tracks, thank you for your work - the future of the package looks awesome :) The rationale for hardcoded parameters makes sense to me, though, to have Rtrack work with and produce fairly standardised experimental results (if I understood correctly), but I'd just like to ask, which models are you referring to that are intended to be transferrable? Also, I'm getting weird results with my fork,
I've noticed a footnote in the documentation where the sum might not work out in case of object vicinities intersecting, but this is not the case in my polygonal setups: |
The 'models' refer to the strategy-calling functionality for MWM and Barnes maze. This does not (yet) affect the open field or NOR arenas. |
I will have a closer look at the |
Update to support NOR object specification as polygons with >4 points. Example of polygonal object specification in an arena text file (6 points), which always needs to have the
polygon x1 y1 x2 y2 x3 y3 x4 y4 x5 x5 (...)
format:This change was done in three commits:
square_transform
,polygon
function for storing polygonal objects (additionally, it always applies terra'sconvHull
function before returning the object in case points are specified out of order),polygon
object specification.This change implements functionality talked about recently in #8.