placecell.dataset.maze#
Dataset class for maze/arm 1D place cell analysis.
Classes
|
Dataset for 1D arm/maze place cell analysis. |
- class placecell.dataset.maze.MazeDataset(*args: Any, **kwargs: Any)#
Bases:
BasePlaceCellDatasetDataset for 1D arm/maze place cell analysis.
Overrides the behavior preprocessing, occupancy computation, and unit analysis steps to work on a concatenated 1D axis.
- Parameters:
args (Any)
kwargs (Any)
- property spatial_1d: SpatialMap1DConfig#
Shortcut to 1D spatial map config.
- property p_value_threshold: float#
P-value threshold from 1D spatial map config.
- load(*, force_redetect: bool = False) None#
Load neural traces, behavior from zone_tracking CSV, and vis assets.
MazeDatasetreads the zone-detectedzone_trackingCSV directly. If the CSV is missing,_run_zone_detection()is invoked first to project the rawbehavior_positionCSV onto the maze graph.- Parameters:
force_redetect (bool) – If
True, re-rundetect_zones_from_csv()even whenzone_tracking_pathalready exists. Useful when zone-detection parameters have changed and the cached output is stale.- Return type:
None
- preprocess_behavior() None#
Serialize to 1D, compute speed, and filter.
Zone and arm_position columns are already in self.trajectory from load(), so no extra CSV loading is needed.
- Return type:
None
- match_events() None#
Build the canonical neural-rate table for the maze pipeline.
- After this call:
self.canonicalholds one row per neural frame with columnsframe_index, neural_time, x, y, pos_1d, arm_index, [direction], speed_1d, s_unit_*.self.trajectory_1d_filteredis the speed-filtered canonical view restricted to arm frames, withframe_indexaliased toframe_index.self.event_placeis the long-format event table derived from the same speed-filtered view.
- Return type:
None
- compute_occupancy() None#
Compute 1D occupancy from speed-filtered arm trajectory.
- Return type:
None
- analyze_units(progress_bar: Any = None, n_workers: int = 1) None#
Run 1D spatial analysis for all deconvolved units.
- Parameters:
progress_bar (Any) – Progress bar wrapper, e.g.
tqdm.n_workers (int) – Number of parallel worker processes.
1(default) runs sequentially with no multiprocessing overhead.
- Return type:
None
- save_bundle(path: str | Path, *, save_figures: bool = True) Path#
Save bundle, including 1D trajectory and maze metadata.
- Parameters:
path (str | Path)
save_figures (bool)
- Return type:
Path
- classmethod load_bundle(path: str | Path) MazeDataset#
Load a saved
.pcellbundlethat contains 1D maze data.Restores all base attributes via the parent loader, then adds 1D-specific state (trajectories, arm boundaries, etc.).
- Parameters:
path (str | Path)
- Return type: