@science-corporation/synapse 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api.d.ts +587 -65
- package/dist/api/api.js +5414 -4238
- package/dist/api/api.js.map +1 -1
- package/dist/api/proto.json +97 -30
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -2
- package/dist/config.js.map +1 -1
- package/dist/device.d.ts +6 -0
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +25 -0
- package/dist/device.js.map +1 -1
- package/dist/nodes/index.d.ts +2 -1
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +5 -3
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/spike_binner.d.ts +11 -0
- package/dist/nodes/{spike_detect.d.ts.map → spike_binner.d.ts.map} +1 -1
- package/dist/nodes/spike_binner.js +28 -0
- package/dist/nodes/{spike_detect.js.map → spike_binner.js.map} +1 -1
- package/dist/nodes/spike_detector.d.ts +11 -0
- package/dist/nodes/spike_detector.d.ts.map +1 -0
- package/dist/nodes/{spike_detect.js → spike_detector.js} +9 -9
- package/dist/nodes/spike_detector.js.map +1 -0
- package/package.json +1 -1
- package/src/api/api.d.ts +587 -65
- package/src/api/api.js +5555 -4296
- package/src/api/proto.json +97 -30
- package/src/config.ts +4 -2
- package/src/device.ts +34 -1
- package/src/nodes/index.ts +2 -1
- package/src/nodes/spike_binner.ts +30 -0
- package/src/nodes/spike_detector.ts +30 -0
- package/synapse-api/.github/pull_request_template.md +10 -0
- package/synapse-api/api/datatype.proto +1 -0
- package/synapse-api/api/node.proto +6 -3
- package/synapse-api/api/nodes/spike_binner.proto +7 -0
- package/synapse-api/api/nodes/spike_detector.proto +19 -0
- package/synapse-api/api/query.proto +19 -1
- package/synapse-api/api/synapse.proto +1 -0
- package/dist/nodes/spike_detect.d.ts +0 -11
- package/src/nodes/spike_detect.ts +0 -30
- package/synapse-api/api/nodes/spike_detect.proto +0 -16
package/src/api/proto.json
CHANGED
|
@@ -150,37 +150,52 @@
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
"
|
|
153
|
+
"SpikeBinnerConfig": {
|
|
154
154
|
"fields": {
|
|
155
|
-
"
|
|
156
|
-
"type": "SpikeDetectMode",
|
|
157
|
-
"id": 1
|
|
158
|
-
},
|
|
159
|
-
"thresholdUV": {
|
|
155
|
+
"binSizeMs": {
|
|
160
156
|
"type": "uint32",
|
|
161
|
-
"id":
|
|
162
|
-
}
|
|
157
|
+
"id": 1
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"TemplateMatcher": {
|
|
162
|
+
"fields": {
|
|
163
163
|
"templateUV": {
|
|
164
164
|
"rule": "repeated",
|
|
165
165
|
"type": "uint32",
|
|
166
|
-
"id":
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
"
|
|
166
|
+
"id": 1
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"Thresholder": {
|
|
171
|
+
"fields": {
|
|
172
|
+
"thresholdUV": {
|
|
173
173
|
"type": "uint32",
|
|
174
|
-
"id":
|
|
174
|
+
"id": 1
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"SpikeDetectorConfig": {
|
|
179
|
+
"oneofs": {
|
|
180
|
+
"config": {
|
|
181
|
+
"oneof": [
|
|
182
|
+
"thresholder",
|
|
183
|
+
"templateMatcher"
|
|
184
|
+
]
|
|
175
185
|
}
|
|
176
186
|
},
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
"fields": {
|
|
188
|
+
"thresholder": {
|
|
189
|
+
"type": "Thresholder",
|
|
190
|
+
"id": 1
|
|
191
|
+
},
|
|
192
|
+
"templateMatcher": {
|
|
193
|
+
"type": "TemplateMatcher",
|
|
194
|
+
"id": 2
|
|
195
|
+
},
|
|
196
|
+
"samplesPerSpike": {
|
|
197
|
+
"type": "uint32",
|
|
198
|
+
"id": 3
|
|
184
199
|
}
|
|
185
200
|
}
|
|
186
201
|
},
|
|
@@ -212,7 +227,8 @@
|
|
|
212
227
|
"kBroadband": 2,
|
|
213
228
|
"kSpiketrain": 3,
|
|
214
229
|
"kTimestamps": 4,
|
|
215
|
-
"kImage": 5
|
|
230
|
+
"kImage": 5,
|
|
231
|
+
"kWaveforms": 6
|
|
216
232
|
}
|
|
217
233
|
},
|
|
218
234
|
"DiskWriterConfig": {
|
|
@@ -458,6 +474,11 @@
|
|
|
458
474
|
"requestType": "QueryRequest",
|
|
459
475
|
"responseType": "QueryResponse"
|
|
460
476
|
},
|
|
477
|
+
"StreamQuery": {
|
|
478
|
+
"requestType": "StreamQueryRequest",
|
|
479
|
+
"responseType": "StreamQueryResponse",
|
|
480
|
+
"responseStream": true
|
|
481
|
+
},
|
|
461
482
|
"ListFiles": {
|
|
462
483
|
"requestType": "google.protobuf.Empty",
|
|
463
484
|
"responseType": "ListFilesResponse"
|
|
@@ -494,10 +515,11 @@
|
|
|
494
515
|
"kBroadbandSource": 3,
|
|
495
516
|
"kElectricalStimulation": 4,
|
|
496
517
|
"kOpticalStimulation": 5,
|
|
497
|
-
"
|
|
518
|
+
"kSpikeDetector": 6,
|
|
498
519
|
"kSpikeSource": 7,
|
|
499
520
|
"kSpectralFilter": 8,
|
|
500
|
-
"kDiskWriter": 9
|
|
521
|
+
"kDiskWriter": 9,
|
|
522
|
+
"kSpikeBinner": 10
|
|
501
523
|
}
|
|
502
524
|
},
|
|
503
525
|
"NodeConfig": {
|
|
@@ -509,10 +531,11 @@
|
|
|
509
531
|
"broadbandSource",
|
|
510
532
|
"electricalStimulation",
|
|
511
533
|
"opticalStimulation",
|
|
512
|
-
"
|
|
534
|
+
"spikeDetector",
|
|
513
535
|
"spectralFilter",
|
|
514
536
|
"diskWriter",
|
|
515
|
-
"spikeSource"
|
|
537
|
+
"spikeSource",
|
|
538
|
+
"spikeBinner"
|
|
516
539
|
]
|
|
517
540
|
}
|
|
518
541
|
},
|
|
@@ -545,8 +568,8 @@
|
|
|
545
568
|
"type": "OpticalStimulationConfig",
|
|
546
569
|
"id": 8
|
|
547
570
|
},
|
|
548
|
-
"
|
|
549
|
-
"type": "
|
|
571
|
+
"spikeDetector": {
|
|
572
|
+
"type": "SpikeDetectorConfig",
|
|
550
573
|
"id": 9
|
|
551
574
|
},
|
|
552
575
|
"spectralFilter": {
|
|
@@ -560,6 +583,10 @@
|
|
|
560
583
|
"spikeSource": {
|
|
561
584
|
"type": "SpikeSourceConfig",
|
|
562
585
|
"id": 12
|
|
586
|
+
},
|
|
587
|
+
"spikeBinner": {
|
|
588
|
+
"type": "SpikeBinnerConfig",
|
|
589
|
+
"id": 13
|
|
563
590
|
}
|
|
564
591
|
}
|
|
565
592
|
},
|
|
@@ -770,6 +797,14 @@
|
|
|
770
797
|
}
|
|
771
798
|
}
|
|
772
799
|
},
|
|
800
|
+
"StreamQueryRequest": {
|
|
801
|
+
"fields": {
|
|
802
|
+
"request": {
|
|
803
|
+
"type": "QueryRequest",
|
|
804
|
+
"id": 1
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
},
|
|
773
808
|
"QueryResponse": {
|
|
774
809
|
"oneofs": {
|
|
775
810
|
"response": {
|
|
@@ -799,6 +834,38 @@
|
|
|
799
834
|
}
|
|
800
835
|
}
|
|
801
836
|
},
|
|
837
|
+
"StreamQueryResponse": {
|
|
838
|
+
"oneofs": {
|
|
839
|
+
"response": {
|
|
840
|
+
"oneof": [
|
|
841
|
+
"impedance",
|
|
842
|
+
"selfTest"
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
"fields": {
|
|
847
|
+
"code": {
|
|
848
|
+
"type": "StatusCode",
|
|
849
|
+
"id": 1
|
|
850
|
+
},
|
|
851
|
+
"message": {
|
|
852
|
+
"type": "string",
|
|
853
|
+
"id": 2
|
|
854
|
+
},
|
|
855
|
+
"timestampNs": {
|
|
856
|
+
"type": "uint64",
|
|
857
|
+
"id": 3
|
|
858
|
+
},
|
|
859
|
+
"impedance": {
|
|
860
|
+
"type": "ImpedanceResponse",
|
|
861
|
+
"id": 4
|
|
862
|
+
},
|
|
863
|
+
"selfTest": {
|
|
864
|
+
"type": "SelfTestResponse",
|
|
865
|
+
"id": 5
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
},
|
|
802
869
|
"StatusCode": {
|
|
803
870
|
"values": {
|
|
804
871
|
"kOk": 0,
|
package/src/config.ts
CHANGED
|
@@ -5,7 +5,8 @@ import DiskWriter from "./nodes/disk_writer";
|
|
|
5
5
|
import ElectricalStimulation from "./nodes/electrical_stimulation";
|
|
6
6
|
import OpticalStimulation from "./nodes/optical_stimulation";
|
|
7
7
|
import SpectralFilter from "./nodes/spectral_filter";
|
|
8
|
-
import
|
|
8
|
+
import SpikeBinner from "./nodes/spike_binner";
|
|
9
|
+
import SpikeDetector from "./nodes/spike_detector";
|
|
9
10
|
import SpikeSource from "./nodes/spike_source";
|
|
10
11
|
import StreamIn from "./nodes/stream_in";
|
|
11
12
|
import StreamOut from "./nodes/stream_out";
|
|
@@ -19,7 +20,8 @@ const kNodeTypeObjectMap = {
|
|
|
19
20
|
[synapse.NodeType.kSpikeSource]: SpikeSource,
|
|
20
21
|
[synapse.NodeType.kOpticalStimulation]: OpticalStimulation,
|
|
21
22
|
[synapse.NodeType.kSpectralFilter]: SpectralFilter,
|
|
22
|
-
[synapse.NodeType.
|
|
23
|
+
[synapse.NodeType.kSpikeBinner]: SpikeBinner,
|
|
24
|
+
[synapse.NodeType.kSpikeDetector]: SpikeDetector,
|
|
23
25
|
[synapse.NodeType.kStreamIn]: StreamIn,
|
|
24
26
|
[synapse.NodeType.kStreamOut]: StreamOut,
|
|
25
27
|
};
|
package/src/device.ts
CHANGED
|
@@ -18,7 +18,7 @@ class Device {
|
|
|
18
18
|
if (!status.ok() || !client) {
|
|
19
19
|
throw new Error(`Failed to create client for ${uri}: ${status.message}`);
|
|
20
20
|
}
|
|
21
|
-
this.rpc = client;
|
|
21
|
+
this.rpc = client as synapse.SynapseDevice;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
async configure(config: Config, options: CallOptions = {}): Promise<Status> {
|
|
@@ -90,6 +90,39 @@ class Device {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
async streamQuery(
|
|
94
|
+
query: synapse.IStreamQueryRequest,
|
|
95
|
+
options: CallOptions = {},
|
|
96
|
+
callbacks: {
|
|
97
|
+
onData: (data: synapse.StreamQueryResponse) => void;
|
|
98
|
+
onEnd?: () => void;
|
|
99
|
+
onError?: (err: Error) => void;
|
|
100
|
+
onStatus?: (status: Status) => void;
|
|
101
|
+
}
|
|
102
|
+
) {
|
|
103
|
+
const { onData, onEnd, onError, onStatus } = callbacks;
|
|
104
|
+
const call = this.rpc.streamQuery(query, options);
|
|
105
|
+
call.on("data", (data: synapse.StreamQueryResponse) => {
|
|
106
|
+
onData(data);
|
|
107
|
+
});
|
|
108
|
+
if (onEnd) {
|
|
109
|
+
call.on("end", () => {
|
|
110
|
+
onEnd();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (onError) {
|
|
114
|
+
call.on("error", (err: ServiceError) => {
|
|
115
|
+
onError(err);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (onStatus) {
|
|
119
|
+
call.on("status", (grpcStatus) => {
|
|
120
|
+
onStatus?.(new Status(grpcStatus.code, grpcStatus.details));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return call;
|
|
124
|
+
}
|
|
125
|
+
|
|
93
126
|
// Logs
|
|
94
127
|
|
|
95
128
|
async getLogs(
|
package/src/nodes/index.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { default as DiskWriter } from "./disk_writer";
|
|
|
3
3
|
export { default as ElectricalStimulation } from "./electrical_stimulation";
|
|
4
4
|
export { default as OpticalStimulation } from "./optical_stimulation";
|
|
5
5
|
export { default as SpectralFilter } from "./spectral_filter";
|
|
6
|
-
export { default as
|
|
6
|
+
export { default as SpikeBinner } from "./spike_binner";
|
|
7
|
+
export { default as SpikeDetector } from "./spike_detector";
|
|
7
8
|
export { default as SpikeSource } from "./spike_source";
|
|
8
9
|
export { default as StreamIn } from "./stream_in";
|
|
9
10
|
export { default as StreamOut } from "./stream_out";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { synapse } from "../api/api";
|
|
2
|
+
import Node from "../node";
|
|
3
|
+
|
|
4
|
+
class SpikeBinner extends Node {
|
|
5
|
+
type = synapse.NodeType.kSpikeBinner;
|
|
6
|
+
config: synapse.ISpikeBinnerConfig;
|
|
7
|
+
|
|
8
|
+
constructor(config: synapse.ISpikeBinnerConfig = {}) {
|
|
9
|
+
super();
|
|
10
|
+
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
toProto(): synapse.NodeConfig {
|
|
15
|
+
return super.toProto({
|
|
16
|
+
spikeBinner: this.config,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static fromProto(proto: synapse.INodeConfig): SpikeBinner {
|
|
21
|
+
const { spikeBinner } = proto;
|
|
22
|
+
if (!spikeBinner) {
|
|
23
|
+
throw new Error("Invalid config, missing spikeBinner");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return new SpikeBinner(proto.spikeBinner);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default SpikeBinner;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { synapse } from "../api/api";
|
|
2
|
+
import Node from "../node";
|
|
3
|
+
|
|
4
|
+
class SpikeDetector extends Node {
|
|
5
|
+
type = synapse.NodeType.kSpikeDetector;
|
|
6
|
+
config: synapse.ISpikeDetectorConfig;
|
|
7
|
+
|
|
8
|
+
constructor(config: synapse.ISpikeDetectorConfig = {}) {
|
|
9
|
+
super();
|
|
10
|
+
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
toProto(): synapse.NodeConfig {
|
|
15
|
+
return super.toProto({
|
|
16
|
+
spikeDetector: this.config,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static fromProto(proto: synapse.INodeConfig): SpikeDetector {
|
|
21
|
+
const { spikeDetector } = proto;
|
|
22
|
+
if (!spikeDetector) {
|
|
23
|
+
throw new Error("Invalid config, missing spikeDetector");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return new SpikeDetector(proto.spikeDetector);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default SpikeDetector;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Summary
|
|
2
|
+
Brief overview of the changes
|
|
3
|
+
|
|
4
|
+
# Changes
|
|
5
|
+
* Detailed breakdown of what changed and why. If there are new/changed API concepts, explain how they are meant to be used.
|
|
6
|
+
|
|
7
|
+
# Testing
|
|
8
|
+
How can this change be tested?
|
|
9
|
+
|
|
10
|
+
Please provide a link to a reference server and client implementation in synapse-python.
|
|
@@ -6,12 +6,13 @@ import "api/datatype.proto";
|
|
|
6
6
|
import "api/nodes/broadband_source.proto";
|
|
7
7
|
import "api/nodes/electrical_stimulation.proto";
|
|
8
8
|
import "api/nodes/optical_stimulation.proto";
|
|
9
|
-
import "api/nodes/
|
|
9
|
+
import "api/nodes/spike_detector.proto";
|
|
10
10
|
import "api/nodes/spectral_filter.proto";
|
|
11
11
|
import "api/nodes/stream_out.proto";
|
|
12
12
|
import "api/nodes/stream_in.proto";
|
|
13
13
|
import "api/nodes/disk_writer.proto";
|
|
14
14
|
import "api/nodes/spike_source.proto";
|
|
15
|
+
import "api/nodes/spike_binner.proto";
|
|
15
16
|
|
|
16
17
|
enum NodeType {
|
|
17
18
|
kNodeTypeUnknown = 0;
|
|
@@ -20,10 +21,11 @@ enum NodeType {
|
|
|
20
21
|
kBroadbandSource = 3;
|
|
21
22
|
kElectricalStimulation = 4;
|
|
22
23
|
kOpticalStimulation = 5;
|
|
23
|
-
|
|
24
|
+
kSpikeDetector = 6;
|
|
24
25
|
kSpikeSource = 7;
|
|
25
26
|
kSpectralFilter = 8;
|
|
26
27
|
kDiskWriter = 9;
|
|
28
|
+
kSpikeBinner = 10;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
message NodeConfig {
|
|
@@ -35,10 +37,11 @@ message NodeConfig {
|
|
|
35
37
|
BroadbandSourceConfig broadband_source = 5;
|
|
36
38
|
ElectricalStimulationConfig electrical_stimulation = 6;
|
|
37
39
|
OpticalStimulationConfig optical_stimulation = 8;
|
|
38
|
-
|
|
40
|
+
SpikeDetectorConfig spike_detector = 9;
|
|
39
41
|
SpectralFilterConfig spectral_filter = 10;
|
|
40
42
|
DiskWriterConfig disk_writer = 11;
|
|
41
43
|
SpikeSourceConfig spike_source = 12;
|
|
44
|
+
SpikeBinnerConfig spike_binner = 13;
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package synapse;
|
|
4
|
+
|
|
5
|
+
message TemplateMatcher {
|
|
6
|
+
repeated uint32 template_uV = 1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message Thresholder {
|
|
10
|
+
uint32 threshold_uV = 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message SpikeDetectorConfig {
|
|
14
|
+
oneof config {
|
|
15
|
+
Thresholder thresholder = 1;
|
|
16
|
+
TemplateMatcher template_matcher = 2;
|
|
17
|
+
}
|
|
18
|
+
uint32 samples_per_spike = 3;
|
|
19
|
+
}
|
|
@@ -55,6 +55,12 @@ message QueryRequest {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
message StreamQueryRequest {
|
|
59
|
+
QueryRequest request = 1;
|
|
60
|
+
|
|
61
|
+
// Other options to fill in specific to a stream
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
message QueryResponse {
|
|
59
65
|
Status status = 1;
|
|
60
66
|
repeated uint32 data = 2;
|
|
@@ -62,4 +68,16 @@ message QueryResponse {
|
|
|
62
68
|
ImpedanceResponse impedance_response = 3;
|
|
63
69
|
SelfTestResponse self_test_response = 4;
|
|
64
70
|
}
|
|
65
|
-
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message StreamQueryResponse {
|
|
74
|
+
StatusCode code = 1;
|
|
75
|
+
string message = 2;
|
|
76
|
+
uint64 timestamp_ns = 3;
|
|
77
|
+
|
|
78
|
+
// We need to switch on the test being run
|
|
79
|
+
oneof response {
|
|
80
|
+
ImpedanceResponse impedance = 4;
|
|
81
|
+
SelfTestResponse self_test = 5;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -45,6 +45,7 @@ service SynapseDevice {
|
|
|
45
45
|
rpc Start(google.protobuf.Empty) returns (Status) {}
|
|
46
46
|
rpc Stop(google.protobuf.Empty) returns (Status) {}
|
|
47
47
|
rpc Query(QueryRequest) returns (QueryResponse) {}
|
|
48
|
+
rpc StreamQuery(StreamQueryRequest) returns (stream StreamQueryResponse) {}
|
|
48
49
|
|
|
49
50
|
rpc ListFiles(google.protobuf.Empty) returns (ListFilesResponse) {}
|
|
50
51
|
rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) {}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { synapse } from "../api/api";
|
|
2
|
-
import Node from "../node";
|
|
3
|
-
declare class SpikeDetect extends Node {
|
|
4
|
-
type: synapse.NodeType;
|
|
5
|
-
config: synapse.ISpikeDetectConfig;
|
|
6
|
-
constructor(config?: synapse.ISpikeDetectConfig);
|
|
7
|
-
toProto(): synapse.NodeConfig;
|
|
8
|
-
static fromProto(proto: synapse.INodeConfig): SpikeDetect;
|
|
9
|
-
}
|
|
10
|
-
export default SpikeDetect;
|
|
11
|
-
//# sourceMappingURL=spike_detect.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { synapse } from "../api/api";
|
|
2
|
-
import Node from "../node";
|
|
3
|
-
|
|
4
|
-
class SpikeDetect extends Node {
|
|
5
|
-
type = synapse.NodeType.kSpikeDetect;
|
|
6
|
-
config: synapse.ISpikeDetectConfig;
|
|
7
|
-
|
|
8
|
-
constructor(config: synapse.ISpikeDetectConfig = {}) {
|
|
9
|
-
super();
|
|
10
|
-
|
|
11
|
-
this.config = config;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
toProto(): synapse.NodeConfig {
|
|
15
|
-
return super.toProto({
|
|
16
|
-
spikeDetect: this.config,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static fromProto(proto: synapse.INodeConfig): SpikeDetect {
|
|
21
|
-
const { spikeDetect } = proto;
|
|
22
|
-
if (!spikeDetect) {
|
|
23
|
-
throw new Error("Invalid config, missing spikeDetect");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return new SpikeDetect(proto.spikeDetect);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default SpikeDetect;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package synapse;
|
|
4
|
-
|
|
5
|
-
message SpikeDetectConfig {
|
|
6
|
-
enum SpikeDetectMode {
|
|
7
|
-
kThreshold = 0;
|
|
8
|
-
kTemplate = 1;
|
|
9
|
-
kWavelet = 2;
|
|
10
|
-
}
|
|
11
|
-
SpikeDetectMode mode = 1;
|
|
12
|
-
uint32 threshold_uV = 2;
|
|
13
|
-
repeated uint32 template_uV = 3;
|
|
14
|
-
bool sort = 4;
|
|
15
|
-
uint32 bin_size_ms = 5;
|
|
16
|
-
}
|