Comments (4)
I actually use R too, and had to find a nice way to work with .npz files (they're getting increaslingly frequent, so I figured why not just work with them directly). As @mooch443 correctly mentions, the reticulate
library is the way around it. I made a gist here which can be used to import and clean either a single file or even list all files in a folder, as well as removing Inf
from the data frame (which was previously an issue, #21). I've got a few more snippets of code, e.g. for making moving averages/medians, so do let me know if I can help more. :-)
from trex.
Hiya, I don't suppose you have any guidance to the above please?
All the best,
Mark
from trex.
Hey,
yes - sorry. I was about to get around to issues just now.
You may use an R extension to load the npz files into R directly: https://rstudio.github.io/reticulate/
I haven't tried it myself (not an R user), but this is supposed to work.
As to how you can get to the trajectories of individuals, there is an example for handling the npz data (in Python), as well as an explanation of the format, here: https://trex.run/docs/formats.html#positional-data
I am sorry, again, for the delay and I hope this will help. Essentially, what you will have to do is open the npz file for an individual (e.g. data/video_fish0.npz) and then plot X#wcentroid and Y#wcentroid together in a 2D plot. The way you extracted them seems to have gotten rid of the _fishX.npz suffixes (which means you are probably losing information).
Best
-Tristan
from trex.
Apologies for the delay in responding! Thank you so much for your help and the R script. It worked like a treat for the .npz files I have. You mentioned a few more snippets of code, I wondered if you had some to obtain movement speed/averages? I am quite new to this analysis so anything that can help me obtain output for the .npz files in R would be great :-)
@roaldarbol - I just noticed it says you are Brighton based, I am from Hassocks! - Small world
from trex.
Related Issues (20)
- Trex Quitting Unexpectedly + TGrabs not showing up on Trex HOT 3
- Export fish path HOT 1
- How is neighbor distance calculated? HOT 1
- Proximity Issue HOT 1
- libGL error on fedora 36 HOT 3
- Error in Local conda channel Installation HOT 1
- Heatmap not working after update to 1.1.9 HOT 2
- manually setting origin HOT 4
- frame_rate doesn't seem to map predictably across parameters HOT 2
- Additional info on blob values in raw mode HOT 3
- Size of GUI HOT 3
- File format for visual fields HOT 1
- How to export problematic frames flagged timeline data HOT 1
- Training images not being saved HOT 2
- TRex crash HOT 3
- Override automatic matches HOT 3
- pvinfo not displaying information about blobs
- Visual identification fails HOT 3
- Auto_categorize not working HOT 2
- Open file dialog upon Load Settings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trex.