BaseSpaceTimeDenoiser#
- class patch_denoise.space_time.base.BaseSpaceTimeDenoiser(patch_shape, patch_overlap, recombination='weighted')[source]#
Bases:
ABCBase Class for Patch-based denoising methods for dynamical data.
- Parameters:
Methods
__init__Denoise the input_data, according to mask.
- _get_patch_param(data_shape: tuple[int, int, int, int]) tuple[tuple[int, int, int, int], tuple[int, int, int, int]][source]#
Return tuple for patch_shape and patch_overlap.
It works from whatever the input format was (int or list). This method also ensure that the patch will provide tall and skinny matrices.
- denoise(input_data: NDArray, mask: NDArray | None = None, mask_threshold: int = 50, progbar=None) tuple[NDArray, NDArray, NDArray, NDArray][source]#
Denoise the input_data, according to mask.
Patches are extracted sequentially and process by the implemented _patch_processing function. Only patches which have at least a voxel in the mask ROI are processed.
- Parameters:
input_data (numpy.ndarray) – The input data to denoise. It should be a ND array, and the last dimension should a dynamically varying one (eg time).
progbar (tqdm.tqdm Progress bar, optiononal) – An existing Progressbar, default (None) will create a new one.
- mask: numpy.ndarray
A boolean array, defining a ROI in the volume. Only patch with voxels in the ROI will be processed.
- mask_threshold: int
percentage of the path that has to be in the mask so that the patch is processed. if mask_threshold = -1, all the patch are processed, if mask_threshold=100, all the voxels of the patch needs to be in the mask
- Returns:
numpy.ndarray: The denoised sequence of volume numpy.ndarray: The weight of each pixel after the processing. numpy.ndarray: If possible, the noise variance distribution in the volume numpy.ndarray: If possible, the rank of each patch in the volume.
- Return type: