How to analyze the distance?

171 views
Skip to first unread message

sunmi...@gmail.com

unread,
Nov 5, 2013, 5:18:39 PM11/5/13
to ct...@googlegroups.com
Hi,
I am using the ctrax software. It is so powerful. But I have a question. How to analyze the total distance of flies? which script can I use?
Thanks! 

John Bender

unread,
Nov 5, 2013, 6:01:24 PM11/5/13
to ct...@googlegroups.com
Hi Sunming,

What distance exactly are you asking about? Do you mean the total
distance walked by each fly during a video, or the distances between
flies, or something else?

JB
> --
> You received this message because you are subscribed to the Google Groups
> "ctrax" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ctrax+un...@googlegroups.com.
> To post to this group, send email to ct...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ctrax.
> For more options, visit https://groups.google.com/groups/opt_out.

sunmi...@gmail.com

unread,
Nov 5, 2013, 8:25:11 PM11/5/13
to ct...@googlegroups.com, jo...@generalui.com
Hi JB,
I mean that total distance walked by each fly during a video.
Thanks!
Mingkuan

在 2013年11月5日星期二UTC-5下午6时01分24秒,John Bender写道:

John Bender

unread,
Nov 6, 2013, 2:28:05 AM11/6/13
to ct...@googlegroups.com
Hi Mingkuan,

It's pretty straightforward. Use the load_tracks script to load the
data from a .mat file, then write your own short script to calculate
the distance traveled by each fly. Something like this:

trx = load_tracks;
n_flies = length( trx );
distances_walked = zeros( 1, n_flies );
for fly = 1:n_flies
dX = sqrt( diff( trx(fly).x ).^2 + diff( trx(fly).y ).^2 ); % Pythagoras
distances_walked(fly) = sum( dX );
end


JB

sunmi...@gmail.com

unread,
Jan 29, 2014, 11:49:38 AM1/29/14
to ct...@googlegroups.com, jo...@generalui.com
Hi JB,
Now I can analyze the total walked distance. Whether or not can we analyze the flies social behaviour using the software? So, I have a new question, How to analyze the distance between flies? Which script can I use?

在 2013年11月6日星期三UTC+8下午3时28分05秒,John Bender写道:

John Bender

unread,
Jan 29, 2014, 12:02:54 PM1/29/14
to ct...@googlegroups.com
Hi Mingkuan,

The compute_perframe_stats_social script in the BehavioralMicroarray
Toolbox does exactly that:
http://ctrax.sourceforge.net/bmat.html#compute-perframe-stats-social-m

JB
Reply all
Reply to author
Forward
0 new messages