masknmf.PMDArray#

class PMDArray(shape, u, v, mean_img, var_img, u_local_projector=None, device='cpu', rescale=True)[source]#

Factorized demixing array for PMD movie

Key assumption: the spatial basis matrix U has n + k columns; the first n columns is blocksparse (this serves as a local spatial basis for the data) and the last k columns can have unconstrained spatial support (these serve as a global spatial basis for the data).

Parameters:
  • shape (tuple) – (num_frames, fov_dim1, fov_dim2)

  • u (torch.sparse_coo_tensor) – shape (pixels, rank)

  • v (torch.tensor) – shape (rank, frames)

  • mean_img (torch.tensor) – shape (fov_dim1, fov_dim2). The pixelwise mean of the data

  • var_img (torch.tensor) – shape (fov_dim1, fov_dim2). A pixelwise noise normalizer for the data

  • u_local_projector (Optional[torch.sparse_coo_tensor]) – shape (pixels, rank)

  • resid_std (torch.tensor) – The residual standard deviation, shape (fov_dim1, fov_dim2)

  • device (str) – The device on which computations occur/data is stored

  • rescale (bool) – True if we rescale the PMD data (i.e. multiply by the pixelwise normalizer and add back the mean) in __getitem__

Examples#

PMD Compression

PMD Compression