playnano.processing.mask_generators module¶
Module for masking features of AFM images in Numpy arrays.
- playnano.processing.mask_generators.mask_adaptive(data: ndarray, block_size: int = 15, offset: float = 0.0) ndarray[source]¶
Adaptive local mean threshold per block.
- Parameters:
- Returns:
Boolean mask array where True indicates pixels above the threshold.
- Return type:
np.ndarray
- playnano.processing.mask_generators.mask_below_threshold(data: ndarray, threshold: float = 0.0) ndarray[source]¶
Mask where data < threshold.
- Parameters:
data (numpy.ndarray) – Input 2D array.
threshold (float, optional) – Threshold value. Pixels less than this will be True. Default is 0.0.
- Returns:
Boolean mask array.
- Return type:
np.ndarray
- playnano.processing.mask_generators.mask_mean_offset(data: ndarray, factor: float = 1.0) ndarray[source]¶
Mask values greater than mean plus factor * standard deviation.
- Parameters:
data (numpy.ndarray) – Input 2D array.
factor (float, optional) – Factor multiplied by the standard deviation to define the threshold. Default is 1.0.
- Returns:
Boolean mask array.
- Return type:
np.ndarray
- playnano.processing.mask_generators.mask_morphological(data: ndarray, threshold: float = 0.0, structure_size: int = 3) ndarray[source]¶
Apply threshold and morphological closing to mask foreground.
- playnano.processing.mask_generators.mask_threshold(data: ndarray, threshold: float = 0.0) ndarray[source]¶
Mask where data > threshold.
- Parameters:
data (numpy.ndarray) – Input 2D array.
threshold (float, optional) – Threshold value. Pixels greater than this will be True. Default is 0.0.
- Returns:
Boolean mask array.
- Return type:
np.ndarray