R/caltech.R
read_caltech_feat.Rd
Read tracking and feature matrices from the Caltech Fly Tracker
read_caltech_feat(f) read_caltech_track(f)
f | Path to a matlab .mat file |
---|
For read_caltech_feat
an array with dimensions time x features
x flies
For read_caltech_track
an array with dimensions n_frames x
n_fields x n_flies and attributes:
track.mat
raw tracking data (e.g. position, orientation, left
wing angle)
trk.names
1 x n_fields cell names of fields in trk.data
trk.flags
n_flags x 6 potential identity swaps (fly1 fly2
start_fr #' end_fr ambig) The 6th column is mysterious.
if (FALSE) { feats=read_caltech_feat('~/projects/Dana/tracking/samples/210517_006-feat.mat') plot(ts(feats[,"vel", "fly001"], start=0, frequency=30)) } if (FALSE) { track=read_caltech_track('~/projects/Dana/tracking/samples/210517_006-track.mat') plot(ts(track[,c("pos x", "pos y"), "fly001"], start=0, frequency=30)) # plot 2 flies flies=attr(track, 'flies_in_chamber') plot(track[,c("pos x", "pos y"), flies[[1]][1]], type='l', col='red', asp=1) lines(track[,c("pos x", "pos y"), flies[[1]][2]], type='l', col='blue') }