PatchedArray#

class patch_denoise.space_time.base.PatchedArray(array: ndarray[tuple[Any, ...], dtype[_ScalarT]], patch_shape: tuple[int, ...], patch_overlap: tuple[int, ...], dtype: DTypeLike = None, padding_mode: str = 'edge', **kwargs)[source]#

Bases: object

A container for accessing custom view of array easily.

Parameters:
  • array (np.ndarray)

  • patch_shape (tuple)

  • patch_overlap (tuple)

Methods

__init__

add2patch

Add to patch, in place.

get_patch

Get patch at linear index idx.

idx2slice

Convert linear patch index to slice.

linear_to_patch_indices

Convert linear patch index to patch indices.

set_patch

Set patch at linear index idx with value.

Attributes

n_patches

Get number of patches.

add2patch(idx, value)[source]#

Add to patch, in place.

get_patch(idx) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]#

Get patch at linear index idx.

idx2slice(idx)[source]#

Convert linear patch index to slice.

classmethod linear_to_patch_indices(idx, data_shape, patch_shape, patch_overlap)[source]#

Convert linear patch index to patch indices.

property n_patches: int#

Get number of patches.

set_patch(idx, value)[source]#

Set patch at linear index idx with value.