neuralib.model.rastermap.core

typeddict neuralib.model.rastermap.core.UserCluster[source]

GUI selected clusters

Optional Keys:
  • ids (ndarray) – Neuronal ids. Array[int, N]

  • slice (slice) – Binned neurons range

  • binsize (int) – Neuron bins

  • color (ndarray) – Colors. Array[float, 4]

typeddict neuralib.model.rastermap.core.RasterOptions[source]

Run Rastermap model options. Refer to the rastermap.rastermap.setting_info()

Optional Keys:
  • n_clusters (int) – Number of clusters created from data before upsampling and creating embedding (any number above 150 will be very slow due to NP-hard sorting problem)

  • n_PCs (int) – Number of PCs to use during optimization

  • time_lag_window (float) – Number of time points into the future to compute cross-correlation, useful for sequence finding

  • locality (float) – How local should the algorithm be – set to 1.0 for highly local + sequence finding

  • n_splits (int) – Recluster and sort n_splits times (increases local neighborhood preservation)

  • time_bin (int) – Binning of data in time before PCA is computed

  • grid_upsample (int) – How much to upsample clusters

  • mean_time (bool) – Whether to project out the mean over data samples at each timepoint, usually good to keep on to find structure

  • verbose (bool) – Whether to output progress during optimization

  • verbose_sorting (bool) – Output progress in travelling salesman

  • start_time (int)

  • end_time (int)

class neuralib.model.rastermap.core.RasterMapResult[source]

Container for storing the rastermap result, For both GUI load and customized plotting purpose

Dimension parameters:

N = Number of neurons/pixel

T = Number of image pulse

C = Number of clusters = N / binsize

__init__(filename, save_path, isort, embedding, ops, user_clusters=NOTHING, super_neurons=None)

Method generated by attrs for class RasterMapResult.

Parameters:
  • filename (str)

  • save_path (str)

  • isort (ndarray)

  • embedding (ndarray)

  • ops (RasterOptions)

  • user_clusters (list[UserCluster])

  • super_neurons (ndarray | None)

Return type:

None

filename: str

Filename of the neural activity data (i.e., *.tif or *.avi for wfield activity; .npy Array[float, [N, T]] file for cellular)

save_path: str

filename for the rastermap result save

isort: ndarray

Array[int, N]

embedding: ndarray

Array[float, [N, 1]]

ops: RasterOptions

RasterOptions

user_clusters: list[UserCluster]

list of clusters UserCluster

super_neurons: ndarray | None

super neuron activity. Array[float, [C, T]]

classmethod load(path)[source]

Load the results from rastermap output

Parameters:

path (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader) – file path of the rastermap output

Returns:

RasterMapResult

Return type:

Self

save(path)[source]

For GUI loading & cache computing for plotting in different time domains

Parameters:

path (Path)

Return type:

None

property n_super: int

number of clusters