Skip to main content

JSON_loading

Digital Event Series

Digital event series are data represented by an ordered sequence of timestamps. Examples include spike timestamps from extracellular recordings or behavioral events (e.g. go cue, reward given).

Digital Interval Series

16 bit binary representation

{
  "filepath": "ttl.bin",
  "data_type": "digital_interval",
  "name": "laser",
  "format": "uint16",
  "channel": 2, // REQUIRED, bit (0 based) for channel of interest
  "transition": "rising", //optional, 
  "clock": "master", //optional, clock signal to assign to these events
  "header_size": 0 //optional, number of bytes to skip at start of file
}
Element Description Required? Type Notes
filepath Path to binary file, relative to JSON file. Yes string
data_type Yes string “digital_interval”
name Name of the data once it is loaded into Neuralyzer Yes string
format Yes string “uint16”
channel Specifies which bit in binary representation should be extracted as digital interval No number Default is 0. Valid values range from 0-15
Transition “rising” will count a TTL interval as one extending from low-to-high transitions to high-to-low transitions. “falling” will count a TTL interval as one extending from high-to-low to low-to-high transitions. No string Default is “rising”. Valid values are “rising” or “falling”.
clock Clock signal to associate with this digital interval No string The clock string must match the name of a loaded clock signal.
header_size This many bytes will be skipped at the beginning of the file before reading the rest. No number Default is 0. Accepted values range from 0 to size of file in bytes.

CSV


{
  "filepath": "ttl.bin",
  "data_type": "digital_interval",
  "name": "laser",
  "format": "csv"

}
Element Description Required? Type Notes
filepath Path to csv file, relative to JSON file. Yes string
data_type Yes string “digital_interval”
name Name of the data once it is loaded into Neuralyzer Yes string
format Yes string “csv”

Tabular Binary Events (multi_column_binary)

Use this format when you have a tabular file with a time column and multiple binary event columns (0/1 values), and you want to extract intervals from contiguous “on” regions.

{
  "filepath": "events.dat",
  "data_type": "digital_interval",
  "name": "channel_v0",
  "format": "multi_column_binary",
  "header_lines_to_skip": 5,
  "data_column": 1,
  "delimiter": "\t",
  "binary_threshold": 0.5
}
Element Description Required? Type Notes
filepath Path to tabular data file, relative to JSON file. Yes string
data_type Yes string “digital_interval”
name Name of the data once loaded Yes string
format Yes string “multi_column_binary”
header_lines_to_skip Number of lines to skip before column headers No integer Default is 5
time_column Column index (0-based) for timestamps No integer Default is 0
data_column Column index (0-based) for binary event data No integer Default is 1
delimiter Column separator character No string Default is “ (tab)
binary_threshold Values >= threshold treated as 1 (on) No number Default is 0.5
sampling_rate Hz for converting fractional time to indices No number Default is 0.0
clock TimeFrame to associate with intervals No string Must match a loaded TimeFrame name
TipHow-To Guide

See How to Load Tabular Binary Event Data for a complete walkthrough with examples.

TimeFrame

TimeFrame objects define the time basis for other data. Multiple formats are supported.

Tabular Binary Events (multi_column_binary)

Load timestamps from a tabular file with fractional time values:

{
  "filepath": "events.dat",
  "data_type": "time",
  "name": "daq_clock",
  "format": "multi_column_binary",
  "header_lines_to_skip": 5,
  "time_column": 0,
  "delimiter": "\t",
  "sampling_rate": 14000.0
}
Element Description Required? Type Notes
filepath Path to tabular data file Yes string
data_type Yes string “time”
name Name for the TimeFrame Yes string
format Yes string “multi_column_binary”
header_lines_to_skip Lines to skip before column headers No integer Default is 5
time_column Column index (0-based) with timestamps No integer Default is 0
delimiter Column separator No string Default is “
sampling_rate Multiplier to convert fractional time to integers No number Default is 1.0
ImportantSampling Rate Required for Fractional Times

TimeFrame stores integer values. Set sampling_rate to convert fractional seconds to integers (e.g., 14000.0 for 14kHz sampling).

Default time clock (fallback)

If your JSON does not define data_type: "time" with name: "time", Neuralyzer attempts to populate the default time TimeFrame after the full config is loaded:

  • When video (or other media) was loaded and time is still empty, an identity frame index vector [0, 1, …, N-1] is created from the best available media (any media key—not only "media").
  • If you load only points, lines, or other non-media data, time stays empty unless you add an explicit time entry (for example format: "max_value" from an analog or digital event series).

Define time explicitly in JSON when you need a custom clock, a derived timebase, or a points-only session without video.

Forward-declared clocks

When multiple data objects share a custom clock (for example a DAQ master clock), declare clock names at the top of the JSON object before the data array:

{
  "clocks": ["master", "time"],
  "data": [
    {
      "filepath": "breath.bin",
      "data_type": "analog",
      "name": "breath",
      "format": "binary",
      "clock": "master"
    },
    {
      "format": "max_value",
      "data_type": "time",
      "name": "master",
      "source_data": "breath"
    },
    {
      "format": "derived",
      "data_type": "time",
      "name": "time",
      "source_timeframe": "master",
      "source_series": "camera_frames",
      "source_type": "event"
    }
  ]
}
Element Description Required? Type Notes
clocks Clock names to register as empty TimeFrames before loading data No array of strings Each name must be populated by a later data_type: "time" entry (or equivalent). Load fails if any declared clock is still empty after all entries are processed.

Data entries may reference a clock before that clock is populated. When the clock is already declared in clocks, data is registered on that clock immediately; otherwise clock bindings are deferred until after all data entries are loaded. The implicit default time clock is not validated unless it appears in clocks.

Spike2 (.smr / .smrx)

See the Spike2 (CED) acquisition guide for SonPy setup, ADC analog/event/interval loading, and clock assignment examples.