Difference between revisions of "Optotrak Motion Tracking System"
Line 100: | Line 100: | ||
analyze reach, loads in the data and calls other functions | analyze reach, loads in the data and calls other functions | ||
analysereach lines 5 - 28 | |||
fopen(filename) | fopen(filename) | ||
Line 112: | Line 113: | ||
make each marker a cell, 6 cells, each with 3 xyz coordinates x 400 samples (200 per second over the 2 seconds) | make each marker a cell, 6 cells, each with 3 xyz coordinates x 400 samples (200 per second over the 2 seconds) | ||
analyzereach lines 28 on | |||
raw data has to be edited so that one marker can fill in gaps from other marker, then interpolation of missing samples | raw data has to be edited so that one marker can fill in gaps from other marker, then interpolation of missing samples |
Revision as of 22:21, 29 November 2012
Using NDI Software
utilities > query system camera c3 - 3 sensors
to get feel for range of trackable space, green light = marker seen, vs. red light
new experiment : next > next >
ports (front of box) + how many markers
1 + 6 markers
cal frequency = 200hz for raipd reaching namicmaker power frequency- leave alone
finish
play around with markers to test where your capture volume is
Optotrack Matlab Code
optotrack matlab code, functions for interfacing with c api (not on cd, given by some guy) more in optomfiles, not more frequently used
runshapempt.m
optotrak_init, written by craig, set up (each subject)
create local coofdinate frame: dynamic and static
looking at only one marker (frontmost);
next ask for 3 points: 0,0 then x-axis (not amount, just positive x) then y (positive)
datagetnext3d- gets next available position of marker (must initialize pdtadest as single)- note: opto deals in single precision, matlab likes to work in double
note: opto calls any missing value as high negative number, can call "nan" in matlab
setup opto activates markers, so then deactivate
T_glob_loc from global opto coordinate frame to local table coordinate frame
make folder for handling raw opto data (idiosyncratic to craig's subject folder structure)
realtime in actual experiment:
line 50 - 88
line 375 0 make sure in right folder -
activate
start position code - 379-399 get location, change to double from single, tranform it, then use it (1:3) = only one marker xyz, (4:6) -
data buffer start buffers on separate opto box
if want to use real time marker in matlab- can use velocity to see if moved -
detectvelonset.m function, stores 4 samples at a time and calculates whether velocity exceeds threshold
end of trial: make sure finished writing buffer- spooling finished? then deactivate markers
analyze reach- for analysis, filter, fill in missing data
SUMMARY
beginning of experiment:
- initialize
- setup frame
- setup opto
trial loop:
- activate
- do stuff
- deactivate
Opto Analysis
each subject has own folder with .mat output file (parameters, trial conditions), and also opto folder with raw data (one file per trial) opto reach analysis gets placed back into the .mat file (data_struct.fdaMat)
analyze reach, loads in the data and calls other functions analysereach lines 5 - 28
fopen(filename) function that reads in a byte at a time, read in header, then read in data function
rawdata matrix created, 6x3x400 400=data points(samples), 3=xyz, 6=markers
note- bad values not =0, but rather -3e28 -- so first convert these to NaN
transform coordinate frame (using .mat data file which has transform info)
make each marker a cell, 6 cells, each with 3 xyz coordinates x 400 samples (200 per second over the 2 seconds)
analyzereach lines 28 on
raw data has to be edited so that one marker can fill in gaps from other marker, then interpolation of missing samples