Resegmenter#

class zrad.preprocessing.resegmentation.Resegmenter(intensity_range=None, outlier_range=None)[source]#

Apply range and outlier re-segmentation to RoiData.intensity_mask.

Re-segmentation removes voxels from the intensity ROI by replacing excluded voxels with NaN and clearing prepared texture and IVH images. Range re-segmentation is evaluated on RoiData.image and applied to the existing RoiData.intensity_mask. If both criteria are configured, range re-segmentation is applied first; outlier statistics are then calculated from the remaining valid intensity-mask values.

Parameters:
  • intensity_range (tuple[float, float] or None, optional) – Inclusive lower and upper intensity limits as (lower, upper). If None, range re-segmentation is skipped.

  • outlier_range (float, str, or None, optional) – Number of standard deviations around the ROI mean to retain. If None is supplied, outlier re-segmentation is skipped.

Methods

apply(roi_data)

Return ROI data with an updated intensity mask.

get_params()

Return re-segmentation parameters mapped to their configured values.

Resegmenter.apply(roi_data)[source]#

Return ROI data with an updated intensity mask.

Parameters:

roi_data (RoiData) – ROI data containing image, morphological_mask, and intensity_mask. The intensity mask is usually created with IntensityMaskBuilder before re-segmentation.

Returns:

roi_data – New ROI data with intensity_mask updated by the configured range and outlier criteria.

Return type:

RoiData

Resegmenter.get_params()[source]#

Return re-segmentation parameters mapped to their configured values.

Returns:

params – Dictionary containing intensity_range and outlier_range.

Return type:

dict