io
xvr.io
read_xray
read_xray(
filename: Path,
crop: int = 0,
subtract_background: bool = False,
linearize: bool = True,
reducefn: str | int | Callable = "max",
)
Read and preprocess an X-ray image from a DICOM file. Returns the pixel array and imaging system intrinsics.
Path
Path to the DICOM file.
crop : int, optional Number of pixels to crop from each edge of the image. subtract_background : bool, optional Subtract the mode image intensity from the image. linearize : bool, optional Convert the X-ray image from exponential to linear form. reducefn : If DICOM is multiframe, how to extract a single 2D image for registration.
Source code in src/xvr/io/xray.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |