Difference between revisions of "CalibrateDSX Overview"

From Visual3D Wiki Documentation
Jump to: navigation, search
m (Widgets)
m (Widgets)
 
Line 344: Line 344:
 
|
 
|
  
This section displays the parameters that control the digitization of POIs in the X-ray images. When you are digitizing POIs in the images, there are two methods of determining the XY coordinates in the 2D images. The recommended method is to left-click on any portion of the POI in the image and let CalibrateDSX calculate the weighted center of pixels representing the POI. This process is described in detail in ''Digitizing POIs'', and is governed by the parameters listed below. For cases in which this process does not correctly locate the POI center (e.g., non-circular POIs), you can use Ctrl-left-click to specify the point. In this case CalibrateDSX will use the exact XY coordinates of where you clicked as the 2D location of the POI in that view.
+
This section contains the parameters that control the digitization of POIs in the X-ray images. When you are digitizing POIs in the images, there are two methods of determining the XY coordinates in the 2D images. The recommended method is to left-click on any portion of the POI in the image and let CalibrateDSX calculate the weighted center of pixels representing the POI. This process is described in detail in ''Digitizing POIs'', and is governed by the parameters listed below. For cases in which this process does not correctly locate the POI center (e.g., non-circular POIs), you can use Ctrl-left-click to specify the point. In this case CalibrateDSX will use the exact XY coordinates of where you clicked as the 2D location of the POI in that view.
  
 
<div id="POI Scale">'''POI Scale'''</div>
 
<div id="POI Scale">'''POI Scale'''</div>

Latest revision as of 22:24, 25 June 2020

Language:  English  • français • italiano • português • español 

CalDSX Full.png

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

     1. 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). Information on collecting white and grid images can be found here. 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. add an optional border to the image, based on the value of the Image Padding parameter
  4. resize the image to the size specified by the Image Size parameter
  5. save the resulting image in the TIFF format

Stacks of grid images are processed via these steps:

  1. remove outlier images (based on the mean intensity)
  2. add an optional border to the images, based on the value of the Image Padding parameter
  3. resize the images to the size specified by the Image Size parameter
  4. uniformity-correct the remaining images: output image = white image - grid image
  5. save the resulting image stack in the 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. optionally smooth the remaining images with a Gaussian filter
  3. add an optional border to the images, based on the value of the Image Padding parameter
  4. resize the images to the size specified by the Image Size parameter
  5. uniformity-correct the remaining images: output image = white image - input image
  6. distortion-correct the remaining images: use the average displacement map to move each pixel to its proper location
  7. saving the resulting image stack in the TIFF format

Note: uniformity correction and distortion correction are both optional. If no white images are specified in the calibration data, uniformity correction will be skipped and the images to be corrected will simply be inverted. Similarly, if no grid images are specified, distortion correction will be skipped.

     2. 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
     3. 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 thus the transform between the lab and mocap frames can be computed.

Tutorials

How To: Using CalibrateDSX

How To: Calculate the 3D Configuration

How To: Collect Calibration Images

     Digitizing POIs

To digitize a POI on a calibration object, select the POI by clicking on its name in the table in the Calibration widget. The table row will be highlighted in blue, and when you move the cursor into one of the X-ray windows, the cursor will change to a circle inside a square, with the POI name to the right. The circle represents the expected size of the POI on the X-ray image, which is dependent on the pixel size of the image and the radius of the POI, which is specified in the subject file. The square represents the region of the image that will be searched for the center of the POI (some of the outer pixels of the POI can be outside the square). The size of the square is controlled by the Click Search Factor parameter. A larger number makes it quicker and easier to digitize POIs, but you don't want the square to contain more than one POI. When you click the left mouse button, CalibrateDSX will search the X-ray pixels within the square to determine which one is the best candidate for the center of the POI. This is done by using the Centroid Threshold parameter to separate the POI pixels from the background, and the Edge Threshold parameter to determine if these pixels represent a circular POI. The POI is assumed to be a bright circle on a dark background, with the center of the POI being the brightest. The 2D coordinates of the POI center in each view are calculated as the weighted center of the pixels above the Centroid Threshold.

Note: If CalibrateDSX's centroid-finding algorithm does not correctly locate the POI (as it may not with non-circular POIs), you can Ctrl-left-click to identify it in either or both views. In this case CalibrateDSX will use the exact XY coordinates of where you clicked as the 2D location of the POI in that view.

If you make a mistake identifying the proper POI in the first view, you can press the Esc key to cancel the process. If you make a mistake after identifying the POI in the second view, you can remove the POI pose by unchecking the pose box in the POI table. Once you have digitized a POI, CalibrateDSX automatically advances the current POI to the next one in the table that does not already have a pose.

Once you have identified the POIs for one or more reporting times, you can have CalibrateDSX attempt to automatically identify them for other reporting times using the Propagate POIs command in the Tools menu. See the wiki entry for this command for more details.

Menus

     File Menu
CalDSX FileMenu.png
  • Open Subject... (Ctrl + O): loads a subject file.
  • Save Subject (Ctrl+ S): saves the currently loaded subject to its existing subject file.
  • Save Subject As...: saves the currently loaded subject to a new subject file.
  • Save 2D POI Locations...: 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.
  • Exit: exits the program. The program can also be closed by using the X in the top right corner of the program window.
     View Menu
CalDSX ViewMenu.png
  • DSX Configuration (Ctrl + Shift + D): toggles the appearance of the dockable DSX Configuration widget.
  • Calibration (Ctrl+ Shift + C): toggles the appearance of the dockable Calibration widget.
  • Calibration Parameters (Ctrl+ Shift + P): toggles the appearance of the dockable Calibration Parameters widget.
  • Image Processing (Ctrl+ Shift + I): toggles the appearance of the dockable Image Processing widget.
     Tools Menu
CalDSX ToolsMenu.png
  • Propagate POIs (Ctrl + P): propagates all of the digitized POIs in the current object to all of the frames selected in the Tracking slider.
  • Predict POI Locations: 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.
  • Compute 3D Configuration: 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.
  • Correct All Trials in Configuration (Ctrl + C): corrects the X-ray image files in all of the trials of the current configuration.
  • Show Perfect Calibration Beads: toggles the display of 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 Xs, 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
CalDSX MocapMenu.png
  • Compute DSX/Mocap Transform: computes the transformation matrix between the X-ray frame defined by the calibration object and the motion capture frame.
  • Create Mocap Model (Ctrl + M): 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.
     Options Menu
CalDSX OptionsMenu.png
  • Settings...: opens a dialog containing application-wide settings and parameters.
     Help Menu
CalDSX HelpMenu.png
  • Help (F1): opens the CalibrateDSX wiki page in the default browser.
  • About: 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
CalDSX DSXConfigurationWidget.png
  • Subject: This field is automatically populated with the ID of the subject when you load a subject file.
  • Session: This drop down menu is automatically populated with all of the sessions available for the current subject.
  • Configuration: This drop down menu is automatically populated with all of the configurations available for the current session.
  • Trial: This drop down menu is automatically populated with all of the trials available for the current configuration.
  • Object: This 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: Adds a POI to the list before the POI that you clicked on.
  • Add POI After: Adds a POI to the list after the POI that you clicked on.
  • Rename POI: 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, you will be asked 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: Deletes the POI that you clicked on.
  • Clear POI Location: Removes the selected POI's location from both views of the current reporting time.
  • Clear POI Location in All Frames: Removes the selected POI's location from both views for all reporting times.
  • Disable: 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

CalDSX ParametersWidget2.png

     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 (uncorrected or corrected) are loaded, the Image Size will always be set to the actual size of the images being displayed. To resize X-ray images during correction, first select the session and configuration. CalibrateDSX will scan the uncorrected X-ray files in the calibration trials and display their size in the widget. Then change the values to the desired size before selecting the first calibration trial to correct.

Image Padding

The number of pixels to add onto all four sides of an X-ray image during correction. Image padding is meant to be used when distortion correction might increase the size of the images. However, distortion correction usually makes the images smaller, so the default value is 0.

Image Threshold

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. If uniformity correction is not performed, this threshold is not used.

Gauss Kernel

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

The standard deviation of the Gaussian distribution curve used for image 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 entire image. A negative value indicates that no thresholding will occur. The default value is -1.0.

White Threshold View 1

The relative intensity threshold when uniformity-correcting the X-ray images for the first view. 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.

White Threshold View 2

The relative intensity threshold when uniformity-correcting the X-ray images for the second view. 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

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

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 Size Range

The size range, in pixels, of the centroids representing the beads/holes in the grid images. If a centroid has a pixel size not in this range, it is ignored for the purposes of distortion correction.

Grid Min Num Centroids

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

Whether or not to shift all frame times so that none of them is negative. If this box is checked, 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

This section contains the parameters that control the digitization of POIs in the X-ray images. When you are digitizing POIs in the images, there are two methods of determining the XY coordinates in the 2D images. The recommended method is to left-click on any portion of the POI in the image and let CalibrateDSX calculate the weighted center of pixels representing the POI. This process is described in detail in Digitizing POIs, and is governed by the parameters listed below. For cases in which this process does not correctly locate the POI center (e.g., non-circular POIs), you can use Ctrl-left-click to specify the point. In this case CalibrateDSX will use the exact XY coordinates of where you clicked as the 2D location of the POI in that view.

POI Scale

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.

Click Search Factor

Used when manually digitizing POIs in the X-ray images. If you click at point X,Y in an image, a region of the image around this point is searched for the best location of a grayscale "blob". 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. This factor should be set small enough so that the search region includes only the POI you are currently digitizing.

Propagation Search Factor

Used when propagating POIs in the X-ray images. In order to propagate a POI with 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 "blob". 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. This factor should be set large enough so that the search region captures the movement of the POI from one frame to the next, but small enough so that it does not include other POIs.

Centroid Threshold

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

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.

Pose Map Cutoff Frequency

The low-pass cutoff frequency for smoothing the cubic splines in the POI pose maps. If the value is set to 0.0 smoothing is turned off.

     3D Calibration
Image Distance Allowance

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

Specifies whether or not to optimize the pixel size when calculating the 3D configuration parameters. The default value is false (box is unchecked).

Square Pixels

Specifies whether or not to force the X and Y pixel sizes to be the same when distortion-correcting the X-ray images. The default value is true (box is checked).

     Image Processing
CalDSX ImageProcessingWidget.png
  • Show Processed X-rays: controls whether the original X-ray images or the thresholded X-ray images are displayed in the 2D windows.
  • Xray Threshold: Pixels in the X-ray images whose intensities are below this threshold are set to 0.0. The threshold is a percentage with a range of 0.0 to 1.0. This slider is disabled when uniformity or grid trials are loaded because those trials have their own threshold parameters in the Calibration Parameters widget.
     Settings Dialog
CalDSX SettingsDlg.png
  • Color Theme: lets you choose between a light and a dark color theme for the program's windows.
     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.

Viewpoint Manipulation

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