neuralib.locomotion.spatial.PlaceFieldResult
- class neuralib.locomotion.spatial.PlaceFieldResult[source]
Bases:
NamedTupleResult of place field detection.
Dimension parameters:
B = number of spatial bins
- __init__()
Methods
__init__()count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
with_peak_filter(greater_than, less_than)Return a copy keeping only fields whose peak location passes the given bounds.
with_reliability_filter(reliability[, at_least])Return a copy keeping only fields active in at least
at_leastfraction of trials.with_width_filter(place_field_range)Return a copy keeping only fields within the given width range.
Attributes
Trial-averaged transient activity.
Trial-averaged baseline activity (scalar)
Spatial bin size in cm
Last valid bin index (= window - 1)
Number of detected place fields
Detected place fields as (start_bin, end_bin) index pairs
Peak location of each place field in cm
Width of each place field in cm
First valid bin index (always 0)
Amplitude threshold used for field detection
- start: int
First valid bin index (always 0)
- end: int
Last valid bin index (= window - 1)
- bin_size: float
Spatial bin size in cm
- pf: list[tuple[int, int]]
Detected place fields as (start_bin, end_bin) index pairs
- act: ndarray
Trial-averaged transient activity. Array[float, B]
- static __new__(_cls, start, end, bin_size, pf, act, baseline, threshold)
Create new instance of PlaceFieldResult(start, end, bin_size, pf, act, baseline, threshold)
- Parameters:
start (int)
end (int)
bin_size (float)
pf (list[tuple[int, int]])
act (ndarray)
baseline (float)
threshold (float)
- baseline: float
Trial-averaged baseline activity (scalar)
- threshold: float
Amplitude threshold used for field detection
- property n_pf: int
Number of detected place fields
- property pf_width: list[float]
Width of each place field in cm
- property pf_peak: list[float]
Peak location of each place field in cm
- with_width_filter(place_field_range)[source]
Return a copy keeping only fields within the given width range.
- Parameters:
place_field_range (tuple[int, int]) –
(min_cm, max_cm)width bounds (exclusive)- Return type:
Self
- with_reliability_filter(reliability, at_least=0.33)[source]
Return a copy keeping only fields active in at least
at_leastfraction of trials.- Parameters:
reliability (list[float]) – Per-field fraction of trials in which the field was active
at_least (float) – Minimum reliability threshold
- Return type:
Self
- with_peak_filter(greater_than, less_than)[source]
Return a copy keeping only fields whose peak location passes the given bounds.
- Parameters:
greater_than (float | None) – Exclude fields with peak < this value (cm)
less_than (float | None) – Exclude fields with peak > this value (cm)
- Return type:
Self