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
resample (img:torch.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)
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
get_pinhole_camera (drr:diffdrr.drr.DRR, pose:diffdrr.pose.RigidTransform, dtype:torch.dtype=torch.float64)