MaskResampler#
- class zrad.preprocessing.interpolation.MaskResampler(resolution, method='nearest_neighbor', partial_volume_threshold=0.5)[source]#
Resample a mask or
RoiData.morphological_maskonto a target voxel grid.Mask resampling aligns ROI geometry with the analysis grid. The interpolated mask is thresholded back to a binary image, which supports partial-volume handling when non-nearest interpolation is used.
- 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 before thresholding the mask. Supported values are
"nearest_neighbor","linear","bspline", and"gaussian"including common aliases. The default is"nearest_neighbor".partial_volume_threshold (float, optional) – Threshold applied after interpolation. Voxels greater than or equal to this value are assigned to the ROI; all other voxels are set to zero. If
Noneis supplied,0.5is used.
Methods
|
Return a resampled mask or ROI data with a resampled morphological mask. |
Return mask-resampling parameters mapped to their configured values. |