RoiCropper#

class zrad.preprocessing.roi.RoiCropper(padding=0)[source]#

Crop aligned images and masks to the ROI bounding box.

Cropping reduces the working image domain to the non-zero morphological ROI plus optional padding. Image geometry metadata is updated so the cropped image remains located correctly in physical space. Prepared texture and IVH images are cropped with the same bounding box, and re-segmentation and IVH metadata are preserved.

Parameters:

padding (int or sequence of int, optional) – Number of voxels to keep around the ROI bounding box. A single integer applies the same padding to all array axes. A sequence must contain one value per array axis in (z, y, x) order. The default is 0.

Methods

apply(roi_data)

Return ROI data cropped to the morphological ROI bounding box.

get_params()

Return ROI cropping parameters mapped to their configured values.

RoiCropper.apply(roi_data)[source]#

Return ROI data cropped to the morphological ROI bounding box.

Parameters:

roi_data (RoiData) – ROI data with morphological_mask and intensity_mask.

Returns:

roi_data – New ROI data with all available images cropped to the same bounding box.

Return type:

RoiData

RoiCropper.get_params()[source]#

Return ROI cropping parameters mapped to their configured values.

Returns:

params – Dictionary containing padding.

Return type:

dict