detector
Set up the 7 degrees-of-freedom parameters for the C-arm
Tip
The Detector
is usually initialized in the DRR
module and shouldn’t need to be called directly.
Detector
Detector (sdd:float, height:int, width:int, delx:float, dely:float, x0:float, y0:float, reorient:torch.Tensor, n_subsample:int|None=None, reverse_x_axis:bool=False)
Construct a 6 DoF X-ray detector system. This model is based on a C-Arm.
Type | Default | Details | |
---|---|---|---|
sdd | float | Source-to-detector distance (in units length) | |
height | int | Y-direction length (in units pixels) | |
width | int | X-direction length (in units pixels) | |
delx | float | X-direction spacing (in units length / pixel) | |
dely | float | Y-direction spacing (in units length / pixel) | |
x0 | float | Principal point x-coordinate (in units length) | |
y0 | float | Principal point y-coordinate (in units length) | |
reorient | Tensor | Frame-of-reference change matrix | |
n_subsample | int | None | None | Number of target points to randomly sample |
reverse_x_axis | bool | False | If pose includes reflection (in E(3) not SE(3)), reverse x-axis |
Detector.forward
Detector.forward (extrinsic:diffdrr.pose.RigidTransform, calibration:diffdrr.pose.RigidTransform)
Create source and target points for X-rays to trace through the volume.
Intrinsic matrix parsing
From a calibrated camera’s intrinsic matrix, calculate the following properties:
- Focal length (in units length)
- Principal point (in units length)
get_focal_length
get_focal_length (intrinsic, delx:float, dely:float)
Type | Details | |
---|---|---|
intrinsic | Intrinsic matrix (3 x 3 tensor) | |
delx | float | X-direction spacing (in units length) |
dely | float | Y-direction spacing (in units length) |
Returns | float | Focal length (in units length) |
get_principal_point
get_principal_point (intrinsic, height:int, width:int, delx:float, dely:float)
Type | Details | |
---|---|---|
intrinsic | Intrinsic matrix (3 x 3 tensor) | |
height | int | Y-direction length (in units pixels) |
width | int | X-direction length (in units pixels) |
delx | float | X-direction spacing (in units length) |
dely | float | Y-direction spacing (in units length) |
parse_intrinsic_matrix
parse_intrinsic_matrix (intrinsic, height:int, width:int, delx:float, dely:float)
Type | Details | |
---|---|---|
intrinsic | Intrinsic matrix (3 x 3 tensor) | |
height | int | Y-direction length (in units pixels) |
width | int | X-direction length (in units pixels) |
delx | float | X-direction spacing (in units length) |
dely | float | Y-direction spacing (in units length) |
make_intrinsic_matrix
make_intrinsic_matrix (detector:__main__.Detector)