Skip to main content

Neuralyzer::Transforms::V2

Neuralyzer::Transforms::V2

Namespaces

Name
Neuralyzer::Transforms::V2::Examples
Neuralyzer::Transforms::V2::RangeReductions
Neuralyzer::Transforms::V2::detail
Neuralyzer::Transforms::V2::Temporal

Classes

Name
struct Neuralyzer::Transforms::V2::AnalogIntervalPeakParams
Parameters for analog interval peak detection.
struct Neuralyzer::Transforms::V2::AnalogIntervalThresholdParams
Parameters for analog interval threshold detection.
struct Neuralyzer::Transforms::V2::DigitalIntervalBooleanParams
Parameters for digital interval boolean operations.
struct Neuralyzer::Transforms::V2::IntervalReductionParams
Parameters for interval reduction transforms.
struct Neuralyzer::Transforms::V2::SpikeWaveformExtractionParams
Parameters for spike waveform extraction.
struct Neuralyzer::Transforms::V2::ChannelPosition2D
2D channel position for explicit probe geometry override.
struct Neuralyzer::Transforms::V2::SwindaleEventDetectionParams
Parameters for Swindale multi-channel spike event detection.
struct Neuralyzer::Transforms::V2::NormalizeTimeParamsV2
Parameters for time normalization using value store bindings (V2 pattern).
struct Neuralyzer::Transforms::V2::ShiftDigitalEventSeriesParams
Parameters for shifting all DigitalEventSeries event times.
struct Neuralyzer::Transforms::V2::ZScoreNormalizationParamsV2
V2 parameters for Z-Score normalization.
struct Neuralyzer::Transforms::V2::ComputeContext
Context for transform execution.
struct Neuralyzer::Transforms::V2::DataManagerStepDescriptor
Descriptor for a pipeline step that includes DataManager integration.
struct Neuralyzer::Transforms::V2::DataManagerPipelineMetadata
Metadata for a DataManager-integrated pipeline.
struct Neuralyzer::Transforms::V2::DataManagerPipelineDescriptor
Complete pipeline descriptor with DataManager integration.
struct Neuralyzer::Transforms::V2::V2StepResult
Result of executing a single pipeline step.
struct Neuralyzer::Transforms::V2::V2PipelineResult
Result of executing a complete pipeline.
class Neuralyzer::Transforms::V2::DataManagerPipelineExecutor
Executor that runs V2 pipelines with DataManager integration.
struct Neuralyzer::Transforms::V2::NoParams
Empty parameter struct for transforms that don’t need configuration.
struct Neuralyzer::Transforms::V2::TransformMetadata
Metadata about a registered transform.
class Neuralyzer::Transforms::V2::ElementRegistry
Registry for element-level transforms.
struct Neuralyzer::Transforms::V2::AutoRegisterTypedExecutor
Automatically register typed executor factory when registering transform.
class Neuralyzer::Transforms::V2::RegisterTransform
RAII helper for compile-time transform registration.
class Neuralyzer::Transforms::V2::RegisterStatelessTransform
RAII helper for compile-time stateless transform registration.
class Neuralyzer::Transforms::V2::RegisterContextTransform
RAII helper for compile-time context-aware transform registration.
class Neuralyzer::Transforms::V2::RegisterTimeGroupedTransform
RAII helper for compile-time time-grouped transform registration.
class Neuralyzer::Transforms::V2::RegisterStatelessTimeGroupedTransform
RAII helper for compile-time stateless time-grouped transform registration.
class Neuralyzer::Transforms::V2::RegisterContextTimeGroupedTransform
RAII helper for compile-time context-aware time-grouped transform registration.
class Neuralyzer::Transforms::V2::RegisterBinaryTransform
RAII helper for compile-time binary transform registration.
class Neuralyzer::Transforms::V2::RegisterContainerTransform
RAII helper for compile-time container transform registration.
class Neuralyzer::Transforms::V2::RegisterBinaryContainerTransform
RAII helper for compile-time binary container transform registration.
struct Neuralyzer::Transforms::V2::ReductionKey
Key for looking up reductions by name and input type.
struct Neuralyzer::Transforms::V2::ReductionKeyHash
Hash function for ReductionKey.
struct Neuralyzer::Transforms::V2::ReductionTypeTriple
Triple key for typed lookup (input, output, params).
struct Neuralyzer::Transforms::V2::ReductionTypeTripleHash
class Neuralyzer::Transforms::V2::IRangeReduction
Base interface for type-erased range reductions.
class Neuralyzer::Transforms::V2::TypedRangeReduction
Typed implementation of range reduction.
class Neuralyzer::Transforms::V2::IRangeReductionParamExecutor
Interface for executing reductions with captured parameters.
class Neuralyzer::Transforms::V2::TypedRangeReductionParamExecutor
Typed parameter executor with captured parameters and reduction function.
class Neuralyzer::Transforms::V2::RangeReductionRegistry
Registry for range reduction operations.
struct Neuralyzer::Transforms::V2::RangeReductionStep
Descriptor for a terminal range reduction in a pipeline.
class Neuralyzer::Transforms::V2::TransformPipeline
Builder for chaining multiple transforms together.
struct Neuralyzer::Transforms::V2::StepTypeInfo
Per-step type resolution result.
struct Neuralyzer::Transforms::V2::TypeChainResult
Result of resolving a type chain through a sequence of transforms.
class Neuralyzer::Transforms::V2::IContainerExecutor
Interface for type-erased container execution.
class Neuralyzer::Transforms::V2::TypedContainerTransform
Type-erased wrapper for container transforms.
class Neuralyzer::Transforms::V2::TypedContainerExecutor
Executor for container transforms with captured parameters.
struct Neuralyzer::Transforms::V2::TimeExtractor
Type trait to extract the time from a range element.
struct Neuralyzer::Transforms::V2::DataExtractor
Type trait to extract the data from a range element.
class Neuralyzer::Transforms::V2::FlatZipView
A view that zips two time-ordered ranges with time synchronization and broadcasting.
struct Neuralyzer::Transforms::V2::TypeTriple
Key for looking up typed executors by full type signature.
struct Neuralyzer::Transforms::V2::TypeTripleHash
Hash function for TypeTriple.
struct Neuralyzer::Transforms::V2::is_in_variant
struct Neuralyzer::Transforms::V2::is_in_variant< T, std::variant< Ts… > >
class Neuralyzer::Transforms::V2::IParamExecutor
Interface for parameter executors with captured state.
class Neuralyzer::Transforms::V2::ITimeGroupedParamExecutor
Interface for time-grouped parameter executors with captured state.
class Neuralyzer::Transforms::V2::TypedParamExecutor
Concrete executor with full type information and captured parameters.
class Neuralyzer::Transforms::V2::TypedTimeGroupedParamExecutor
Concrete time-grouped executor with full type information and captured parameters.
class Neuralyzer::Transforms::V2::PipelineOutputBuilder
Helper to build output containers efficiently.
struct Neuralyzer::Transforms::V2::PipelineStep
Represents a single step in a transform pipeline.
struct Neuralyzer::Transforms::V2::ReductionStep
Represents a reduction that computes a value for the store.
struct Neuralyzer::Transforms::V2::ReductionStepDescriptor
JSON descriptor for loading ReductionStep from pipelines.
struct Neuralyzer::Transforms::V2::ContainerTransformMetadata
Metadata specific to container-level transforms.
struct Neuralyzer::Transforms::V2::is_tuple
Check if type is a tuple.
struct Neuralyzer::Transforms::V2::is_tuple< std::tuple< Ts… > >
struct Neuralyzer::Transforms::V2::input_arity
Get number of inputs (1 for single type, N for tuple).
struct Neuralyzer::Transforms::V2::input_arity< std::tuple< Ins… > >
struct Neuralyzer::Transforms::V2::input_types
Extract individual types from tuple or return single type.
struct Neuralyzer::Transforms::V2::input_types< std::tuple< Ts… > >
class Neuralyzer::Transforms::V2::TypedTransform
Compile-time typed transform function wrapper.
class Neuralyzer::Transforms::V2::TypedTransform< In, Out, void >
Specialization for transforms with no parameters.
class Neuralyzer::Transforms::V2::TypedTimeGroupedTransform
Type-safe wrapper for time-grouped transforms.
class Neuralyzer::Transforms::V2::TypedTimeGroupedTransform< In, Out, void >
Specialization for stateless time-grouped transforms (no parameters).
class Neuralyzer::Transforms::V2::TransformChain
Chain multiple transforms.
class Neuralyzer::Transforms::V2::RegisterBindingApplicator
RAII helper for registering binding applicators at static initialization.
struct Neuralyzer::Transforms::V2::RangeReductionMetadata
Metadata about a registered range reduction operation.
struct Neuralyzer::Transforms::V2::NoReductionParams
Empty parameter struct for reductions that don’t need configuration.
struct Neuralyzer::Transforms::V2::is_range_reduction
Check if a type is a valid range reduction function.
struct Neuralyzer::Transforms::V2::is_stateless_range_reduction
Check if a type is a stateless range reduction.
class Neuralyzer::Transforms::V2::PipelineValueStore
Runtime key-value store for pipeline intermediate values.
struct Neuralyzer::Transforms::V2::MultichannelTemplate
Multichannel spatio-temporal waveform template container.
struct Neuralyzer::Transforms::V2::TemplateRealignerParams
Configuration parameters for template realignment.
class Neuralyzer::Transforms::V2::MultichannelTemplateRealigner
Modular numerical engine for multichannel template calculation and alignment.
struct Neuralyzer::Transforms::V2::MultiInputTransformInfo
Multi-input metadata for a registered transform.
class Neuralyzer::Transforms::V2::TypeIndexMapper
Runtime mapping between element/container types, strings, and raggedness.

Types

Name
enum class WaveformAlignmentMode { OriginalEventTime, LocalNegativeTrough, LocalPositivePeak, SincSubSampleCOG, SincSubSampleTrough, IterativeTemplateFit}
Alignment mode for extracted spike waveform snippets.
enum class AlignmentMethod { V2WeightedCOG, NegativeTrough, PositivePeak, DetectionTime}
Alignment method for resolving cluster event timestamps.
enum class DetectionMethod { DynamicMultiphasic, UnipolarNegative, UnipolarPositive, BipolarAmplitude}
Detection filter mode for Stage 1 proto-event extraction.
enum class ClusteringMethod { GradientAscent, SpatioTemporalWindow}
Clustering mode for Stage 2 proto-event grouping.
enum class NaNPolicy { Fail, Propagate, Drop}
Policy for handling NaN/Inf rows in dimensionality reduction transforms.
enum class TransformLineageType { None, OneToOneByTime, AllToOneByTime, Subset, Source}
Describes the lineage relationship a transform creates.
using std::function< void( int step_index, std::string const &step_name, int step_progress, int overall_progress)> V2PipelineProgressCallback
Progress callback for V2 pipeline execution.
template <typename T >
using typename input_types< T >::type
input_types_t
using std::function< std::any( std::any const &base_params, std::map< std::string, std::string > const &bindings, PipelineValueStore const &store)> BindingApplicatorFn
Type-erased binding applicator function signature.
template <typename InElement ,typename Value >
using std::function< Value(InElement const &)>
ValueProjectionFn
Value projection function type.
template <typename InElement ,typename Value >
using std::function< ValueProjectionFn< InElement, Value >(PipelineValueStore const &)>
ValueProjectionFactoryV2
Factory that creates value projections from PipelineValueStore.
using std::function< std::any(std::any const &)> ErasedValueProjectionFn
Type-erased value projection function.
using std::function< ErasedValueProjectionFn(PipelineValueStore const &)> ErasedValueProjectionFactoryV2
Type-erased value projection factory.
template <typename InElement ,typename Value >
using std::pair< InElement const &, Value >
ProjectedPair
A lazy view that yields (source_element_ref, projected_value) pairs.
using std::variant< float, int64_t, std::string, ClockTicks > PipelineValue
Variant of all types supported by PipelineValueStore.
using std::variant< float, TimeFrameIndex, ClockTicks, Point2D< float >, Line2D, Mask2D > ElementVariant
Variant type for single elements in the transform pipeline.
using std::variant< std::vector< float >, std::vector< TimeFrameIndex >, std::vector< ClockTicks >, std::vector< Point2D< float > >, std::vector< Line2D >, std::vector< Mask2D > > BatchVariant
Variant type for batches of elements (for time-grouped transforms).
template <typename Container >
using typename ElementForSafe< Container >::type
ElementForSafe_t
template <typename Container >
using typename ElementFor< Container >::type
ElementFor_t
template <typename Container >
using typename ElementFor< Container >::type
ElementFor_t

Functions

Name
std::shared_ptr< DigitalEventSeries > analogIntervalPeak(DigitalIntervalSeries const & intervals, AnalogTimeSeries const & analog, AnalogIntervalPeakParams const & params, ComputeContext const & ctx)
Find peak values in analog signal within intervals.
std::shared_ptr< DigitalIntervalSeries > analogIntervalThreshold(AnalogTimeSeries const & input, AnalogIntervalThresholdParams const & params, ComputeContext const & ctx)
Detect intervals in analog signal based on threshold criteria.
std::shared_ptr< DigitalIntervalSeries > digitalIntervalBoolean(DigitalIntervalSeries const & input_series, DigitalIntervalSeries const & other_series, DigitalIntervalBooleanParams const & params, ComputeContext const & ctx)
Apply boolean logic between two DigitalIntervalSeries.
std::shared_ptr< TensorData > analogIntervalReduction(DigitalIntervalSeries const & intervals, AnalogTimeSeries const & analog, IntervalReductionParams const & params, ComputeContext const & ctx)
Gather analog data within intervals and reduce to a TensorData column.
std::shared_ptr< TensorData > eventIntervalReduction(DigitalIntervalSeries const & intervals, DigitalEventSeries const & events, IntervalReductionParams const & params, ComputeContext const & ctx)
Gather event data within intervals and reduce to a TensorData column.
std::shared_ptr< TensorData > intervalOverlapReduction(DigitalIntervalSeries const & intervals, DigitalIntervalSeries const & source, IntervalReductionParams const & params, ComputeContext const & ctx)
Gather overlapping intervals and reduce to a TensorData column.
std::shared_ptr< TensorData > extractSpikeWaveforms(TensorData const & voltage_data, DigitalEventSeries const & event_series, SpikeWaveformExtractionParams const & params, ComputeContext const & ctx)
Extract spatio-temporal multichannel waveform snippets for detected spike events.
std::shared_ptr< DigitalEventSeries > swindaleEventDetection(TensorData const & input, SwindaleEventDetectionParams const & params, ComputeContext const & ctx)
Detect multi-channel spike events across all channels of a TensorData container.
float normalizeTimeValueV2(TimeFrameIndex const & time, NormalizeTimeParamsV2 const & params)
Normalize a TimeFrameIndex to float value (V2 - uses bound params).
ClockTicks normalizeClockTicksValueV2(ClockTicks const & time, NormalizeTimeParamsV2 const & params)
Normalize a ClockTicks value (V2 - uses bound params).
float normalizeEventTimeValueV2(EventWithId const & event, NormalizeTimeParamsV2 const & params)
Normalize event time to float value (V2 - uses bound params).
float normalizeSampleTimeValueV2(AnalogTimeSeries::TimeValuePoint const & sample, NormalizeTimeParamsV2 const & params)
Normalize analog sample time to float value (V2 - uses bound params).
std::shared_ptr< DigitalEventSeries > normalizeDigitalEventSeriesRelative(DigitalEventSeries const & input, NormalizeTimeParamsV2 const & params, ComputeContext const & ctx)
Normalize every event in a DigitalEventSeries into relative ClockTicks.
std::shared_ptr< DigitalEventSeries > shiftDigitalEventSeries(DigitalEventSeries const & input, ShiftDigitalEventSeriesParams const & params, ComputeContext const & ctx)
Shift every event in a DigitalEventSeries by a fixed clock-tick offset.
float zScoreNormalizationV2(float value, ZScoreNormalizationParamsV2 const & params)
Apply Z-Score normalization to a single value (V2).
std::vector< DataInfo > load_data_from_json_config_v2(DataManager * dm, std::string const & json_filepath)
Load and execute transformation pipeline from JSON config (V2 version).
std::vector< DataInfo > load_data_from_json_config_v2(DataManager * dm, nlohmann::json const & j, std::string const & base_path)
Load and execute transformation pipeline from JSON object (V2 version).
void pushToBatch(BatchVariant & batch, ElementVariant const & element)
BatchVariant initBatchFromElement(ElementVariant const & element)
size_t getBatchSize(BatchVariant const & batch)
void clearBatch(BatchVariant & batch)
DataTypeVariant executePipeline(DataTypeVariant const & input, TransformPipeline const & pipeline)
Execute pipeline on variant input.
template <typename InElement ,typename Value >
ValueProjectionFactoryV2< InElement, Value >
bindValueProjectionV2(TransformPipeline const & pipeline)
Bind a pipeline with parameter bindings to produce a value projection factory.
TypeChainResult resolveTypeChain(std::type_index input_container_type, std::span< std::string const > step_names)
Resolve the type chain for a sequence of transform names.
template <typename InContainer ,typename OutContainer ,typename InElement ,typename OutElement ,typename Params >
std::shared_ptr< OutContainer >
applyElementTransform(InContainer const & input, std::string const & transform_name, Params const & params)
Apply element transform to a ragged container.
template <typename InContainer ,typename OutContainer ,typename InElement ,typename OutElement >
std::shared_ptr< OutContainer >
applyElementTransform(InContainer const & input, std::string const & transform_name)
Apply element transform to a ragged container (no params version).
template <typename InContainer ,typename OutContainer ,typename InElement ,typename OutElement ,typename Params >
std::shared_ptr< OutContainer >
applyTimeGroupedTransform(InContainer const & input, std::string const & transform_name, Params const & params)
Apply time-grouped transform to reduce ragged time series.
template <typename InContainer ,typename OutContainer ,typename InElement ,typename OutElement >
std::shared_ptr< OutContainer >
applyTimeGroupedTransform(InContainer const & input, std::string const & transform_name)
Apply time-grouped transform (no params version).
template <typename InContainer ,typename InElement ,typename OutElement ,typename Params >
auto
applyElementTransformView(InContainer const & input, std::string const & transform_name, Params const & params)
template <typename InContainer ,typename InElement ,typename OutElement >
auto
applyElementTransformView(InContainer const & input, std::string const & transform_name)
Apply element transform returning a lazy view (no params version).
template <typename InContainer ,typename Params >
auto
applyTransform(InContainer const & input, std::string const & transform_name, Params const & params)
Apply a registered transform by name, automatically deducing container types.
template <typename IterValue ,typename ElementType >
decltype(auto)
extractElement(IterValue const & iter_value)
Extract the actual data element from a container’s iterator value.
template <typename R1 ,typename R2 >
FlatZipView(R1 && , R2 && )
template <typename TS1 ,typename TS2 >
auto
makeZipView(TS1 const & ts1, TS2 const & ts2)
Helper function to create a FlatZipView from two RaggedTimeSeries.
template <typename Container ,typename Element >
void
addElementToContainer(Container & container, TimeFrameIndex time, Element && element)
Add element to output container, handling different container APIs.
template <typename In ,typename Mid ,typename Out ,typename Params1 ,typename Params2 >
auto
compose(TypedTransform< In, Mid, Params1 > const & first, TypedTransform< Mid, Out, Params2 > const & second)
Compose two transforms f(g(x)).
std::unordered_map< std::type_index, BindingApplicatorFn > & getBindingApplicatorRegistry()
Registry for binding applicators by parameter type.
std::any applyBindingsErased(std::type_index params_type, std::any const & base_params, std::map< std::string, std::string > const & bindings, PipelineValueStore const & store)
Apply bindings to type-erased parameters.
std::any tryApplyBindingsErased(std::type_index params_type, std::any const & base_params, std::map< std::string, std::string > const & bindings, PipelineValueStore const & store)
Try to apply bindings to type-erased parameters.
bool hasBindingApplicator(std::type_index params_type)
Check if a binding applicator is registered for a parameter type.
template <typename Params >
Params
applyBindings(Params const & base_params, std::map< std::string, std::string > const & bindings, PipelineValueStore const & store)
template <typename Params >
std::optional< Params >
tryApplyBindings(Params const & base_params, std::map< std::string, std::string > const & bindings, PipelineValueStore const & store)
Try to apply bindings, returning nullopt on failure.
template <typename Params >
void
registerBindingApplicatorFor()
Register a binding applicator for a parameter type.
template <std::ranges::input_range Range,typename Proj >
auto
makeProjectedView(Range && range, Proj && projection)
Create a lazy projected view from a range and projection function.
template <std::ranges::input_range Range,typename Proj >
auto
makeValueView(Range && range, Proj && projection)
Create a lazy view that yields only projected values.
template <typename InElement ,typename Value >
ErasedValueProjectionFn
eraseValueProjection(ValueProjectionFn< InElement, Value > typed_fn)
Wrap a typed value projection as a type-erased function.
template <typename InElement ,typename Value >
ErasedValueProjectionFactoryV2
eraseValueProjectionFactoryV2(ValueProjectionFactoryV2< InElement, Value > typed_factory)
Wrap a typed value projection factory as a type-erased factory.
template <typename InElement ,typename Value >
ValueProjectionFn< InElement, Value >
recoverValueProjection(ErasedValueProjectionFn erased_fn)
Recover a typed value projection from a type-erased function.
template <typename InElement ,typename Value >
ValueProjectionFactoryV2< InElement, Value >
recoverValueProjectionFactoryV2(ErasedValueProjectionFactoryV2 erased_factory)
Recover a typed value projection factory from a type-erased factory.
void register_transformsv2_commands()
Register TransformsV2 commands with the CommandRegistry singleton.
std::shared_ptr< TensorData > buildDimReductionOutput(arma::mat const & reduced, TensorData const & input, std::vector< std::size_t > const & valid_indices, NaNPolicy policy, std::size_t n_components, std::vector< std::string > const & col_names)
Build an output TensorData from a reduced matrix, handling NaN policies.
std::type_index individualInputToContainerType(std::type_index individual_type)
Map an individual input type (element or container) to a container type_index.
std::optional< MultiInputTransformInfo > getMultiInputTransformInfo(std::string const & transform_name)
Look up multi-input metadata for a transform by name.
std::optional< std::type_index > getSecondaryContainerType(std::type_index primary_container, std::span< std::type_index const > individual_input_types)
Determine the secondary container type for a binary transform.
std::optional< std::pair< std::string, std::string > > resolveOrderedBinaryInputKeys(std::string const & primary_key, std::type_index primary_container, std::string const & secondary_key, std::span< std::type_index const > individual_input_types)
Order primary and secondary keys to match registry input slot order.

Attributes

Name
bool is_in_variant_v
bool always_false
bool is_tuple_v
size_t input_arity_v
bool is_range_reduction_v
bool is_stateless_range_reduction_v
bool has_element_type_v
True when the container supports element-level transform pipelines (has elements()).

Types Documentation

enum WaveformAlignmentMode

Enumerator Value Description
OriginalEventTime Extract directly around the input discrete event timestamp.
LocalNegativeTrough Re-align to discrete local minimum on center channel.
LocalPositivePeak Re-align to discrete local maximum on center channel.
SincSubSampleCOG Sub-sample continuous V^2 energy centroid alignment.
SincSubSampleTrough Sub-sample continuous trough alignment.
IterativeTemplateFit Sub-sample iterative multichannel template alignment.

Alignment mode for extracted spike waveform snippets.

enum AlignmentMethod

Enumerator Value Description
V2WeightedCOG V^2 weighted center of gravity (default; robust continuous energy centroid).
NegativeTrough Discrete local minimum / deepest negative trough on center channel.
PositivePeak Discrete local maximum / positive peak on center channel.
DetectionTime Direct timestamp of the primary proto-event.

Alignment method for resolving cluster event timestamps.

enum DetectionMethod

Enumerator Value Description
DynamicMultiphasic Primary threshold crossing + 2T excursion within temporal window (recommended).
UnipolarNegative Detect negative troughs only (standard extracellular APs).
UnipolarPositive Detect positive peaks only.
BipolarAmplitude Detect extrema of either polarity.

Detection filter mode for Stage 1 proto-event extraction.

enum ClusteringMethod

Enumerator Value Description
GradientAscent Swindale GAC (mean-shift) density clustering.
SpatioTemporalWindow Greedy space-time lockout window.

Clustering mode for Stage 2 proto-event grouping.

enum NaNPolicy

Enumerator Value Description
Fail Return nullptr if any NaN/Inf rows are present.
Propagate Skip NaN rows for computation, fill them with NaN in the output.
Drop Remove NaN rows entirely (output has fewer rows than input).

Policy for handling NaN/Inf rows in dimensionality reduction transforms.

enum TransformLineageType

Enumerator Value Description
None No lineage tracking (default) - output is independent of input entities.
OneToOneByTime 1:1 mapping by time: output[t, i] derives from input[t, i] Example: calculateMaskArea (each output area derives from one mask)
AllToOneByTime N:1 mapping by time: output[t] derives from ALL input entities at time t Example: SumReduction (single sum from all values at each time)
Subset Subset mapping: output contains a subset of input entities Example: Filtering by property threshold
Source Transform creates source data (no input lineage) Example: Loading from file, user annotation

Describes the lineage relationship a transform creates.

This enum allows transforms to declare what kind of entity relationship exists between their input and output data. The TransformPipeline uses this to automatically record lineage when executing transforms.

using V2PipelineProgressCallback

using Neuralyzer::Transforms::V2::V2PipelineProgressCallback =  std::function<void(
        int step_index,
        std::string const & step_name,
        int step_progress,
        int overall_progress)>;

Progress callback for V2 pipeline execution.

Parameters:

  • step_index Current step being executed (0-based)
  • step_name Name of the current step
  • step_progress Progress of current step (0-100)
  • overall_progress Overall pipeline progress (0-100)

using input_types_t

template <typename T >
using Neuralyzer::Transforms::V2::input_types_t =  typename input_types<T>::type;

using BindingApplicatorFn

using Neuralyzer::Transforms::V2::BindingApplicatorFn =  std::function<std::any(
    std::any const& base_params,
    std::map<std::string, std::string> const& bindings,
    PipelineValueStore const& store)>;

Type-erased binding applicator function signature.

Takes type-erased parameters (std::any), applies bindings, returns modified params.

using ValueProjectionFn

template <typename InElement ,
typename Value >
using Neuralyzer::Transforms::V2::ValueProjectionFn =  std::function<Value(InElement const &)>;

Value projection function type.

Template Parameters:

  • InElement Input element type (e.g., EventWithId)
  • Value Output value type (e.g., float for normalized time)

Takes a single source element and returns a computed value. The source element retains identity information (EntityId, etc.) that can be accessed separately.

Example


ValueProjectionFn<EventWithId, float> normalize = [alignment](EventWithId const& e) {
    return static_cast<float>(e.time().getValue() - alignment.getValue());
};

for (auto const& event : view) {
    float norm_time = normalize(event);
    EntityId id = event.id();  // Still accessible from source
}

using ValueProjectionFactoryV2

template <typename InElement ,
typename Value >
using Neuralyzer::Transforms::V2::ValueProjectionFactoryV2 =  std::function<ValueProjectionFn<InElement, Value>(PipelineValueStore const &)>;

Factory that creates value projections from PipelineValueStore.

The factory receives per-trial values from the store and produces a projection function with those values bound to transform parameters (via pipelines or manual parameter setup).

Design Goals

  1. Generic: No specialized context struct needed
  2. Composable: Store can be populated from any source (reductions, trial info, etc.)
  3. JSON-friendly: Works seamlessly with parameter binding via reflect-cpp

Usage with GatherResult

// Create pipeline with bindings
auto pipeline = loadPipelineFromJson(R"({
    "steps": [{
        "transform": "NormalizeTimeV2",
        "bindings": {"alignment_time": "alignment_time"}
    }]
})");

auto factory = bindValueProjectionV2<EventWithId, float>(pipeline);

for (size_t i = 0; i < result.size(); ++i) {
    auto store = buildGatherRowStore(result, i);
    auto projection = factory(store);

    for (auto const& event : result[i]->view()) {
        float norm_time = projection(event);
    }
}

InElementInput element type (e.g., EventWithId)

ValueOutput value type (e.g., float)

PipelineValueStore for store documentation

bindValueProjectionV2() for creating factories from pipelines

buildGatherRowStore() for populating store with trial values

using ErasedValueProjectionFn

using Neuralyzer::Transforms::V2::ErasedValueProjectionFn =  std::function<std::any(std::any const &)>;

Type-erased value projection function.

Used internally by the pipeline for runtime-typed execution. Input and output are wrapped in std::any.

using ErasedValueProjectionFactoryV2

using Neuralyzer::Transforms::V2::ErasedValueProjectionFactoryV2 =  std::function<ErasedValueProjectionFn(PipelineValueStore const &)>;

Type-erased value projection factory.

using ProjectedPair

template <typename InElement ,
typename Value >
using Neuralyzer::Transforms::V2::ProjectedPair =  std::pair<InElement const &, Value>;

A lazy view that yields (source_element_ref, projected_value) pairs.

Template Parameters:

  • InElement Source element type
  • Value Projected value type

This enables zero-allocation iteration where both the original element (for identity) and the projected value (for analysis) are available.

Note on Types

When using std::make_pair(std::cref(elem), value), the pair type becomes std::pair<Element const&, Value>, NOT std::pair<reference_wrapper, Value>. This means pair.first is a direct reference, not a wrapper.

Example


auto projected = makeProjectedView(trial_view, projection_fn);

for (auto const& pair : projected) {
    EntityId id = pair.first.id();  // pair.first is Element const&
    float norm_time = pair.second;
    draw(norm_time, trial_row, id);
}

using PipelineValue

using Neuralyzer::Transforms::V2::PipelineValue =  std::variant<float, int64_t, std::string, ClockTicks>;

Variant of all types supported by PipelineValueStore.

The store supports:

  • float: For floating-point scalars (statistics, measurements)
  • int64_t: For integer values (indices, counts, timestamps)
  • std::string: For string values (labels, categories)
  • ClockTicks: For time values in acquisition-clock coordinates

using ElementVariant

using Neuralyzer::Transforms::V2::ElementVariant =  std::variant<
    float,
    TimeFrameIndex,
    ClockTicks,
    Point2D<float>,
    Line2D,
    Mask2D
>;

Variant type for single elements in the transform pipeline.

Includes:

  • float: Scalar results (e.g., normalized times, areas) - first for default construction
  • TimeFrameIndex: Fundamental time type for temporal transforms (legacy index-space)
  • ClockTicks: Physical clock-tick time for temporal transforms
  • Point2D: 2D spatial points
  • Line2D: Polylines/curves
  • Mask2D: Binary masks

using BatchVariant

using Neuralyzer::Transforms::V2::BatchVariant =  std::variant<
    std::vector<float>,
    std::vector<TimeFrameIndex>,
    std::vector<ClockTicks>,
    std::vector<Point2D<float>>,
    std::vector<Line2D>,
    std::vector<Mask2D>
>;

Variant type for batches of elements (for time-grouped transforms).

Stores contiguous vectors of elements to allow zero-copy passing to transforms that expect std::span.

using ElementForSafe_t

template <typename Container >
using Neuralyzer::TypeTraits::ElementForSafe_t =  typename ElementForSafe<Container>::type;

using ElementFor_t

template <typename Container >
using Neuralyzer::TypeTraits::ElementFor_t =  typename ElementFor<Container>::type;

using ElementFor_t

template <typename Container >
using Neuralyzer::TypeTraits::ElementFor_t =  typename ElementFor<Container>::type;

Functions Documentation

function analogIntervalPeak

std::shared_ptr< DigitalEventSeries > analogIntervalPeak(
    DigitalIntervalSeries const & intervals,
    AnalogTimeSeries const & analog,
    AnalogIntervalPeakParams const & params,
    ComputeContext const & ctx
)

Find peak values in analog signal within intervals.

Parameters:

  • intervals Digital interval series defining search ranges
  • analog Analog time series to search for peaks
  • params Parameters controlling peak type and search mode
  • ctx Compute context for progress reporting and cancellation

Return: Digital event series with peak timestamps stored as analog TimeFrameIndex values. The implementation attaches the analog TimeFrame (when present) so view() resolves ClockTicks correctly; see AnalogIntervalPeak.qmd.

This is a binary container transform because:

  • Requires temporal alignment between intervals and analog data
  • Must search within time bounds of each interval
  • Cannot be decomposed into simple element operations

The transform handles:

  • TimeFrame conversion between interval and analog coordinate systems
  • Searching for min/max within each interval
  • Two search modes: within intervals or between interval starts

function analogIntervalThreshold

std::shared_ptr< DigitalIntervalSeries > analogIntervalThreshold(
    AnalogTimeSeries const & input,
    AnalogIntervalThresholdParams const & params,
    ComputeContext const & ctx
)

Detect intervals in analog signal based on threshold criteria.

Parameters:

  • input Input analog time series
  • params Threshold parameters (value, direction, lockout, min duration, missing data mode)
  • ctx Compute context for progress reporting and cancellation

Return: Shared pointer to digital interval series containing detected intervals

This is a container-level transform because:

  • Requires temporal context to detect interval start/end
  • Needs lockout period enforcement across time points
  • Must handle missing data gaps based on sampling rate
  • Produces intervals that span multiple time points

Algorithm:

  1. Iterate through time series samples
  2. Track when signal enters/exits threshold condition
  3. Apply lockout time after interval ends
  4. Filter intervals by minimum duration requirement
  5. Handle missing data gaps based on mode

function digitalIntervalBoolean

std::shared_ptr< DigitalIntervalSeries > digitalIntervalBoolean(
    DigitalIntervalSeries const & input_series,
    DigitalIntervalSeries const & other_series,
    DigitalIntervalBooleanParams const & params,
    ComputeContext const & ctx
)

Apply boolean logic between two DigitalIntervalSeries.

Parameters:

  • input_series Primary DigitalIntervalSeries
  • other_series Secondary DigitalIntervalSeries (ignored for NOT operation)
  • params Parameters specifying the boolean operation
  • ctx Compute context for progress reporting and cancellation

Return: New DigitalIntervalSeries containing the result of the boolean operation

This is a binary container transform because:

  • Requires temporal alignment between two interval series
  • Must compare overlapping time ranges
  • Cannot be decomposed into simple element operations

Operations:

  • AND: Returns intervals where both series have intervals
  • OR: Returns intervals where either series has an interval
  • XOR: Returns intervals where exactly one series has an interval
  • NOT: Returns intervals where the first series does NOT have intervals (ignores second series, operates within the time range of first)
  • AND_NOT: Returns intervals where first has intervals but second does not

function analogIntervalReduction

std::shared_ptr< TensorData > analogIntervalReduction(
    DigitalIntervalSeries const & intervals,
    AnalogTimeSeries const & analog,
    IntervalReductionParams const & params,
    ComputeContext const & ctx
)

Gather analog data within intervals and reduce to a TensorData column.

Parameters:

  • intervals DigitalIntervalSeries defining the row structure
  • analog AnalogTimeSeries to gather and reduce
  • params Parameters controlling the reduction
  • ctx Compute context for progress reporting and cancellation

Return: TensorData with one column of reduced values

This is a binary container transform because:

For each interval, the transform:

  1. Gathers AnalogTimeSeries samples within the interval range
  2. Applies the named range reduction (e.g., MeanValue, MaxValue)
  3. Produces one float value per interval

The output TensorData has:

  • Interval-based RowDescriptor (one row per interval)
  • A single column named by params.column_name
  • TimeFrame inherited from the interval series

function eventIntervalReduction

std::shared_ptr< TensorData > eventIntervalReduction(
    DigitalIntervalSeries const & intervals,
    DigitalEventSeries const & events,
    IntervalReductionParams const & params,
    ComputeContext const & ctx
)

Gather event data within intervals and reduce to a TensorData column.

Parameters:

  • intervals DigitalIntervalSeries defining the row structure
  • events DigitalEventSeries to gather and reduce
  • params Parameters controlling the reduction
  • ctx Compute context for progress reporting and cancellation

Return: TensorData with one column of reduced values

Same pattern as analogIntervalReduction but for DigitalEventSeries. Common reductions: EventCount, EventPresence, FirstPositiveLatency, etc.

function intervalOverlapReduction

std::shared_ptr< TensorData > intervalOverlapReduction(
    DigitalIntervalSeries const & intervals,
    DigitalIntervalSeries const & source,
    IntervalReductionParams const & params,
    ComputeContext const & ctx
)

Gather overlapping intervals and reduce to a TensorData column.

Parameters:

  • intervals DigitalIntervalSeries defining the row structure
  • source DigitalIntervalSeries to gather and reduce (e.g., stimulus intervals)
  • params Parameters controlling the reduction
  • ctx Compute context for progress reporting and cancellation

Return: TensorData with one column of reduced values

Same pattern as analogIntervalReduction but for DigitalIntervalSeries. Common reductions: IntervalCount, IntervalStartExtract, IntervalSourceIndex, etc.

function extractSpikeWaveforms

std::shared_ptr< TensorData > extractSpikeWaveforms(
    TensorData const & voltage_data,
    DigitalEventSeries const & event_series,
    SpikeWaveformExtractionParams const & params,
    ComputeContext const & ctx
)

Extract spatio-temporal multichannel waveform snippets for detected spike events.

Parameters:

  • voltage_data Multichannel continuous voltage tensor (T samples x C channels)
  • event_series Detected spike event timestamps (DigitalEventSeries)
  • params Extraction parameters (window widths, channel selection, alignment)
  • ctx Compute context for progress reporting and cancellation checks

Return: Shared pointer to 2D TensorData (N_events rows x [K_channels * L_points] columns)

Registered as BinaryContainerTransform: (TensorData, DigitalEventSeries) -> TensorData

function swindaleEventDetection

std::shared_ptr< DigitalEventSeries > swindaleEventDetection(
    TensorData const & input,
    SwindaleEventDetectionParams const & params,
    ComputeContext const & ctx
)

Detect multi-channel spike events across all channels of a TensorData container.

Parameters:

  • input Multi-channel tensor data (T time samples x C channels)
  • params Algorithm parameters (threshold, window width, alignment, probe geometry)
  • ctx Compute context for progress reporting and cancellation checks

Return: Shared pointer to DigitalEventSeries containing detected spike timestamps

function normalizeTimeValueV2

inline float normalizeTimeValueV2(
    TimeFrameIndex const & time,
    NormalizeTimeParamsV2 const & params
)

Normalize a TimeFrameIndex to float value (V2 - uses bound params).

Parameters:

  • time Input time to normalize
  • params Parameters with alignment_time bound from store

Return: float The normalized time (time - alignment_time)

This is the V2 version that uses NormalizeTimeParamsV2 with regular fields populated via parameter bindings.

TimeFrameIndex event_time{125};
NormalizeTimeParamsV2 params{.alignment_time = 100};

float norm_time = normalizeTimeValueV2(event_time, params);
// norm_time == 25.0f

function normalizeClockTicksValueV2

inline ClockTicks normalizeClockTicksValueV2(
    ClockTicks const & time,
    NormalizeTimeParamsV2 const & params
)

Normalize a ClockTicks value (V2 - uses bound params).

Parameters:

  • time Input clock-tick time to normalize
  • params Parameters with alignment_time bound from store

Return: ClockTicks The normalized time (time - alignment_time)

function normalizeEventTimeValueV2

inline float normalizeEventTimeValueV2(
    EventWithId const & event,
    NormalizeTimeParamsV2 const & params
)

Normalize event time to float value (V2 - uses bound params).

Parameters:

  • event Input event with absolute time
  • params Parameters with alignment_time bound from store

Return: float The normalized time (event.time() - alignment_time)

Convenience function for EventWithId that extracts time and normalizes.

function normalizeSampleTimeValueV2

inline float normalizeSampleTimeValueV2(
    AnalogTimeSeries::TimeValuePoint const & sample,
    NormalizeTimeParamsV2 const & params
)

Normalize analog sample time to float value (V2 - uses bound params).

Parameters:

  • sample Input sample with absolute time
  • params Parameters with alignment_time bound from store

Return: float The normalized time (sample.time() - alignment_time)

function normalizeDigitalEventSeriesRelative

inline std::shared_ptr< DigitalEventSeries > normalizeDigitalEventSeriesRelative(
    DigitalEventSeries const & input,
    NormalizeTimeParamsV2 const & params,
    ComputeContext const & ctx
)

Normalize every event in a DigitalEventSeries into relative ClockTicks.

Parameters:

  • input Input event series whose view() exposes ClockTicksWithId values
  • params Parameters containing the alignment time to subtract
  • ctx Compute context for cancellation

Return: Relative-time DigitalEventSeries with no TimeFrame

Container signature: DigitalEventSeries -> DigitalEventSeries. The output is backed by relative ClockTicks storage and preserves event EntityIds.

function shiftDigitalEventSeries

inline std::shared_ptr< DigitalEventSeries > shiftDigitalEventSeries(
    DigitalEventSeries const & input,
    ShiftDigitalEventSeriesParams const & params,
    ComputeContext const & ctx
)

Shift every event in a DigitalEventSeries by a fixed clock-tick offset.

Container signature: DigitalEventSeries -> DigitalEventSeries. The output preserves absolute storage and TimeFrame for absolute-time series, and uses relative storage for relative-time input series.

function zScoreNormalizationV2

inline float zScoreNormalizationV2(
    float value,
    ZScoreNormalizationParamsV2 const & params
)

Apply Z-Score normalization to a single value (V2).

Parameters:

  • value Input value to normalize
  • params Parameters containing mean and std_dev

Return: Normalized z-score value

Transforms value to z-score: z = (x - mean) / std

Unlike V1, this function uses params.mean and params.std_dev directly since they are populated via bindings before transform execution.

function load_data_from_json_config_v2

std::vector< DataInfo > load_data_from_json_config_v2(
    DataManager * dm,
    std::string const & json_filepath
)

Load and execute transformation pipeline from JSON config (V2 version).

Parameters:

  • dm Non-owning pointer to the DataManager (caller retains ownership).
  • json_filepath Path to the JSON configuration file

Return: std::vector List of loaded/transformed data info

Precondition:

  • dm must not be null (enforcement: exception — propagated from DataManagerPipelineExecutor constructor)
  • The DataManager object pointed to by dm must remain valid for the duration of this call (enforcement: none) [IMPORTANT]

This function provides the same interface as the V1 load_data_from_json_config but uses the V2 transformation system internally.

The JSON format matches V1: ```json

[ { “transformations”: { “metadata”: { “name”: “Pipeline Name”, “version”: “1.0” }, “steps”: [ { “step_id”: “1”, “transform_name”: “CalculateMaskArea”, “input_key”: “mask_data”, “output_key”: “areas”, “parameters”: {} } ] } }]



### function load_data_from_json_config_v2

```cpp
std::vector< DataInfo > load_data_from_json_config_v2(
    DataManager * dm,
    nlohmann::json const & j,
    std::string const & base_path
)

Load and execute transformation pipeline from JSON object (V2 version).

Parameters:

  • dm Non-owning pointer to the DataManager (caller retains ownership).
  • j Parsed JSON configuration object
  • base_path Base filesystem path for resolving relative paths in the config

Precondition:

  • dm must not be null (enforcement: exception — propagated from DataManagerPipelineExecutor constructor)
  • The DataManager object pointed to by dm must remain valid for the duration of this call (enforcement: none) [IMPORTANT]

function pushToBatch

void pushToBatch(
    BatchVariant & batch,
    ElementVariant const & element
)

function initBatchFromElement

BatchVariant initBatchFromElement(
    ElementVariant const & element
)

function getBatchSize

size_t getBatchSize(
    BatchVariant const & batch
)

function clearBatch

void clearBatch(
    BatchVariant & batch
)

function executePipeline

DataTypeVariant executePipeline(
    DataTypeVariant const & input,
    TransformPipeline const & pipeline
)

Execute pipeline on variant input.

function bindValueProjectionV2

template <typename InElement ,
typename Value >
ValueProjectionFactoryV2< InElement, Value > bindValueProjectionV2(
    TransformPipeline const & pipeline
)

Bind a pipeline with parameter bindings to produce a value projection factory.

Creates a factory function that takes PipelineValueStore and returns a value projection. Values from the store are bound to transform parameters via the param_bindings field.

Primary Use Case: Raster Plots with Value Store

// Pipeline with param bindings (loaded from JSON)
auto pipeline = loadPipelineFromJson(R"({
    "steps": [{
        "transform": "NormalizeTimeV2",
        "params": {},
        "param_bindings": {"alignment_time": "alignment_time"}
    }]
})");

auto factory = bindValueProjectionV2<EventWithId, float>(pipeline);

for (size_t i = 0; i < gather_result.size(); ++i) {
    auto store = buildGatherRowStore(gather_result, i);
    auto projection = factory(store);

    for (auto const& event : gather_result[i]->view()) {
        float norm_time = projection(event);  // Computed value
        EntityId id = event.id();             // From source element
        draw(norm_time, i, id);
    }
}

Binding Mechanism

  1. Store receives values: store.set("alignment_time", trial_start);
  2. Pipeline steps have bindings: {"alignment_time": "alignment_time"}
  3. Factory applies bindings: step.params.alignment_time = store[“alignment_time”]
  4. Projection uses bound params for transform

InElementInput element type (e.g., EventWithId)

ValueOutput value type (e.g., float)

pipelineThe transform pipeline with param_bindings

ValueProjectionFactoryV2 that produces projections from value store

std::runtime_errorif pipeline is empty or contains unsupported transforms

PipelineValueStore For value store documentation

buildGatherRowStore() For populating store with trial values

function resolveTypeChain

TypeChainResult resolveTypeChain(
    std::type_index input_container_type,
    std::span< std::string const > step_names
)

Resolve the type chain for a sequence of transform names.

Parameters:

  • input_container_type The container type_index feeding the chain (e.g. typeid(MaskData), typeid(AnalogTimeSeries))
  • step_names Ordered transform names (element or container level)

Return: TypeChainResult with per-step info and final output types

Starting from input_container_type, walks the transforms in order using metadata from the ElementRegistry. For each step the function records:

  • the human-readable input container name
  • the human-readable output container name
  • whether the step’s required input matches the running type

The ragged-container tracking mirrors TransformPipeline::execute():

  • time-grouped + produces_single_output → ragged becomes non-ragged
  • time-grouped + !produces_single_output → becomes ragged
  • element-wise transforms preserve the ragged state

function applyElementTransform

template <typename InContainer ,
typename OutContainer ,
typename InElement ,
typename OutElement ,
typename Params >
std::shared_ptr< OutContainer > applyElementTransform(
    InContainer const & input,
    std::string const & transform_name,
    Params const & params
)

Apply element transform to a ragged container.

Parameters:

  • input Input container
  • transform_name Name of registered transform
  • params Parameters for the transform

Template Parameters:

  • InContainer Input container type (e.g., MaskData)
  • OutContainer Output container type (e.g., RaggedAnalogTimeSeries)
  • InElement Input element type (e.g., Mask2D)
  • OutElement Output element type (e.g., float)
  • Params Parameter type for the transform

Return: Shared pointer to output container

Automatically lifts an element-level transform (e.g., Mask2D → float) to operate on a ragged container (e.g., MaskData → RaggedAnalogTimeSeries).

Uses std::ranges to preserve the ragged structure (multiple values per time).

function applyElementTransform

template <typename InContainer ,
typename OutContainer ,
typename InElement ,
typename OutElement >
std::shared_ptr< OutContainer > applyElementTransform(
    InContainer const & input,
    std::string const & transform_name
)

Apply element transform to a ragged container (no params version).

function applyTimeGroupedTransform

template <typename InContainer ,
typename OutContainer ,
typename InElement ,
typename OutElement ,
typename Params >
std::shared_ptr< OutContainer > applyTimeGroupedTransform(
    InContainer const & input,
    std::string const & transform_name,
    Params const & params
)

Apply time-grouped transform to reduce ragged time series.

Parameters:

  • input Input container
  • transform_name Name of registered time-grouped transform
  • params Parameters for the transform

Template Parameters:

  • InContainer Input container type (e.g., RaggedAnalogTimeSeries)
  • OutContainer Output container type (e.g., AnalogTimeSeries)
  • InElement Input element type (e.g., float)
  • OutElement Output element type (e.g., float)
  • Params Parameter type for the transform

Return: Shared pointer to output container

Applies a transform that operates on all values at each time point, typically reducing multiple values to fewer values (e.g., sum reduction).

Example: RaggedAnalogTimeSeries → AnalogTimeSeries (many floats per time → one float per time)

function applyTimeGroupedTransform

template <typename InContainer ,
typename OutContainer ,
typename InElement ,
typename OutElement >
std::shared_ptr< OutContainer > applyTimeGroupedTransform(
    InContainer const & input,
    std::string const & transform_name
)

Apply time-grouped transform (no params version).

function applyElementTransformView

template <typename InContainer ,
typename InElement ,
typename OutElement ,
typename Params >
auto applyElementTransformView(
    InContainer const & input,
    std::string const & transform_name,
    Params const & params
)

function applyElementTransformView

template <typename InContainer ,
typename InElement ,
typename OutElement >
auto applyElementTransformView(
    InContainer const & input,
    std::string const & transform_name
)

Apply element transform returning a lazy view (no params version).

function applyTransform

template <typename InContainer ,
typename Params >
auto applyTransform(
    InContainer const & input,
    std::string const & transform_name,
    Params const & params
)

Apply a registered transform by name, automatically deducing container types.

Parameters:

  • input Input container
  • transform_name Name of registered transform
  • params Parameters for the transform

Template Parameters:

  • InContainer Input container type
  • Params Parameter type

Return: Shared pointer to output container (type determined by registry)

This is a simplified API that uses the registry metadata to determine the appropriate output container type.

function extractElement

template <typename IterValue ,
typename ElementType >
decltype(auto) extractElement(
    IterValue const & iter_value
)

Extract the actual data element from a container’s iterator value.

Different containers have different iterator structures:

  • RaggedTimeSeries elements(): std::pair<TimeFrameIndex, DataEntry>
  • AnalogTimeSeries getAllSamples(): TimeValuePoint (has .value() method)
  • Some containers: direct value (float, etc.)

This helper uses compile-time checks to extract the correct data.

function FlatZipView

template <typename R1 ,
typename R2 >
FlatZipView(
    R1 && ,
    R2 && 
)

function makeZipView

template <typename TS1 ,
typename TS2 >
auto makeZipView(
    TS1 const & ts1,
    TS2 const & ts2
)

Helper function to create a FlatZipView from two RaggedTimeSeries.

Usage: auto zip = makeZipView(lines, points); for (auto [time, line, point] : zip) { … }

function addElementToContainer

template <typename Container ,
typename Element >
void addElementToContainer(
    Container & container,
    TimeFrameIndex time,
    Element && element
)

Add element to output container, handling different container APIs.

Different containers have different methods:

This helper uses compile-time checks to call the right method.

function compose

template <typename In ,
typename Mid ,
typename Out ,
typename Params1 ,
typename Params2 >
auto compose(
    TypedTransform< In, Mid, Params1 > const & first,
    TypedTransform< Mid, Out, Params2 > const & second
)

Compose two transforms f(g(x)).

Creates a new transform that applies g then f. Types must be compatible: In → Mid → Out

function getBindingApplicatorRegistry

std::unordered_map< std::type_index, BindingApplicatorFn > & getBindingApplicatorRegistry()

Registry for binding applicators by parameter type.

Each parameter type registers an applicator function during transform registration. This enables type-erased binding application in pipeline runtime.

function applyBindingsErased

std::any applyBindingsErased(
    std::type_index params_type,
    std::any const & base_params,
    std::map< std::string, std::string > const & bindings,
    PipelineValueStore const & store
)

Apply bindings to type-erased parameters.

Parameters:

  • params_type Type index of the parameter type
  • base_params Type-erased base parameters (std::any)
  • bindings Map from param field names to store keys
  • store The value store containing bound values

Exceptions:

  • std::runtime_error if no applicator is registered for the type

Return: Type-erased parameters with bound values applied

Uses the binding applicator registry to apply bindings at runtime when the parameter type is only known via type_index.

function tryApplyBindingsErased

std::any tryApplyBindingsErased(
    std::type_index params_type,
    std::any const & base_params,
    std::map< std::string, std::string > const & bindings,
    PipelineValueStore const & store
)

Try to apply bindings to type-erased parameters.

Parameters:

  • params_type Type index of the parameter type
  • base_params Type-erased base parameters
  • bindings Map from param field names to store keys
  • store The value store containing bound values

Return: Parameters with bound values applied, or original params on failure

Non-throwing version that returns the original parameters if binding fails.

function hasBindingApplicator

bool hasBindingApplicator(
    std::type_index params_type
)

Check if a binding applicator is registered for a parameter type.

Parameters:

  • params_type Type index to check

Return: true if an applicator is registered

function applyBindings

template <typename Params >
Params applyBindings(
    Params const & base_params,
    std::map< std::string, std::string > const & bindings,
    PipelineValueStore const & store
)

function tryApplyBindings

template <typename Params >
std::optional< Params > tryApplyBindings(
    Params const & base_params,
    std::map< std::string, std::string > const & bindings,
    PipelineValueStore const & store
)

Try to apply bindings, returning nullopt on failure.

Parameters:

  • base_params The base parameters to modify
  • bindings Map from param field names to store keys
  • store The value store containing bound values

Template Parameters:

  • Params Parameter type

Return: Parameters with bound values applied, or nullopt on failure

Non-throwing version of applyBindings for cases where binding failure should be handled gracefully.

function registerBindingApplicatorFor

template <typename Params >
void registerBindingApplicatorFor()

Register a binding applicator for a parameter type.

Template Parameters:

  • Params Parameter type to register

This is called automatically during transform registration via RegisterBindingApplicator helper class.

function makeProjectedView

template <std::ranges::input_range Range,
typename Proj >
auto makeProjectedView(
    Range && range,
    Proj && projection
)

Create a lazy projected view from a range and projection function.

Returns a range adaptor that yields (element_ref, projected_value) pairs. No intermediate storage is allocated - values are computed on iteration.

Type Note

Uses std::make_pair(std::cref(elem), value) which creates pair<T const&, Value>. The first element is a direct reference, not a reference_wrapper.

RangeInput range type

ProjProjection function type

rangeSource range of elements

projectionFunction to compute projected value

Lazy range of (element_ref, value) pairs

Example


auto view = trial->view();
auto projection = [](EventWithId const& e) { return e.time().getValue() * 0.001f; };

for (auto const& pair : makeProjectedView(view, projection)) {
    // pair.first is EventWithId const&
    // pair.second is float (computed on-demand)
    EntityId id = pair.first.id();
    float scaled = pair.second;
}

function makeValueView

template <std::ranges::input_range Range,
typename Proj >
auto makeValueView(
    Range && range,
    Proj && projection
)

Create a lazy view that yields only projected values.

Parameters:

  • range Source range of elements
  • projection Function to compute projected value

Template Parameters:

  • Range Input range type
  • Proj Projection function type

Return: Lazy range of projected values

When only the computed value is needed (not the source element), this provides a simpler interface.

Example


auto values = makeValueView(trial->view(), normalize_fn);
float sum = std::accumulate(values.begin(), values.end(), 0.0f);

function eraseValueProjection

template <typename InElement ,
typename Value >
ErasedValueProjectionFn eraseValueProjection(
    ValueProjectionFn< InElement, Value > typed_fn
)

Wrap a typed value projection as a type-erased function.

Parameters:

  • typed_fn The typed projection function

Template Parameters:

  • InElement Input element type
  • Value Output value type

Return: Type-erased projection function

Used by the pipeline to store projections in a type-erased manner.

function eraseValueProjectionFactoryV2

template <typename InElement ,
typename Value >
ErasedValueProjectionFactoryV2 eraseValueProjectionFactoryV2(
    ValueProjectionFactoryV2< InElement, Value > typed_factory
)

Wrap a typed value projection factory as a type-erased factory.

Parameters:

  • typed_factory The typed projection factory

Template Parameters:

  • InElement Input element type
  • Value Output value type

Return: Type-erased projection factory

function recoverValueProjection

template <typename InElement ,
typename Value >
ValueProjectionFn< InElement, Value > recoverValueProjection(
    ErasedValueProjectionFn erased_fn
)

Recover a typed value projection from a type-erased function.

Parameters:

  • erased_fn The type-erased projection function

Template Parameters:

  • InElement Expected input element type
  • Value Expected output value type

Return: Typed projection function

Used when consuming a projection with known types.

function recoverValueProjectionFactoryV2

template <typename InElement ,
typename Value >
ValueProjectionFactoryV2< InElement, Value > recoverValueProjectionFactoryV2(
    ErasedValueProjectionFactoryV2 erased_factory
)

Recover a typed value projection factory from a type-erased factory.

Parameters:

  • erased_factory The type-erased projection factory

Template Parameters:

  • InElement Expected input element type
  • Value Expected output value type

Return: Typed projection factory

function register_transformsv2_commands

void register_transformsv2_commands()

Register TransformsV2 commands with the CommandRegistry singleton.

Must be called once at startup before any command creation or introspection. Safe to call multiple times (subsequent calls are no-ops once commands exist).

function buildDimReductionOutput

std::shared_ptr< TensorData > buildDimReductionOutput(
    arma::mat const & reduced,
    TensorData const & input,
    std::vector< std::size_t > const & valid_indices,
    NaNPolicy policy,
    std::size_t n_components,
    std::vector< std::string > const & col_names
)

Build an output TensorData from a reduced matrix, handling NaN policies.

Parameters:

  • reduced Algorithm result matrix (n_components × valid_observations)
  • input Original input TensorData (for RowDescriptor, TimeFrame)
  • valid_indices Mapping from valid observation index → original row index
  • policy NaN policy (only Propagate and Drop are relevant here)
  • n_components Number of output columns
  • col_names Column names for the output (e.g. “PC1”, “PC2”)

Return: Output TensorData, or nullptr on construction failure

Precondition:

  • reduced.n_cols == valid_indices.size()
  • reduced.n_rows == n_components
  • col_names.size() == n_components

Converts the algorithm result (n_components × valid_observations, mlpack layout) into a TensorData that preserves the input’s RowDescriptor. The NaN policy determines how rows that were filtered during computation are handled:

  • Propagate: Output has the same row count as the input. Rows that were filtered out (NaN/Inf) get NaN-filled output. Preserves temporal alignment.
  • Drop: Output has only the valid rows. TimeFrameIndex and Interval rows are filtered to match.

function individualInputToContainerType

std::type_index individualInputToContainerType(
    std::type_index individual_type
)

Map an individual input type (element or container) to a container type_index.

Parameters:

  • individual_type Element or container type from registry metadata

Return: Container type_index suitable for DataManager key filtering

function getMultiInputTransformInfo

std::optional< MultiInputTransformInfo > getMultiInputTransformInfo(
    std::string const & transform_name
)

Look up multi-input metadata for a transform by name.

Parameters:

  • transform_name Registered transform name

Return: Metadata when the transform is binary; empty otherwise

function getSecondaryContainerType

std::optional< std::type_index > getSecondaryContainerType(
    std::type_index primary_container,
    std::span< std::type_index const > individual_input_types
)

Determine the secondary container type for a binary transform.

Parameters:

  • primary_container Container type of the focused primary input
  • individual_input_types Registered input types for the transform

Return: Secondary container type, or empty if primary does not match either slot

function resolveOrderedBinaryInputKeys

std::optional< std::pair< std::string, std::string > > resolveOrderedBinaryInputKeys(
    std::string const & primary_key,
    std::type_index primary_container,
    std::string const & secondary_key,
    std::span< std::type_index const > individual_input_types
)

Order primary and secondary keys to match registry input slot order.

Parameters:

  • primary_key Focused DataManager key
  • primary_container Container type of the focused input
  • secondary_key User-selected second DataManager key
  • individual_input_types Registered input types for the transform

Return: (input_key, additional_input_keys[0]) in registry order

Attributes Documentation

variable is_in_variant_v

bool is_in_variant_v = is_in_variant<T, Variant>::value;

variable always_false

bool always_false = false;

variable is_tuple_v

bool is_tuple_v = is_tuple<T>::value;

variable input_arity_v

size_t input_arity_v = input_arity<In>::value;

variable is_range_reduction_v

bool is_range_reduction_v = is_range_reduction<F, Element, Scalar, Params>::value;

variable is_stateless_range_reduction_v

bool is_stateless_range_reduction_v = is_stateless_range_reduction<F, Element, Scalar>::value;

variable has_element_type_v

bool has_element_type_v;

True when the container supports element-level transform pipelines (has elements()).


Updated on 2026-11-13 at 20:25:41 +0000