ImageResampler#
- class zrad.preprocessing.interpolation.ImageResampler(resolution, method='linear', intensity_rounding=None)[source]#
Resample an image or
RoiData.imageonto a target voxel grid.Image resampling standardizes voxel spacing before downstream processing. Intensities are interpolated on a grid with the requested physical resolution while preserving image orientation and updating the origin.
- Parameters:
resolution (float or sequence of float) – Target voxel spacing in millimetres. A single positive value is applied to all three axes. A sequence must contain three positive values in
(x, y, z)order.method (str, optional) – Interpolation method used for image intensities. Supported values are
"linear","nearest_neighbor","bspline", and"gaussian"including common aliases such as"trilinear"and"nn". The default is"linear".intensity_rounding ({None, "nearest_integer"}, optional) – Optional post-processing for resampled intensities. Use
"nearest_integer"to round values to the nearest integer and cast them toint16. The default keeps floating-point intensities.
Methods
|
Return a resampled image or ROI data with a resampled image. |
Return image-resampling parameters mapped to their configured values. |