I don't think that functionality exists already in the toolbox, but it
would be quite straightforward to write your own script to perform
that analysis.
Start by loading the data into your script using load_tracks(), which
will return a 'trx' variable including the following fields:
http://ctrax.sourceforge.net/bmat.html#load-tracks-m
You can use 'x' and 'y' to get the raw positions of each fly in
pixels, or if you also run convert_units(), you can have the x and y
positions in millimeters. Matlab's find() function will give you the
frame numbers where your fly meets certain criteria, and if you just
want to know the number of frames, use length().
For example, here's a really simple script that will get you partway there:
% define some constants
target_x = 10; % left boundary of target area
target_y = 50; % top boundary of target area
target_width = 30; % width of target area
target_height = 30; % height of target area
n_flies = length( trx ); % number of flies tracked
% do the calculation
for f = 1:n_flies % for each fly
frames_in_target = find( trx(f).x > target_x & trx(f).x <
target_x+target_width & trx(f).y > target_y & trx(f).y <
target_y+target_height );
n_frames(f) = length( frames_in_target );
end
% a simple plot of the results
hist( n_frames )
xlabel( 'number of frames in target area' )
ylabel( 'number of flies' )
Hope that helps!
JB
> --
> You received this message because you are subscribed to the Google Groups "ctrax" group.
> To post to this group, send email to ct...@googlegroups.com.
> To unsubscribe from this group, send email to ctrax+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ctrax?hl=en.
>
>