CalibrateDSX Overview

From Software Product Documentation
Revision as of 17:28, 15 January 2020 by Wikisysop (talk | contribs) (→‎Widgets)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Language:  English  • français • italiano • português • español 

CalibrateDSX prepares the X-ray images and calculates the configuration of the X-ray hardware. It performs three important tasks:

  1. correcting the X-ray images (uniformity, distortion, smoothing, resizing)
  2. calculating the 3D configuration of the X-ray hardware (the pose of the X-ray sources and camera image planes)
  3. calculating the transformation between the X-ray lab frame and the motion capture frame

     X-ray Correction

X-ray images typically suffer from uniformity and distortion errors due to cross-scatter, non-uniform beam intensity, and objects (other than the subject) in the field of view. CalibrateDSX corrects these errors using images taken with an empty field of view (“white” images) and images taken of a uniform grid of holes or beads at known locations (“grid” images). X-ray images of the calibration object and of the subject are corrected by first pre-processing the white and grid images as follows:
Stacks of white images are processed via these steps:

  1. remove outlier images (based on the mean intensity)
  2. average the remaining images
  3. if a non-zero Image Padding parameter is defined, the averaged image is padded
  4. if valid Corrected Image Size X and Corrected Image Size Y parameters are defined, the image is resized accordingly
  5. save the resulting image in TIFF format

Stacks of grid images are processed via these steps:

  1. remove outlier images (based on the mean intensity)
  2. if a non-zero Image Padding parameter is defined, the remaining images are padded
  3. if valid Corrected Image Size X and Corrected Image Size Y parameters are defined, the image is resized accordingly
  4. uniformity-correct the remaining images: output image = white image - grid image
  5. save the resulting image stack in TIFF format
  6. calculate a displacement map for each image
  7. average the displacement maps
  8. calculate initial pixel sizes from the displacements in the center of the map

Once the white and grid images have been processed, all other X-ray images (calibration object, static subject, motion subject, etc.) can be corrected with these steps:

  1. remove outlier images (calibration images only, based on the mean intensity)
  2. smooth remaining images with Gaussian filter
  3. if a non-zero Image Padding parameter is defined, the smoothed images are padded
  4. if valid Corrected Image Size X and Corrected Image Size Y parameters are defined, the image is resized accordingly
  5. uniformity-correct the remaining images: output image = white image - grid image
  6. distortion-correct the remaining images: use displacement maps to move each pixel to its proper location
  7. saving the resulting image stack in TIFF format
     3D X-ray Configuration

CalibrateDSX calculates the 3D configuration of the X-ray hardware (the Pose of the X-ray sources and image planes) from images of a rigid calibration object with precisely placed embedded radio opaque beads. Given corrected images of the calibration object, the 3D configuration of the X-ray hardware can be computed. The first step is to digitize the beads of the object in each X-ray view. Identification of the beads can be difficult if there are many of them in the object. A commonly used object contains 64 beads, but only 40 - 50 are visible in each view. To aid identification, uniquely shaped trinkets are sometimes added to the object. CalibrateDSX enables digitizing of the trinkets, or, if there aren’t any, 4 or 5 beads that are easy to identify. From these 4 - 5 trinket/bead locations, the software can calculate where the other beads are expected to be, and locate and identify their centroids on the images. The user can check these automatically digitized beads and manually digitize any that were misidentified. With this step complete, CalibrateDSX now has, for each X-ray view, a set of 2D bead locations in the image plane and a set of 3D bead locations in the lab frame. A simulated annealing algorithm is used for the DLT (direct linear transform) calculations, outputting the following parameters:

the XYZ position of the X-ray source in the lab frame
the XYZ position of the geometric center of the X-ray image (not the perpendicular point of the X-ray source) in the lab frame
the XYZ Euler angles (or 3x3 transform) expressing the orientation of the X-ray image in the lab frame
the XY pixel size of the X-ray image
     Motion Capture Transform

If traditional motion capture data (e.g., surface markers, inertial sensors) are collected in conjunction with X-ray data, they can be used in X4D to speed the tracking process by determining initial Poses of the bones. CalibrateDSX calculates the transform between the X-ray (lab) frame and the frame of the motion capture system (mocap frame) so that the mocap-based bone Poses can be converted to the lab frame. It does this using surface markers fixed to the calibration object. The 3D positions of these markers are known in the lab frame, which is embedded in the object. The motion capture system records their 3D positions in the mocap frame, and is thus able to compute the transform between the lab and mocap frames.

Tutorials

How To: Using CalibrateDSX

How To: Calculate the 3D Configuration

How To: Collect Calibration Images

Menus

     File Menu
     
The Load Subject command loads a Subject file.
This command can also be accessed with the Ctrl + O shortcut.
     
The Save Subject command saves the currently loaded subject to its existing Subject file.
This command can also be accessed with the Ctrl + S shortcut.
     
The Save Subject As command saves the currently loaded subject to a new Subject file.
     
The Save 2D POI Locations... command saves the current 2D POI locations to text files, one for each view. If names for these files are not already specified in the subject file, you will be prompted to browse for them. Links to these files will then be added to the subject file.
     
The Exit command exits the program and all unsaved data will be lost.
The program can also be closed by using the X in the top right corner of the program window.
     View Menu
     
The DSX Configuration control toggles the appearance of the dockable DSX Configuration widget. It can also be controlled using the Ctrl + Shift + D shortcut.
     
The Calibration control toggles the appearance of the dockable Calibration widget. It can also be controlled using the Ctrl + Shift + C shortcut.
     
The Parameters control toggles the appearance of the dockable Parameters widget. It can also be controlled using the Ctrl + Shift + P shortcut.
     
The Image Processing control toggles the appearance of the dockable Image Processing widget. It can also be controlled using the Ctrl + Shift + I shortcut.
     Tools Menu
     
The Propagate POIs command propagates all of the POIs in the current object to all of the frames selected in the Tracking slider. The Ctrl + P shortcut can also be used.
     
The Predict POI Locations command predicts the locations of the undigitized POIs from the digitized ones. It works on each view's current frame only, and requires a minimum of four digitized POIs in each view.
     
The Compute 3D Configuration command computes the 3D configuration parameters for both views. The source-to-image distance and initial pixel sizes must be specified for both views. At least three POIs on the calibration object must be identified in at least one frame.
     
The Correct All Trials in Configuration command corrects the x-ray image files in all of the trials of the current configuration. The Ctrl + C shortcut can also be used.
     
The Show Perfect Calibration Beads command displays projections of the calibration beads onto the X-ray images of the calibration trial. Once the 3D configuration has been computed, rays can be projected from the X-ray sources through each bead until they intersect the images. These intersections, shown as small crosshairs, represent a "perfect" calibration of the system. That is, if all of the digitized calibration beads (POIs) are coincident with these bead projections, the residuals of the 3D configuration computation will be zero.
     Mocap Menu
     
The Compute DSX/Mocap Transform command computes the transformation matrix between the X-ray frame defined by the calibration object and the motion capture frame.
     
The Create Mocap Model command creates a Visual3D model customized to the subject. A reference trial must be selected and the bones in that trial must have already been tracked for at least one reporting time. The Ctrl + M shortcut can also be used.
     Help Menu
     
The Help command opens the CalibrateDSX wiki page in the default browser. The F1 shortcut can also be used.
     
The About option displays a dialog with information about CalibrateDSX, including the installed version number. It also contains the Deactivate button, for deactivating your DSX suite license.

Widgets

     DSX Configuration

     Subject
The Subject field is automatically populated with the ID of the subject when you load a subject file.
     Session
The Session drop down menu is automatically populated with all of the sessions available available for the current subject.
     Configuration
The Configuration drop down menu is automatically populated with all of the configurations available for the current session.
     Trial
The Trial drop down menu is automatically populated with all of the trials available for the current configuration.
     Object
The Object list is automatically populated with all of the objects in the current trial. Each object is enabled if it has at least one point of interest (POI) that can be digitized in the X-ray images.
     Calibration

The Calibration widget is for digitizing the points of interest (POIs) on the calibration object, so you can calculate the 3D configuration of the X-ray equipment. When you select a trial in the DSX Configuration widget, if it contains a calibration object that object will automatically be selected as well. The table in the Calibration widget will be filled with the object's POIs.

When you right-click on a POI in the table, the following menu is displayed with commands for editing the POIs:

     Add POI Before
This command adds a POI to the list before the POI that you clicked on.
     Add POI After
This command adds a POI to the list after the POI that you clicked on.
     Rename POI
This command lets you change the name of the POI that you clicked on. You can also achieve this by double-clicking on the POI name. If you change the name, CalibrateDSX will ask if you want to change the name of the POI in all the 2D coordinate files in all trials that use the object.

     Delete POI
This command deletes the POI that you clicked on.
     Clear POI Location
This command removes the selected POI's location from both views of the current reporting time.
     Clear POI Location in All Frames
This command removes the selected POI's location from both views for all reporting times.
     Disable
This command disables the POI that you clicked on, so that it will be skipped over when POIs are being digitized in the X-rays. Once the POI is disabled, this command in the menu changes to Enable so that you can re-enable it at a later time.
     Calibration Parameters

     X-ray Image Correction
     Image Size
The desired size of the corrected X-ray images, in pixels. When the X-ray images for a trial (raw or corrected) are loaded, the Image Size will always be set to the actual size of the images being displayed.
     Image Padding

Image Padding is the number of pixels to add onto all four sides of an X-ray image during distortion correction. The default value is 0.

     Image Threshold
Image Threshold is an absolute intensity threshold when uniformity-correcting X-ray images. A pixel in the corrected image is set to zero if its value in the uncorrected image has an intensity below this value. The default is 1.0.
     Gauss Kernel Size
Gauss Kernel Size is the size of the Gaussian smoothing kernel used to reduce noise in the X-ray images during correction. The default value of no smoothing turns off smoothing.
     Gauss Sigma
Gauss Sigma is the standard deviation of the Gaussian distribution curve used for X-ray smoothing. The larger the value, the higher the weight of a pixel’s neighbors when smoothing that pixel. The default value is 1.0.
     Smoothing Threshold
When smoothing a pixel, pixels in the kernel that are not within this threshold of the value of the pixel being smoothed are ignored. This can be useful when trying to preserve the sharpness of edges when smoothing. This threshold is a percentage (0.0 to 1.0) of the maximum intensity in the emtire image. A negative value indicates that no thresholding will occur. The default value is -1.0.
     White Threshold
White Threshold is the relative intensity threshold when uniformity-correcting images. A pixel in the corrected image is set to zero if its corresponding pixel in the white image has an intensity less than this percentage (0.0 to 1.0) of the maximum intensity in the white image. The default is 0.3.
     Grid Bead Threshold View 1
Grid Bead Threshold View 1 is the relative intensity threshold when processing calibration grid X-ray images for the first view. Pixels with intensities below this percentage (0.0 to 1.0) of the maximum intensity are set to 0. The default value is 0.3.
     Grid Bead Threshold View 2
Grid Bead Threshold View 2 is the relative intensity threshold when processing calibration grid X-ray images for the second view. Pixels with intensities below this percentage (0.0 to 1.0) of the maximum intensity are set to 0. The default value is 0.3.
     Grid Centroid Min Size
Grid Centroid Min Size is the smallest allowable size, in pixels, of the centroids representing the beads/holes in the grid images. Centroids smaller than this size are ignored for the purposes of distortion correction. The default value is 9.
     Grid Min Num Centroids
Grid Min Num Centroids is the minimum number of bead/hole centroids allowable in each grid image. If fewer than this number are found, the image is not used for distortion correction.
     Positive Frame Times
Positive Frame Times is a boolean indicating whether or not to shift all frame times so that none of them is negative. If true, the frame times for both views will be shifted by the same amount so that the smallest frame time is 0.0. If reporting times are already defined when the X-ray view data is corrected, they will be shifted as well. Lastly, the Time Offset value in the mocap parameters will be shifted by the same amount.
     POI Digitization
     POI Scale
POI Scale is used to calculate the expected radius, in pixels, of the POI in the X-ray images. The expected radius is the physical size of the POI multiplied by the scale factor, divided by the pixel size. The scale factor should increase with the distance between the POI and the image plane. The default value is 1.0.
     Click Search Factor
Click Search Factor is used when digitizing POIs in the X-ray images. If you click at point X,Y in an image, a region of the image is searched for the best location of a grayscale centroid. This region is a square centered at X,Y with sides equal to two times the expected radius of the POI times the click search factor (default = 1.25).
     Propagation Search Factor
Propagation Search Factor is used when propagating POIs. In order to propagate a POI (at coordinates X, Y in one frame) to the next frame, a region of the next frame is searched for the best location of a grayscale centroid. This region is a square centered at X, Y with sides equal to two times the expected radius of the POI times the propagation search factor. The default value is 2.0.
     Centroid Threshold
Centroid Threshold is the relative threshold for identifying pixels that belong to the POI. Once a grayscale region has been identified as a POI, its centroid is calculated by a weighted average of all the pixels that have an intensity value greater than this percentage (0.0 to 1.0) of the maximum intensity.
     Edge Threshold
Edge Threshold is the relative threshold for identifying suitable POIs. For a grayscale region in an X-ray image to be considered a POI, the average edge value within the region must be at least at the Edge Threshold percentage (0.0 to 1.0) of the maximum edge value. The default value is 0.10.
     Pose Map Cutoff Frequency
Pose Map Cutoff Frequency is the low-pass cutoff frequency for smoothing the cubic splines in the POI pose maps. The default value is 20.0. If the value is set to 0.0 smoothing is turned off.
     3D Calibration
     Image Distance Allowance
Image Distance Allowance is used when calculating the 3D configuration parameters. It is the amount by which the source-to-image-plane distance is allowed to change from the user-specified value. The default value is 0.0.
     Optimize Pixel Size
Optimal Pixel Size specifies whether or not to optimize the pixel size when calculating the 3D configuration parameters. The default value is false.
     Square Pixels
Square Pixels specifies whether or not to force the X and Y pixel sizes to be the same when distortion-correcting an X-ray image. The default value is true.
     Image Processing

     Show Processed Xrays
The Show Processed Xrays check box controls whether the original Xrays or the thresholded Xrays are displayed in the 2D Xray windows.
     Xray Threshold
Pixels in the Xray images whose intensities are below Xray Threshold are set to 0.0. The threshold is a percentage with a range of 0.0 to 1.0. Changing this value to interactively threshold the Xray images is helpful for determining appropriate values of other parameters, such as Grid Bead Threshold View 1 and Grid Bead Threshold View 2.
     2D Xray Windows

The 2D Xray windows show the X-ray images for both views of the current trial. They also show the digitized points of interest of the current object.

     Slider
The reporting times of the current trial can be navigated using the slider underneath the X-ray images. Each X-ray view shows the time and index of the frame of data being displayed for that view.
     Image Brightness and Contrast
To change the brightness of the X-ray image in either view, left-click on the image and drag the cursor up or down. To change the contrast, left-click and drag the cursor left or right. Press Shift-R to reset the brightness and contrast.
     Image Size
You can zoom in and out of the X-ray image in either view using the mouse wheel. You can also pan the image by middle-clicking on it and dragging it around. Press 'r' to reset the view.
     POI Selection
When a POI is selected in the Calibration widget and the cursor is over one of the X-ray images, it will turn into a square with a circle inside. The cyan circle represents the expected size of the POI on the image and the yellow square is the search box that defines the region that will be searched when looking for the gray scale circle representing the POI. The size of the circle and the search box are calculated based on the POI size defined in the subject file and the parameters POI Scale and Click Search Factor.
After you digitize the POI location in both views, the Calibration widget will automatically advance the current POI to the next one that does not have both locations defined. You can digitize a POI in the two views in whichever order you want.
Retrieved from ""