Child pages
  • Animating a Bone with One or Two Markers
Skip to end of metadata
Go to start of metadata

If there are only one or two markers in a bone, you can still reconstruct 3D movement of the bone by combining marker-based and markerless (Scientific Rotoscoping) techniques. If other bones have 3 or more markers, you can simply animate those bones by following instructions for marker-based data (link).

Creating a skeleton setup Maya scene

For both one and two markers:

  1. Save your current Maya scene as your skeleton setup scene. 
  2. In the skeleton setup scene, calculate the marker centroids for each marker using the vAvg shelf tool. Be sure to use the same marker number(s) as in your digitized data. You do not need to export the CT marker centroid data.

For one marker:

  1. Parent the bone that you want to position to the locator (created by the vAvg marker centroid calculations) of the marker you want to use to position the bone. Do this by first selecting the bone, then shift+selecting the marker centroid locator, and then select Edit -> Parent (or press 'P').
  2. To prevent accidentally moving the bone relative to the marker, select the bone model and then select the translate, rotate and scale channels in the channel box. Right click and select “Lock selected”.
  3. Your bone should now be a child of the marker centroid locator, and the bone’s translations and rotations should be locked. Save your skeleton setup scene and close it.

For two markers:

  1. Create a new locator (Create -> Locator) and name it controlParent. Then create a duplicate of controlParent by selecting the controlParent locator and select Edit->Duplicate. Name the newly duplicated locator controlChild and parent it under controlParent (select controlChild, then controlParent, then Edit->Parent).

  2. Create a point constraint. Shift+select the two marker centroid locators (created by the vAvg marker centroid calculations) being used to position the bone. Then shift+select controlParent (all three locators should now be selected, with controlParent last). Under the Animation menu set, choose Constrain -> Point. Make sure that under Point Constraint Options (click on square to right of Point in Constrain menu), the “Maintain offset” box is unchecked.
  3. Create an aim constraint. Select ONE of the marker centroid locators being used to position the bone; it does not matter which one. Then shift+select controlParent (two locators should now be selected) and choose Constrain->Aim.
  4. Select controlChild and figure out which rotation (X, Y, or Z) spins about the axis between the two markers. Do this by selecting controlChild and using the Rotate Tool to rotate each axis independently. When you have determined the correct rotation axis, return all controlChild translations and rotations to zero (use the channel box). Select the other two rotation axes and lock by selecting them in the channel box, right-clicking, and selecting “Lock selected”.
  5. Parent the bone model under controlChild. Your hierarchy should now look like this:

  6. Save your skeleton setup scene and close it.

Animating the bone model

For both one and two markers:

  1. Create an animation scene by importing both x-ray cameras and loading the undistorted video on the appropriate cameras.
  2. Reference the skeleton setup scene by Choosing File-> Create Reference and navigate the skeleton setup scene you wish to use.

For one marker:

  1. Select the marker centroid locator that is the parent of the bone model you are animating. You should have digitized data (xyzpts.csv file) for this marker.
  2. Type impOneMarker (your marker number here) in the MEL command line.  For example, if your marker centroid locator is “m001”, type impOneMarker(001). This, like all MEL commands, is case-sensitive. A dialog box will open, allowing you to select your digitized data (xyzpts.csv) file.
  3. The previous step will “pin” your bone model to the digitized position of the selected maker and set keyframes on the Translate X, Translate Y, and Translate Z channels. Tip: If your bone model does not appear to move to its digitized position, move to a different frame of the animation. Changing the frame seems to "refresh" the animation, and the bone will appear in its proper position in all frames.
  4. Now you can select the marker centroid locator and use the rotation tool to properly orient the bone according to the x-ray video images. You are now ready to rotoscope your bone (see instructions for using the Pan and Scan tool). The only differences from markerless rotoscoping is that
    1. you only need to manipulate rotations to align the bone model and
    2. you will be changing the rotations of the marker centroid locator, not the bone model itself.

For two markers:

  1. Select the two marker centroid locators. You should have digitized data (xyzpts.csv file) for these markers.
  2. Type impTwoMarker (marker1 number, marker2 number) in the MEL command line.  For example, if your marker centroid locators are “m001” and “m002”, type impTwoMarker(001, 002). This, like all MEL commands, is case-sensitive. A dialog box will open, allowing you to select your digitized data (xyzpts.csv) file. Be sure that you enter your marker numbers in the same order that you selected the locators. For example, if you selected centroid locator 001 and then centroid locator 002, you should type impTwoMarker(001,002).
  3. The position and orientation of controlParent locator (and thus the bone model) will be dictated by the position of the two markers. Tip: If your bone model does not appear to move to its digitized position, move to a different frame of the animation. Changing the frame seems to "refresh" the animation, and the bone will appear in its proper position in all frames.
  4. You should now be able to align the bone model to the x-ray video images by rotating the controlChild locator about its single unlocked rotation. The only differences from markerless rotoscoping is that 1) you only need to manipulate a single rotation to align the bone model and 2) you will be changing the rotations of the controlChild locator, not the bone model itself.



Unknown macro: {center}                 Table of Contents                

Unknown macro: {center}                      Workflow Diagrams                      

Write a comment…