User Tools

Site Tools


other:dsx:x4d:pixel_difference

Pixel Difference

Each pixel in the processed DRR image is compared directly to its corresponding pixel in the X-ray image. To compare a DRR pixel to an X-ray 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 X-ray 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 X-ray 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.

Parameters


Parameters for Pixel Difference Metric

* View Weighting This factor is used when evaluating a bone pose by comparing the DRR images to the X-ray images. It is the relative weight of the two views in the final image metric (0.0 = all view 1, 1.0 = all view 2). 0.5 means to weight each view equally.

* Constant DRR Scaling 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 (//X-ray/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.

* Bright Factor This factor is used when evaluating a bone pose by comparing the DRR images to the X-ray images. The fitness of a pixel is weighted by its intensity in the DRR image. Once the raw fitness of a pixel is calculated (by finding the squared difference between the DRR value and the X-ray value) it is multiplied by the value: 1.0 + bright_factor * DRR_pixel_intensity.

* Bright Threshold This factor is used when evaluating a bone pose by comparing the DRR images to the X-ray images. The raw fitness of a pixel is calculated by taking the squared difference between the DRR value and the X-ray value. The raw fitness is squared again if the DRR pixel's intensity is greater than this value and the difference between it and the X-ray pixel's intensity is greater than Diff Threshold.

* Diff Threshold This factor is used when evaluating a bone pose by comparing the DRR images to the X-ray images. The raw fitness of a pixel is calculated by taking the squared difference between the DRR value and the X-ray value. The raw fitness is squared again if the DRR pixel's intensity is greater than Bright Threshold and the difference between it and the X-ray pixel's intensity is greater than this value.

* Xray Scale The processed X-ray image is scaled linearly by this factor so that all pixels are in the range 0 to this value.

* Drr Scale The processed DRR image is scaled linearly by this factor so that all pixels are in the range 0 to this value.

Note: Most of the time the scale values for the X-ray and DRR images should both be set to 255.0, but occasionally there are times when it is helpful to scale one image more than the other (e.g., when most of the bone edges in a DRR image are too dull because of one bright area that scales to 255.0).
other/dsx/x4d/pixel_difference.txt · Last modified: 2024/07/17 15:44 by sgranger