utils
Utility functions
Image resampling
Using simple morphological operations, an X-ray image with some set of intrinsic parameters can be resampled with a different set of intrinsics.
resample
def resample(
img:Tensor, focal_len:float, delx:float, x0:float=0, y0:float=0, new_focal_len:float=None, new_delx:float=None,
new_x0:float=None, new_y0:float=None
)->Tensor:
Resample an image with new intrinsic parameters.
Pinhole camera’s
Convert the intrinsic and extrinsic geometries, as implemented in DiffDRR, to a standard pinhole camera.
get_pinhole_camera
def get_pinhole_camera(
drr:DRR, pose:RigidTransform, dtype:dtype=torch.float64
)->PinholeCamera: