Onset Workflow
neureptrace.onset_workflow runs onset detection across multiple task result directories and writes task-level plus combined summaries.
Example:
python -m neureptrace.onset_workflow \
--task-dir results/nod_animate_all \
--task-dir results/nod_superclass_canine_device_all \
--task-dir results/nod_superclass_container_covering_all \
--threshold-window -0.100 0.000 \
--threshold-quantile 0.95 \
--threshold-method max_run \
--detection-start 0.000 \
--detection-window 0.000 0.800 \
--min-consecutive 3 \
--require-stable-prediction \
--out-dir results/onset_detection_all \
--plot-out results/onset_detection_all/onset_summary.png
The workflow looks for observations/*_observations.csv in each task directory by default. It writes per-task onset_events.csv and onset_summary.csv files, a combined onset_summary_all.csv, and optionally a compact plot and combined event table.
Use --detection-window 0.000 0.800 for a post-stimulus latency benchmark. Use
an earlier start, for example --detection-window -0.200 0.800, when the goal is
to allow and count pre-stimulus false alarms.
neureptrace.onset_workflow
OnsetWorkflowRun
dataclass
Top-level outputs from a multi-task onset workflow.
Source code in src/neureptrace/onset_workflow.py
39 40 41 42 43 44 45 46 47 | |
TaskOnsetOutput
dataclass
Output paths and counts for one task-directory onset run.
Source code in src/neureptrace/onset_workflow.py
26 27 28 29 30 31 32 33 34 35 36 | |
plot_onset_summary(summary, out_path)
Plot compact onset latency and false-alarm summaries.
Source code in src/neureptrace/onset_workflow.py
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 | |
run_onset_workflow(task_dirs, *, out_dir, observations_glob=DEFAULT_OBSERVATIONS_GLOB, threshold_window=DEFAULT_THRESHOLD_WINDOW, threshold_quantile=DEFAULT_THRESHOLD_QUANTILE, threshold_method='point', score_column='confidence', detection_start=None, detection_window=DEFAULT_DETECTION_WINDOW, event_window=None, min_consecutive=1, min_duration=None, require_stable_prediction=False, allow_missing=False, write_combined_events=False, plot_out=None)
Run onset detection across multiple task result directories.
Source code in src/neureptrace/onset_workflow.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
run_task_onset_detection(task_dir, *, out_dir, observations_glob=DEFAULT_OBSERVATIONS_GLOB, threshold_window=DEFAULT_THRESHOLD_WINDOW, threshold_quantile=DEFAULT_THRESHOLD_QUANTILE, threshold_method='point', score_column='confidence', detection_start=None, detection_window=DEFAULT_DETECTION_WINDOW, event_window=None, min_consecutive=1, min_duration=None, require_stable_prediction=False)
Run onset detection for one benchmark task directory.
The task directory is expected to contain observation files under
observations/*_observations.csv unless observations_glob is changed.
Outputs are written under out_dir / task_dir.name.
Source code in src/neureptrace/onset_workflow.py
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 | |