CalibrateDSX Overview

From Visual3D Wiki Documentation
Jump to: navigation, 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

CalDSX Full.png

     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
  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
  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)
  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: Calculate the 3D Configuration

Menus

     File Menu
     CalDSX LoadSubjectButton.png
The Load Subject command loads a Subject file.
This command can also be accessed with the Ctrl + O shortcut.
     CalDSX SaveSubjectButton.png
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.
     CalDSX SaveSubjectAsButton.png
The Save Subject As command saves the currently loaded subject to a new Subject file.
     CalDSX Save2DPOILocationsButton.png
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.
     CalDSX ExitButton.png
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
     CalDSX DSXConfigurationButton2.png
The DSX Configuration control toggles the appearance of the dockable DSX Configuration widget. It can also be controlled using the Ctrl + Shift + D shortcut.
     CalDSX CalibrationButton2.png
The Calibration control toggles the appearance of the dockable Calibration widget. It can also be controlled using the Ctrl + Shift + C shortcut.
     CalDSX ParametersButton2.png
The Parameters control toggles the appearance of the dockable Parameters widget. It can also be controlled using the Ctrl + Shift + P shortcut.
     CalDSX ImageProcessing2.png
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
     CalDSX PropagatePOIsButton.png
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.
     CalDSX PredictPOILocationsButton.png
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.
     CalDSX Compute3DConfiguration.png
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.
     CalDSX CorrectAllTrialsButton.png
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.
     Mocap Menu
     CalDSX ComputeDSX MocapTransformButton2.png
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.
     CalDSX CreateMocapModelButton2.png
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
     CalDSX HelpButton2.png
The Help command opens the CalibrateDSX wiki page in the default browser. The F1 shortcut can also be used.
     CalDSX AboutButton2.png
The About option displays a dialog with information about CalibrateDSX, including the installed version number. It also contains the Deactivate button, for deactivating your CalibrateDSX license.

Widgets

     DSX Configuration

CalDSX DSXConfigurationWidget.png

     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.

CalDSX CalibrationWidget.png

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

CalDSX CalibrationWidgetDropdown.png

     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.

CalDSX POIRenamePopup.png

     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.
     Parameters

CalDSX ParametersWidget2.png

     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.
     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 propagation search factor (default = 1.25).
     Corrected Image Size X
Corrected Image Size X is the size, in pixels, of the corrected X-ray image on the X axis. The default value is -1, which preserves the original size.
     Corrected Image Size Y
Corrected Image Size Y is the size, in pixels, of the corrected X-ray image on the Y axis. The default value is -1, which preserves the original size.
     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.
     Guess 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 acceptable values are 3 (for a 3x3 kernel), 5 (for a 5x5 kernel), and 7 (for a 7x7 kernel). Any other value will turn off the X-ray smoothing. The default value is -1.
     Guess 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.
     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 Invert
Grid Invert specifies whether or not to invert the intensities of the grid image during correction. If the grid object is radiopaque beads, this parameter should be false. If the grid object is holes in a radiopaque sheet, this parameter should be true. The default is false. In the corrected grid images the centroids used to perform distortion correction should be light regions on a dark background.
     Grid X Angle
Grid X Angle is the angle between the X axis of grid beads/holes and the X axis of the grid image. If the grid X axis is supposed to be aligned with the image intensifiers, set this parameter to 0.0. If the alignment of the grid X axis is unknown (common with hex grids of holes), set this parameter to a value outside the range -360.0 to 360.0, which tells CalibrateDSX to calculate the alignment. The default value is 999.9.
     Grid XY Angle
Grid XY Angle is the angle between the X and Y axes of beads/holes in the grid object. For hex grids, this parameter can be set to 60.0 or 120.0. The default value is 90.0.
     Grid X Spacing
Grid X Spacing is the distance, in millimeters, between adjacent beads/holes in the grid object, along the X axis. The default value is 10.0.
     Grid Y Spacing
Grid Y Spacing is the distance, in millimeters, between adjacent beads/holes in the grid object, along the Y axis. The default value is 10.0.
     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.
     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 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.
     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.
     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.
     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 or less the smoothing is turned off.
     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.
     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.
     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.
     Image Processing

CalDSX ImageProcessingWidget.png

     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.

CalDSX 2DViewWithPOI.png

     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 ""