utils¶
xvr.utils.preprocess
¶
Standardize
¶
Identity
¶
Equalize
¶
Differentiable histogram equalization.
Soft-assigns pixels to bins with a Gaussian kernel so the histogram, and
therefore the equalized image, stays differentiable with respect to the
input. tau sets how soft that assignment is.
Source code in src/xvr/utils/preprocess.py
XrayTransforms
¶
XrayTransforms(
height: int,
width: int | None = None,
mean: float = 0.15,
std: float = 0.1,
equalize: bool = False,
) -> Compose
Build the resize-and-normalize pipeline shared by training and registration.
| PARAMETER | DESCRIPTION |
|---|---|
height
|
Output height in pixels.
TYPE:
|
width
|
Output width in pixels. Defaults to
TYPE:
|
mean
|
Mean used to normalize intensities.
TYPE:
|
std
|
Standard deviation used to normalize intensities.
TYPE:
|
equalize
|
If True, apply differentiable histogram equalization.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Compose
|
A |
Source code in src/xvr/utils/preprocess.py
xvr.utils.transforms
¶
read_rigid_transform
¶
Get the rigid or affine matrix for warping img_warped -> img.