Note that this step used to be called "Smart Smoothing" and was based on a different algorithm. Make sure that you have the most current XrayProject scripts MATLAB scripts and Maya MEL scripts for this step.
what you need:
- a CTmarkercoordinates.csv file 3 columns for each marker (xyz coordinates)
- an *xyzpts.csv file from digitized data
Note: The number of columns must be a perfect match between the two files.
if you have 10 markers - you must have 30 columns in both files.
You may want to filter *xyzpts data prior to calculating rigid body motion (read Filtering Data for background information on filtering)
- type butterBatch at the matlab prompt (or press the filterXYZ button on the XrayProject Window)
- enter the cutoff frequency, recording frequency (i.e. frame rate), and filter type
Note: it is important to enter your correct frame rate. The default is 250 frames per second. It is also important to select an appropriate cutoff frequency; generally 5 to 10 times greater than the frequency of the motion in your videos
- select 1 or more files to process
- Original and filtered data will be plotted for the first data file
- files are saved in the original directory with BUTTER## appended to the
end of the original file name. The ## specifies the cutoff frequency
what to do: Calculate Rigid Body Motion Procedure
- type XrayProject at the MATLAB prompt (if the XrayProject window is not already open)
- click Calculate Rigid Body Motion
- select the csv file with the marker coordinates (3D marker positions relative to polygonal mesh bone models)
- select your filtered data file (xyzptsButter)
- type the number of bones in the input box
- select the markers associated with each bone (omit any markers with all NaNs)
- save the file output.
what you get:
A (yourfilename)TformsAbs.csv file with the absolute (relative to 0,0,0,) translations and rotations to drive your bones (in a Maya-friendly, framex16 matrix format)
- To use this file in maya, you will
- select the bones in the same order used above.
- click the imp shelf tool or type impdata at the MEL command prompt
- select the file saved in step 7
Note: After you run through steps 1-7 in matlab, the variables markerIdx and ct are stored in the workspace. If you need to do subsequent reconstructions, simply type rigidBody(markerIdx,ct) at the matlab prompt. This will elimate steps 3-5.
rigidBody calls 2 additional scripts: svdrigid and mayaMatrixFormat
svdrigid takes marker data for a single bone and outputs rotations and translations
mayaMatrixFormat converts the framex3x3 rotation matrices and framex3 translations and converts them to a framex16 rotation matrix in a Maya-friendly format