Optimize

 These check boxes let you specify which objects are allowed to move during the tracking optimization. DRRs for all of the objects selected in the Object Configuration panel will be generated, but only the objects selected here will be allowed to move. This allows you to perform hierarchical tracking, such as tracking the femur, then fixing it in its optimized pose while tracking the patella.

Max Iterations

 The maximum number of iterations for one pass of the optimization algorithm. For singleframe optimization, this is the number of iterations for one frame (reporting time). For 4D optimization, this is the number of iterations for the first pass. For the second pass of 4D, half of this number is used as the maximum.

Translation Ranges

 There is a slider for each of the X, Y, and Z translation ranges. Each one controls the amount that the DOF is allowed to change from its initial value during optimization.

Rotation Ranges

 There is a slider for each of the X, Y, and Z rotation ranges. Each one controls the amount that the DOF is allowed to change from its initial value during optimization.

Tracking

 The range of reporting times which will be optimized when using the Solve Range, Solve Poses in Range, or Solve Range 4D commands.

Solve Range

 Starts the framebyframe optimization process. The selected objects’ poses are optimized at each reporting time in the tracking range. It starts at the current time and proceeds towards the earliest, then goes back to the current time and proceeds towards the latest. Although each frame (reporting time) is optimized independently of the others, previously optimized frames will modify the pose map, which could affect the starting poses for subsequent frames.
 Note: the optimization will execute much faster if you turn off the display of the DRRs and CT objects in the 2D and 3D windows.

Solve Current Frame

 Performs an optimization of the current frame.
 Note: the optimization will execute much faster if you turn off the display of the DRRs and CT objects in the 2D and 3D windows.

Solve Poses in Range

 Performs an optimization of each reporting time in the tracking range that already has a pose specified in the pose map.
 Note: the optimization will execute much faster if you turn off the display of the DRRs and CT objects in the 2D and 3D windows.

Solve Range 4D

 Starts the 4D optimization process. The entire tracking range is optimized at the same time.
 Note: the optimization will execute faster if you turn off the display of the DRRs and CT objects in the 2D and 3D windows.
Frame Spacing (Pass 1)

 The interval of the reporting times when generating the pose map for the first pass of the 4D optimization algorithm. For the optimization, a pose map is created by evaluating the object’s pose map at every Nth reporting time. The default value is 5.

Frame Envelope (Pass 1)

 The number of frames near the control point to evaluate during the first pass of 4D optimization. A value of 0 means to evaluate only the frame in each view that is closest to the control point. A value of 3 means to evaluate the closest frame plus the 3 closest frames on each side of the control point, for a total of seven. The default value is 1.

Frame Spacing (Pass 2)

 The interval of reporting times when generating the pose map for the second pass of the 4D optimization algorithm. For the optimization, a pose map is created by evaluating the pose map optimized in the first pass at every Nth reporting time. The default value is 3.

Frame Envelope (Pass 2)

 The number of frames near the control point to evaluate during the second pass of 4D optimization. A value of 0 means to evaluate only the frame in each view that is closest to the control point. A value of 3 means to evaluate the closest frame plus the 3 closest frames on each side of the control point, for a total of seven. The default value is 3.


Optimizer (ASA, SPAN, LBFGSB)

 The type of optimization algorithm to use. ASA (adaptive simulated annealing) is currently the only recommended algorithm. SPAN is another type of simulated annealing. LBFGSB is a bounded, leastsquares algorithm (local optimizer).

Stop

 Stops the currently running optimization.

Evaluate

 Performs a detailed analysis of the DRR/Xray matching for the current reporting time with the currently selected objects. A summary of the results is written to the Output window, and TIFF images of the Xrays, DRRs, and Xray/DRR correlations are written to the folder containing the subject file. The correlation images are colorcoded as follows:
 red = the DRR pixel is not bright (its value is less than Eval Bright Threshold)
 cyan = the DRR pixel is bright and "good" compared to the Xray pixel (the difference is less than Eval Good Threshold)
 greenscale = bright DRR pixel value  Xray pixel value, when DRR value > Xray value
 yellowscale = Xray pixel value  bright DRR pixel value, when Xray value > DRR value

Image Metric

 The algorithm used to compare the Xray and DRR images.
Pixel Difference

 Each pixel in the processed DRR image is compared directly to its corresponding pixel in the Xray image. To compare a DRR pixel to an Xray pixel, first the absolute value of the difference between them is calculated. If this difference is greater than the Difference Threshold, and the DRR pixel value is greater than Bright Threshold, the difference is squared. This gives a greater weight to DRR pixels that are bright and which do not match well with their corresponding Xray pixels. The pixel difference is then squared and multiplied by a brightness factor. This factor is 1.0 plus Bright Factor times the DRR pixel value. When Bright Factor is zero, bright DRR pixels are not weighted differently than any others. But when it is greater than zero, the DRR’s brightness is used to weight the error for that pixel. This is a second method of weighting a bright DRR pixel more heavily, without considering its difference with the Xray pixel (as the first method does). The values for all pixels in each view are then summed to determine the fitness for that view. The sums for the two views are then multiplied to get the overall image correlation value, which the algorithm tries to minimize.

Conditional Entropy

 The crossconditional entropy, H, of the DRR image relative to the Xray image is calculated and minimized by the optimization algorithm.
Reference: Wang F, Vemuri B, Rao M, Chen Y (2003). Cumulative residual entropy, a new measure of information & its application to image alignment. Proceedings of the Ninth IEEE International Conference on Computer Vision, October, 2003. DOI: 10.1109/ICCV.2003.1238395.


Global Parameters

 These parameters, which are independent of the image metric algorithms, are used when comparing the Xray images to the DRR images.
View Weight

 This specifies the relative weight of the two views in the final image metric calculation (0.0 = all view 1, 1.0 = all view 2). The default value is 0.5, which means to weight each view equally. If you are tracking objects in singleplane image data (i.e., both views contain the same images), set this parameter to either 0.0 or 1.0 so that X4D will generate and evaluate DRRs for only one view, making the optimization twice as fast.

Constant DRR Scaling

 This boolean controls whether or not to scale the DRRs for each view by a constant value for all iterations of an optimization. If false, each DRR will be scaled so that its maximum value is equal to the DRR image scale value in the Xray/DRR Settings widget. If true, a single scale value will be calculated during the first iteration and be used to scale the DRRs in all subsequent iterations.


Poses Saved During Tracking

 Sometimes the global minimum of the image fitness function is not the correct pose of the bone being tracked. This is often because the Xray and DRR image processing parameters are not ideal (see Image Optimization, below). Other times, it is because the bone in the Xray images is occluded by soft tissue or other bones, or because of inherent differences between Xray images and DRRs (image resolution, Xray scatter, CT thresholding, etc.). To account for these other times, the ASA tracking algorithm attempts to save bone poses that result in local minima of the cost function, while still searching for the global minimum. The idea is that if the correct bone pose is not the global minimum, it is likely to be a local minimum somewhere within the search range. The ASA algorithm thus attempts to save a set of localminimum poses so that you can revisit them once optimization has finished. The Max Poses field specifies how many local minima to save. When the tracking optimization has finished, if the final bone pose is not the correct pose, you can reapply the saved poses by dragging the slider for that bone. If one of them is correct (or at least better than the final pose), you can use the Add Current Poses to Maps command in the Pose Map widget to add that pose to the map, thus overwriting the final pose.
 Note: When the ASA algorithm evaluates a particular bone pose during optimization, it cannot determine if it is actually a local minimum or not because it does not compute gradients. It estimates if the pose is a local minimum by examining its cost function value and its proximity to other poses with similar values. Here is an example that details the process. If you perform an ASA optimization of 1000 iterations, with Max Poses set to 20 and Distance (squared) set to 3.0, when the optimization is complete the 1000 bone poses that were evaluated are sorted from lowest to highest cost function value. The pose with the lowest value is marked as the global minimum and added to the list of saved poses. Then the pose with the next lowest value is checked to see how close it is to the first pose. The sum of the squares of the differences in the 6 DOF values is computed and compared to the Distance (squared) value (3.0 in this case). If the distance is less than 3.0, it is assumed that this pose is in the same valley of the solution space as the first pose, so it should not be saved as a local minimum. If it is greater than 3.0, the pose is added to the saved pose list. Then the next pose in the sorted list is checked. If it is not within 3.0 units of any pose already in the saved list, it is added to the saved list. This process proceeds until the saved list contains 20 poses. It will take some trial and error to determine the best value of the Distance (squared) parameter for a particular data set, but a value in the range of 1.0 to 3.0 is reasonable, as the solution spaces are often very bumpy with numerous local minima. The units for the DOF translations are model units (usually mm), and the units for the rotations are degrees.

