Neuro¶
Neural-domain primitives for VneuroTK.
NeuroData¶
Neural signal container with trial-structured views.
Holds the raw neural array plus optional trial-boundary information, and
exposes epochs and continuous views derived from that structure.
NeuroData is not a NumPy array subclass — use :attr:data for the
raw array when NumPy operations are needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
ndarray
|
Raw neural array. |
required |
trial_starts
|
ndarray or None
|
Start sample index per trial. |
None
|
trial_ends
|
ndarray or None
|
End sample index per trial. |
None
|
data_mode
|
str or None
|
|
None
|
Examples:
>>> import numpy as np
>>> nd = NeuroData(np.random.randn(1000, 64))
>>> nd.shape
(1000, 64)
>>> nd.data[:100] # plain ndarray slice
Source code in src/vneurotk/neuro/base.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
continuous
property
¶
Concatenated-trials view, shape (total_trial_samples, nchan).
If the underlying data is already in continuous format it is returned as-is with a warning.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If trial structure is not available (call |
data
property
¶
Raw neural array as a plain :class:numpy.ndarray.
dtype
property
¶
Data type of the underlying data array.
epochs
property
¶
Trial-epoched view, shape (n_trials, n_timepoints, nchan).
If the underlying data is already in epochs format it is returned as-is with a warning.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If trial structure is not available (call |
ndim
property
¶
Number of dimensions of the underlying data array.
shape
property
¶
Shape of the underlying data array.
size
property
¶
Total number of elements.
TrialStructure¶
Value object produced by the trial-structure factory functions.
All fields are written atomically by :meth:BaseData._apply_trial_structure.
Source code in src/vneurotk/neuro/trial.py
Builders¶
Build a :class:TrialStructure for pre-epoched recordings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_ids
|
ndarray
|
Stimulus ID per trial, shape |
required |
vision_onsets
|
ndarray or None
|
Per-trial onset offsets within each epoch. |
required |
neuro_shape
|
tuple
|
Shape of the neuro array |
required |
existing_vision_onsets
|
ndarray or None
|
Fallback: onsets already stored on the Recording before this call. |
None
|
Returns:
| Type | Description |
|---|---|
TrialStructure
|
|
Source code in src/vneurotk/neuro/trial.py
Build a :class:TrialStructure for continuous (raw) recordings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visual_ids
|
ndarray
|
Stimulus ID per onset, shape |
required |
trial_window
|
list of float | int
|
Two-element |
required |
vision_onsets
|
ndarray
|
Onset sample indices, shape |
required |
ntime
|
int
|
Total number of time samples in the recording. |
required |
sfreq
|
float
|
Sampling frequency in Hz. |
required |
Returns:
| Type | Description |
|---|---|
TrialStructure
|
|