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 rangebinsize (
int) – Neuron binscolor (
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 optimizationtime_lag_window (
float) – Number of time points into the future to compute cross-correlation, useful for sequence findinglocality (
float) – How local should the algorithm be – set to 1.0 for highly local + sequence findingn_splits (
int) – Recluster and sort n_splits times (increases local neighborhood preservation)time_bin (
int) – Binning of data in time before PCA is computedgrid_upsample (
int) – How much to upsample clustersmean_time (
bool) – Whether to project out the mean over data samples at each timepoint, usually good to keep on to find structureverbose (
bool) – Whether to output progress during optimizationverbose_sorting (
bool) – Output progress in travelling salesmanstart_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 (np.ndarray)
embedding (np.ndarray)
ops (RasterOptions)
user_clusters (list[UserCluster])
super_neurons (np.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: np.ndarray
Array[int, N]
- embedding: np.ndarray
Array[float, [N, 1]]
- ops: RasterOptions
RasterOptions
- user_clusters: list[UserCluster]
list of clusters
UserCluster
- super_neurons: np.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:
- 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