Neuralyzer::Transforms::V2::RangeReductions
Neuralyzer::Transforms::V2::RangeReductions
Classes
| Name | |
|---|---|
| struct | Neuralyzer::Transforms::V2::RangeReductions::TimeWindowParams Parameters for time window filtering. |
| struct | Neuralyzer::Transforms::V2::RangeReductions::ThresholdCrossParams Parameters for threshold crossing detection. |
| struct | Neuralyzer::Transforms::V2::RangeReductions::PercentileParams Parameters for percentile-based operations. |
Functions
| Name | |
|---|---|
| template <typename Element > int |
eventCount(std::span< Element const > events) |
| template <typename Element > float |
firstPositiveLatency(std::span< Element const > events) Find time of first event with positive time. |
| template <typename Element > float |
lastNegativeLatency(std::span< Element const > events) Find time of last event with negative time. |
| template <typename Element > int |
eventCountInWindow(std::span< Element const > events, TimeWindowParams const & params) |
| template <typename Element > float |
meanInterEventInterval(std::span< Element const > events) Compute inter-event interval statistics (mean). |
| template <typename Element > float |
eventTimeSpan(std::span< Element const > events) Get the time span of events (last - first). |
| template <typename Element > int |
eventPresence(std::span< Element const > events) Determine whether any events are present in the range. |
| template <typename Element > int |
intervalCount(std::span< Element const > intervals) Count total number of intervals in range. |
| template <typename Element > float |
intervalStartExtract(std::span< Element const > intervals) Extract the start time of the first interval in range. |
| template <typename Element > float |
intervalEndExtract(std::span< Element const > intervals) Extract the end time of the first interval in range. |
| template <typename Element > int |
intervalSourceIndex(std::span< Element const > intervals) Extract the source index (EntityId) of the first overlapping interval. |
| void | registerAllRangeReductions() Register all built-in range reductions. |
| void | registerEventRangeReductions() Register event-based range reductions (EventWithId). |
| void | registerValueRangeReductions() Register value-based range reductions (TimeValuePoint). |
| void | registerIntervalRangeReductions() Register interval-based range reductions (IntervalWithId). |
| template <typename Element > float |
maxValue(std::span< Element const > points) Find maximum value in range. |
| template <typename Element > float |
minValue(std::span< Element const > points) Find minimum value in range. |
| template <typename Element > float |
meanValue(std::span< Element const > points) Compute mean value in range. |
| template <typename Element > float |
stdValue(std::span< Element const > points) Compute standard deviation of values in range. |
| template <typename Element > float |
timeOfMax(std::span< Element const > points) Find time at which maximum value occurs. |
| template <typename Element > float |
timeOfMin(std::span< Element const > points) Find time at which minimum value occurs. |
| template <typename Element > float |
timeOfThresholdCross(std::span< Element const > points, ThresholdCrossParams const & params) Find first time when value crosses threshold. |
| template <typename Element > float |
sumValue(std::span< Element const > points) Compute sum of all values in range. |
| template <typename Element > float |
valueRange(std::span< Element const > points) Compute value range (max - min). |
| template <typename Element > float |
areaUnderCurve(std::span< Element const > points) Compute area under curve (trapezoidal integration). |
| template <typename Element > int |
countAboveThreshold(std::span< Element const > points, ThresholdCrossParams const & params) Count samples above a threshold. |
| template <typename Element > float |
fractionAboveThreshold(std::span< Element const > points, ThresholdCrossParams const & params) Compute fraction of samples above a threshold. |
| float | meanValueRaw(std::span< float const > values) Compute mean value from raw float span. |
| float | stdValueRaw(std::span< float const > values) Compute standard deviation from raw float span. |
| float | maxValueRaw(std::span< float const > values) Find maximum value from raw float span. |
| float | minValueRaw(std::span< float const > values) Find minimum value from raw float span. |
Functions Documentation
function eventCount
template <typename Element >
inline int eventCount(
std::span< Element const > events
)function firstPositiveLatency
template <typename Element >
inline float firstPositiveLatency(
std::span< Element const > events
)Find time of first event with positive time.
Parameters:
- events Range of events (should be sorted by time)
Template Parameters:
- Element Event element type (must have time() accessor returning numeric type)
Return: Time of first positive-time event, or NaN if none found
Note: Input should be sorted by time for meaningful results. After NormalizeTime transform, t=0 is the alignment point.
Returns the time of the first event where time() > 0. This is useful for computing first-spike latency after trial alignment.
function lastNegativeLatency
template <typename Element >
inline float lastNegativeLatency(
std::span< Element const > events
)Find time of last event with negative time.
Parameters:
- events Range of events (should be sorted by time)
Template Parameters:
- Element Event element type (must have time() accessor returning numeric type)
Return: Time of last negative-time event, or NaN if none found
Note: Input should be sorted by time for meaningful results. After NormalizeTime transform, t=0 is the alignment point.
Returns the time of the last event where time() < 0. This is useful for analyzing pre-stimulus activity.
function eventCountInWindow
template <typename Element >
inline int eventCountInWindow(
std::span< Element const > events,
TimeWindowParams const & params
)function meanInterEventInterval
template <typename Element >
inline float meanInterEventInterval(
std::span< Element const > events
)Compute inter-event interval statistics (mean).
Parameters:
- events Range of events (should be sorted by time)
Template Parameters:
- Element Event element type (must have time() accessor returning numeric type)
Return: Mean inter-event interval, or NaN if fewer than 2 events
Calculates the mean interval between consecutive events. Useful for characterizing firing rate or rhythmicity.
function eventTimeSpan
template <typename Element >
inline float eventTimeSpan(
std::span< Element const > events
)Get the time span of events (last - first).
Parameters:
- events Range of events (should be sorted by time)
Template Parameters:
- Element Event element type (must have time() accessor returning numeric type)
Return: Time span (last.time() - first.time()), or 0 if fewer than 2 events
Returns the duration from first to last event in the range.
function eventPresence
template <typename Element >
inline int eventPresence(
std::span< Element const > events
)Determine whether any events are present in the range.
Parameters:
- events Range of events
Template Parameters:
- Element Event element type
Return: 1 if any events exist, 0 otherwise
Returns 1 if the range contains any events, 0 otherwise. Stored as int for consistency with EventCount (both are integer-valued).
Equivalent to the old EventInIntervalComputer “Presence” mode.
function intervalCount
template <typename Element >
inline int intervalCount(
std::span< Element const > intervals
)Count total number of intervals in range.
Parameters:
- intervals Range of IntervalWithId elements
Return: Number of intervals in the range
Equivalent to the old IntervalOverlapComputer “CountOverlaps” mode.
function intervalStartExtract
template <typename Element >
inline float intervalStartExtract(
std::span< Element const > intervals
)Extract the start time of the first interval in range.
Parameters:
- intervals Range of IntervalWithId elements (should be sorted by start time)
Return: Start time of first interval as float, or NaN if empty
Equivalent to the old IntervalOverlapComputer “AssignID_Start” mode.
function intervalEndExtract
template <typename Element >
inline float intervalEndExtract(
std::span< Element const > intervals
)Extract the end time of the first interval in range.
Parameters:
- intervals Range of IntervalWithId elements (should be sorted by start time)
Return: End time of first interval as float, or NaN if empty
Equivalent to the old IntervalOverlapComputer “AssignID_End” mode.
function intervalSourceIndex
template <typename Element >
inline int intervalSourceIndex(
std::span< Element const > intervals
)Extract the source index (EntityId) of the first overlapping interval.
Parameters:
- intervals Range of IntervalWithId elements
Return: EntityId of first interval as int, or -1 if empty
Equivalent to the old IntervalOverlapComputer “AssignID” mode. Returns the EntityId of the first interval as an int, which represents the index of the source interval in the original series.
function registerAllRangeReductions
void registerAllRangeReductions()Register all built-in range reductions.
This is called automatically at static initialization time. You typically don’t need to call this manually unless you’re working with a custom registry instance.
function registerEventRangeReductions
void registerEventRangeReductions()Register event-based range reductions (EventWithId).
Registers:
- EventCount: Count total events
- FirstPositiveLatency: Time of first event after t=0
- LastNegativeLatency: Time of last event before t=0
- EventCountInWindow: Count events in time window
- MeanInterEventInterval: Mean interval between events
- EventTimeSpan: Duration from first to last event
function registerValueRangeReductions
void registerValueRangeReductions()Register value-based range reductions (TimeValuePoint).
Registers:
- MaxValue: Maximum value
- MinValue: Minimum value
- MeanValue: Mean value
- StdValue: Standard deviation
- TimeOfMax: Time of maximum value
- TimeOfMin: Time of minimum value
- TimeOfThresholdCross: First time crossing threshold
- SumValue: Sum of values
- ValueRange: Max - Min
- AreaUnderCurve: Trapezoidal integration
- CountAboveThreshold: Samples above threshold
- FractionAboveThreshold: Fraction above threshold
function registerIntervalRangeReductions
void registerIntervalRangeReductions()Register interval-based range reductions (IntervalWithId).
Registers:
- IntervalCount: Count of intervals in gathered range
- IntervalStartExtract: Start time of first interval
- IntervalEndExtract: End time of first interval
- IntervalSourceIndex: Entity ID of first interval
- EventPresence: Whether any events exist (1 or 0)
function maxValue
template <typename Element >
inline float maxValue(
std::span< Element const > points
)Find maximum value in range.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Maximum value, or -infinity if empty
function minValue
template <typename Element >
inline float minValue(
std::span< Element const > points
)Find minimum value in range.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Minimum value, or +infinity if empty
function meanValue
template <typename Element >
inline float meanValue(
std::span< Element const > points
)Compute mean value in range.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Mean value, or NaN if empty
function stdValue
template <typename Element >
inline float stdValue(
std::span< Element const > points
)Compute standard deviation of values in range.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Population standard deviation, or NaN if empty
Uses Welford’s online algorithm for numerical stability.
function timeOfMax
template <typename Element >
inline float timeOfMax(
std::span< Element const > points
)Find time at which maximum value occurs.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have time() and value() accessors)
Return: Time of maximum value, or NaN if empty
function timeOfMin
template <typename Element >
inline float timeOfMin(
std::span< Element const > points
)Find time at which minimum value occurs.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have time() and value() accessors)
Return: Time of minimum value, or NaN if empty
function timeOfThresholdCross
template <typename Element >
inline float timeOfThresholdCross(
std::span< Element const > points,
ThresholdCrossParams const & params
)Find first time when value crosses threshold.
Parameters:
- points Range of value points (should be sorted by time)
- params Threshold and direction parameters
Template Parameters:
- Element Value element type (must have time() and value() accessors)
Return: Time of first crossing, or NaN if no crossing found
Detects the first crossing point in the specified direction. A crossing occurs when:
- Rising: previous value < threshold AND current value >= threshold
- Falling: previous value >= threshold AND current value < threshold
function sumValue
template <typename Element >
inline float sumValue(
std::span< Element const > points
)Compute sum of all values in range.
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Sum of values, or 0 if empty
function valueRange
template <typename Element >
inline float valueRange(
std::span< Element const > points
)Compute value range (max - min).
Parameters:
- points Range of value points
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Range of values, or NaN if empty
function areaUnderCurve
template <typename Element >
inline float areaUnderCurve(
std::span< Element const > points
)Compute area under curve (trapezoidal integration).
Parameters:
- points Range of value points (should be sorted by time)
Template Parameters:
- Element Value element type (must have time() and value() accessors)
Return: Area under curve, or 0 if fewer than 2 points
Approximates the integral using the trapezoidal rule. Assumes time units are consistent with the desired area units.
function countAboveThreshold
template <typename Element >
inline int countAboveThreshold(
std::span< Element const > points,
ThresholdCrossParams const & params
)Count samples above a threshold.
Parameters:
- points Range of value points
- params Threshold parameters (only threshold is used, not direction)
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Number of samples with value > threshold
function fractionAboveThreshold
template <typename Element >
inline float fractionAboveThreshold(
std::span< Element const > points,
ThresholdCrossParams const & params
)Compute fraction of samples above a threshold.
Parameters:
- points Range of value points
- params Threshold parameters
Template Parameters:
- Element Value element type (must have value() accessor)
Return: Fraction (0.0 to 1.0) of samples above threshold, or NaN if empty
function meanValueRaw
inline float meanValueRaw(
std::span< float const > values
)Compute mean value from raw float span.
Parameters:
- values Raw float values
Return: Mean value, or NaN if empty
This overload works directly on float data without requiring a .value() accessor, enabling efficient processing of AnalogTimeSeries data without materialization.
function stdValueRaw
inline float stdValueRaw(
std::span< float const > values
)Compute standard deviation from raw float span.
Parameters:
- values Raw float values
Return: Population standard deviation, or NaN if empty
Uses Welford’s online algorithm for numerical stability.
function maxValueRaw
inline float maxValueRaw(
std::span< float const > values
)Find maximum value from raw float span.
Parameters:
- values Raw float values
Return: Maximum value, or -infinity if empty
function minValueRaw
inline float minValueRaw(
std::span< float const > values
)Find minimum value from raw float span.
Parameters:
- values Raw float values
Return: Minimum value, or +infinity if empty
Updated on 2026-11-13 at 20:25:41 +0000