@sjcrh/proteinpaint-types 2.138.1 → 2.138.3-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.
|
@@ -21,7 +21,7 @@ var sampleWSImagesPayload = {
|
|
|
21
21
|
var validSampleWSImagesRequest = (input) => {
|
|
22
22
|
const errors = [];
|
|
23
23
|
const __is = (input2) => {
|
|
24
|
-
return "object" === typeof input2 && null !== input2 && ("string" === typeof input2.genome && "string" === typeof input2.dslabel && "string" === typeof input2.sample_id && "string" === typeof input2.wsimage
|
|
24
|
+
return "object" === typeof input2 && null !== input2 && ("string" === typeof input2.genome && "string" === typeof input2.dslabel && "string" === typeof input2.sample_id && "string" === typeof input2.wsimage);
|
|
25
25
|
};
|
|
26
26
|
if (false === __is(input)) {
|
|
27
27
|
const $report = import_typia.createValidate.report(errors);
|
|
@@ -42,10 +42,6 @@ var validSampleWSImagesRequest = (input) => {
|
|
|
42
42
|
path: _path2 + ".wsimage",
|
|
43
43
|
expected: "string",
|
|
44
44
|
value: input3.wsimage
|
|
45
|
-
}), "number" === typeof input3.index || $report(_exceptionable2, {
|
|
46
|
-
path: _path2 + ".index",
|
|
47
|
-
expected: "number",
|
|
48
|
-
value: input3.index
|
|
49
45
|
})].every((flag) => flag);
|
|
50
46
|
return ("object" === typeof input2 && null !== input2 || $report(true, {
|
|
51
47
|
path: _path + "",
|
|
@@ -69,9 +65,10 @@ var validSampleWSImagesResponse = (input) => {
|
|
|
69
65
|
const errors = [];
|
|
70
66
|
const __is = (input2) => {
|
|
71
67
|
const $io0 = (input3) => Array.isArray(input3.sampleWSImages) && input3.sampleWSImages.every((elem) => "object" === typeof elem && null !== elem && $io1(elem));
|
|
72
|
-
const $io1 = (input3) => "string" === typeof input3.filename && (void 0 === input3.overlays || Array.isArray(input3.overlays) && input3.overlays.every((elem) => "string" === typeof elem)) && (void 0 === input3.predictionLayers || Array.isArray(input3.predictionLayers) && input3.predictionLayers.every((elem) => "string" === typeof elem)) && (void 0 === input3.
|
|
73
|
-
const $io2 = (input3) => Array.isArray(input3.zoomCoordinates) && (input3.zoomCoordinates.length === 2 && "number" === typeof input3.zoomCoordinates[0] && "number" === typeof input3.zoomCoordinates[1]) && "string" === typeof input3
|
|
74
|
-
const $io3 = (input3) => "number" === typeof input3.
|
|
68
|
+
const $io1 = (input3) => "string" === typeof input3.filename && (void 0 === input3.overlays || Array.isArray(input3.overlays) && input3.overlays.every((elem) => "string" === typeof elem)) && (void 0 === input3.predictionLayers || Array.isArray(input3.predictionLayers) && input3.predictionLayers.every((elem) => "string" === typeof elem)) && "string" === typeof input3.metadata && (void 0 === input3.annotationsData || Array.isArray(input3.annotationsData) && input3.annotationsData.every((elem) => "object" === typeof elem && null !== elem && $io2(elem))) && (void 0 === input3.predictions || Array.isArray(input3.predictions) && input3.predictions.every((elem) => "object" === typeof elem && null !== elem && $io3(elem))) && (void 0 === input3.classes || Array.isArray(input3.classes) && input3.classes.every((elem) => "object" === typeof elem && null !== elem && $io4(elem))) && true && (void 0 === input3.activePatchColor || "string" === typeof input3.activePatchColor) && (void 0 === input3.tileSize || "number" === typeof input3.tileSize);
|
|
69
|
+
const $io2 = (input3) => Array.isArray(input3.zoomCoordinates) && (input3.zoomCoordinates.length === 2 && "number" === typeof input3.zoomCoordinates[0] && "number" === typeof input3.zoomCoordinates[1]) && "string" === typeof input3["class"];
|
|
70
|
+
const $io3 = (input3) => Array.isArray(input3.zoomCoordinates) && (input3.zoomCoordinates.length === 2 && "number" === typeof input3.zoomCoordinates[0] && "number" === typeof input3.zoomCoordinates[1]) && "string" === typeof input3.type && "string" === typeof input3["class"] && "number" === typeof input3.uncertainty;
|
|
71
|
+
const $io4 = (input3) => "number" === typeof input3.id && "string" === typeof input3.shortcut && "string" === typeof input3.label && "string" === typeof input3.color;
|
|
75
72
|
return "object" === typeof input2 && null !== input2 && $io0(input2);
|
|
76
73
|
};
|
|
77
74
|
if (false === __is(input)) {
|
|
@@ -122,57 +119,42 @@ var validSampleWSImagesResponse = (input) => {
|
|
|
122
119
|
path: _path2 + ".predictionLayers",
|
|
123
120
|
expected: "(Array<string> | undefined)",
|
|
124
121
|
value: input3.predictionLayers
|
|
125
|
-
}), void 0 === input3.zoomInPoints || (Array.isArray(input3.zoomInPoints) || $report(_exceptionable2, {
|
|
126
|
-
path: _path2 + ".zoomInPoints",
|
|
127
|
-
expected: "(Array<[number, number]> | undefined)",
|
|
128
|
-
value: input3.zoomInPoints
|
|
129
|
-
})) && input3.zoomInPoints.map((elem, _index4) => (Array.isArray(elem) || $report(_exceptionable2, {
|
|
130
|
-
path: _path2 + ".zoomInPoints[" + _index4 + "]",
|
|
131
|
-
expected: "[number, number]",
|
|
132
|
-
value: elem
|
|
133
|
-
})) && ((elem.length === 2 || $report(_exceptionable2, {
|
|
134
|
-
path: _path2 + ".zoomInPoints[" + _index4 + "]",
|
|
135
|
-
expected: "[number, number]",
|
|
136
|
-
value: elem
|
|
137
|
-
})) && [
|
|
138
|
-
"number" === typeof elem[0] || $report(_exceptionable2, {
|
|
139
|
-
path: _path2 + ".zoomInPoints[" + _index4 + "][0]",
|
|
140
|
-
expected: "number",
|
|
141
|
-
value: elem[0]
|
|
142
|
-
}),
|
|
143
|
-
"number" === typeof elem[1] || $report(_exceptionable2, {
|
|
144
|
-
path: _path2 + ".zoomInPoints[" + _index4 + "][1]",
|
|
145
|
-
expected: "number",
|
|
146
|
-
value: elem[1]
|
|
147
|
-
})
|
|
148
|
-
].every((flag) => flag)) || $report(_exceptionable2, {
|
|
149
|
-
path: _path2 + ".zoomInPoints[" + _index4 + "]",
|
|
150
|
-
expected: "[number, number]",
|
|
151
|
-
value: elem
|
|
152
|
-
})).every((flag) => flag) || $report(_exceptionable2, {
|
|
153
|
-
path: _path2 + ".zoomInPoints",
|
|
154
|
-
expected: "(Array<[number, number]> | undefined)",
|
|
155
|
-
value: input3.zoomInPoints
|
|
156
122
|
}), "string" === typeof input3.metadata || $report(_exceptionable2, {
|
|
157
123
|
path: _path2 + ".metadata",
|
|
158
124
|
expected: "string",
|
|
159
125
|
value: input3.metadata
|
|
160
126
|
}), void 0 === input3.annotationsData || (Array.isArray(input3.annotationsData) || $report(_exceptionable2, {
|
|
161
127
|
path: _path2 + ".annotationsData",
|
|
162
|
-
expected: "(Array<
|
|
128
|
+
expected: "(Array<Annotation> | undefined)",
|
|
163
129
|
value: input3.annotationsData
|
|
164
|
-
})) && input3.annotationsData.map((elem,
|
|
165
|
-
path: _path2 + ".annotationsData[" +
|
|
166
|
-
expected: "
|
|
130
|
+
})) && input3.annotationsData.map((elem, _index4) => ("object" === typeof elem && null !== elem || $report(_exceptionable2, {
|
|
131
|
+
path: _path2 + ".annotationsData[" + _index4 + "]",
|
|
132
|
+
expected: "Annotation",
|
|
167
133
|
value: elem
|
|
168
|
-
})) && $vo2(elem, _path2 + ".annotationsData[" +
|
|
169
|
-
path: _path2 + ".annotationsData[" +
|
|
170
|
-
expected: "
|
|
134
|
+
})) && $vo2(elem, _path2 + ".annotationsData[" + _index4 + "]", _exceptionable2) || $report(_exceptionable2, {
|
|
135
|
+
path: _path2 + ".annotationsData[" + _index4 + "]",
|
|
136
|
+
expected: "Annotation",
|
|
171
137
|
value: elem
|
|
172
138
|
})).every((flag) => flag) || $report(_exceptionable2, {
|
|
173
139
|
path: _path2 + ".annotationsData",
|
|
174
|
-
expected: "(Array<
|
|
140
|
+
expected: "(Array<Annotation> | undefined)",
|
|
175
141
|
value: input3.annotationsData
|
|
142
|
+
}), void 0 === input3.predictions || (Array.isArray(input3.predictions) || $report(_exceptionable2, {
|
|
143
|
+
path: _path2 + ".predictions",
|
|
144
|
+
expected: "(Array<Prediction> | undefined)",
|
|
145
|
+
value: input3.predictions
|
|
146
|
+
})) && input3.predictions.map((elem, _index5) => ("object" === typeof elem && null !== elem || $report(_exceptionable2, {
|
|
147
|
+
path: _path2 + ".predictions[" + _index5 + "]",
|
|
148
|
+
expected: "Prediction",
|
|
149
|
+
value: elem
|
|
150
|
+
})) && $vo3(elem, _path2 + ".predictions[" + _index5 + "]", _exceptionable2) || $report(_exceptionable2, {
|
|
151
|
+
path: _path2 + ".predictions[" + _index5 + "]",
|
|
152
|
+
expected: "Prediction",
|
|
153
|
+
value: elem
|
|
154
|
+
})).every((flag) => flag) || $report(_exceptionable2, {
|
|
155
|
+
path: _path2 + ".predictions",
|
|
156
|
+
expected: "(Array<Prediction> | undefined)",
|
|
157
|
+
value: input3.predictions
|
|
176
158
|
}), void 0 === input3.classes || (Array.isArray(input3.classes) || $report(_exceptionable2, {
|
|
177
159
|
path: _path2 + ".classes",
|
|
178
160
|
expected: "(Array<WSIClass> | undefined)",
|
|
@@ -181,7 +163,7 @@ var validSampleWSImagesResponse = (input) => {
|
|
|
181
163
|
path: _path2 + ".classes[" + _index6 + "]",
|
|
182
164
|
expected: "WSIClass",
|
|
183
165
|
value: elem
|
|
184
|
-
})) && $
|
|
166
|
+
})) && $vo4(elem, _path2 + ".classes[" + _index6 + "]", _exceptionable2) || $report(_exceptionable2, {
|
|
185
167
|
path: _path2 + ".classes[" + _index6 + "]",
|
|
186
168
|
expected: "WSIClass",
|
|
187
169
|
value: elem
|
|
@@ -193,6 +175,10 @@ var validSampleWSImagesResponse = (input) => {
|
|
|
193
175
|
path: _path2 + ".activePatchColor",
|
|
194
176
|
expected: "(string | undefined)",
|
|
195
177
|
value: input3.activePatchColor
|
|
178
|
+
}), void 0 === input3.tileSize || "number" === typeof input3.tileSize || $report(_exceptionable2, {
|
|
179
|
+
path: _path2 + ".tileSize",
|
|
180
|
+
expected: "(number | undefined)",
|
|
181
|
+
value: input3.tileSize
|
|
196
182
|
})].every((flag) => flag);
|
|
197
183
|
const $vo2 = (input3, _path2, _exceptionable2 = true) => [(Array.isArray(input3.zoomCoordinates) || $report(_exceptionable2, {
|
|
198
184
|
path: _path2 + ".zoomCoordinates",
|
|
@@ -217,6 +203,34 @@ var validSampleWSImagesResponse = (input) => {
|
|
|
217
203
|
path: _path2 + ".zoomCoordinates",
|
|
218
204
|
expected: "[number, number]",
|
|
219
205
|
value: input3.zoomCoordinates
|
|
206
|
+
}), "string" === typeof input3["class"] || $report(_exceptionable2, {
|
|
207
|
+
path: _path2 + '["class"]',
|
|
208
|
+
expected: "string",
|
|
209
|
+
value: input3["class"]
|
|
210
|
+
})].every((flag) => flag);
|
|
211
|
+
const $vo3 = (input3, _path2, _exceptionable2 = true) => [(Array.isArray(input3.zoomCoordinates) || $report(_exceptionable2, {
|
|
212
|
+
path: _path2 + ".zoomCoordinates",
|
|
213
|
+
expected: "[number, number]",
|
|
214
|
+
value: input3.zoomCoordinates
|
|
215
|
+
})) && ((input3.zoomCoordinates.length === 2 || $report(_exceptionable2, {
|
|
216
|
+
path: _path2 + ".zoomCoordinates",
|
|
217
|
+
expected: "[number, number]",
|
|
218
|
+
value: input3.zoomCoordinates
|
|
219
|
+
})) && [
|
|
220
|
+
"number" === typeof input3.zoomCoordinates[0] || $report(_exceptionable2, {
|
|
221
|
+
path: _path2 + ".zoomCoordinates[0]",
|
|
222
|
+
expected: "number",
|
|
223
|
+
value: input3.zoomCoordinates[0]
|
|
224
|
+
}),
|
|
225
|
+
"number" === typeof input3.zoomCoordinates[1] || $report(_exceptionable2, {
|
|
226
|
+
path: _path2 + ".zoomCoordinates[1]",
|
|
227
|
+
expected: "number",
|
|
228
|
+
value: input3.zoomCoordinates[1]
|
|
229
|
+
})
|
|
230
|
+
].every((flag) => flag)) || $report(_exceptionable2, {
|
|
231
|
+
path: _path2 + ".zoomCoordinates",
|
|
232
|
+
expected: "[number, number]",
|
|
233
|
+
value: input3.zoomCoordinates
|
|
220
234
|
}), "string" === typeof input3.type || $report(_exceptionable2, {
|
|
221
235
|
path: _path2 + ".type",
|
|
222
236
|
expected: "string",
|
|
@@ -230,7 +244,7 @@ var validSampleWSImagesResponse = (input) => {
|
|
|
230
244
|
expected: "number",
|
|
231
245
|
value: input3.uncertainty
|
|
232
246
|
})].every((flag) => flag);
|
|
233
|
-
const $
|
|
247
|
+
const $vo4 = (input3, _path2, _exceptionable2 = true) => ["number" === typeof input3.id || $report(_exceptionable2, {
|
|
234
248
|
path: _path2 + ".id",
|
|
235
249
|
expected: "number",
|
|
236
250
|
value: input3.id
|
package/dist/index.js
CHANGED
package/dist/samplewsimages.js
CHANGED
package/package.json
CHANGED
package/src/dataset.ts
CHANGED
|
@@ -1011,6 +1011,7 @@ export type WSImages = {
|
|
|
1011
1011
|
activePatchColor?: string
|
|
1012
1012
|
predictionColor?: Array<number>
|
|
1013
1013
|
annotationsColor?: Array<number>
|
|
1014
|
+
tileSize?: number
|
|
1014
1015
|
classes?: WSIClass[]
|
|
1015
1016
|
uncertainty?: { color: string; label: string }[]
|
|
1016
1017
|
|
|
@@ -1023,8 +1024,6 @@ export type WSImages = {
|
|
|
1023
1024
|
/** ds supplied */
|
|
1024
1025
|
getWSIAnnotations?: (sampleName: string, wsiImage: string) => Promise<string[]>
|
|
1025
1026
|
/** ds supplied */
|
|
1026
|
-
getZoomInPoints?: (sampleName: string, wsiImage: string, index: number) => Promise<Array<[number, number]>>
|
|
1027
|
-
/** ds supplied */
|
|
1028
1027
|
makeGeoJson?: (sampleId: string, wsiImage: string) => void
|
|
1029
1028
|
/** ds supplied */
|
|
1030
1029
|
getWSIPredictionOverlay?: (sampleName: string, wsiImage: string) => Promise<string | undefined>
|
|
@@ -1370,8 +1369,11 @@ export type Termdb = {
|
|
|
1370
1369
|
* The required minimum number of samples with data as queried with getData() or other code,
|
|
1371
1370
|
* in order to minimize the ease of extracting identifiable information from aggregate data
|
|
1372
1371
|
* in server response
|
|
1372
|
+
*
|
|
1373
|
+
* sampleCount: the number of samples with matching data from one or more queried terms
|
|
1374
|
+
* q : req.query as processed through app middleware (pre-parsed, may have req.body props, __protectec__, etc)
|
|
1373
1375
|
*/
|
|
1374
|
-
|
|
1376
|
+
hasMinSampleSize?: (sampleCount: number, q: any) => boolean
|
|
1375
1377
|
/** if true, backend is allowed to send sample names to client in charts */
|
|
1376
1378
|
displaySampleIds?: (clientAuthResult: any) => boolean
|
|
1377
1379
|
converSampleIds?: boolean
|
|
@@ -6,7 +6,6 @@ export type SampleWSImagesRequest = {
|
|
|
6
6
|
dslabel: string
|
|
7
7
|
sample_id: string
|
|
8
8
|
wsimage: string
|
|
9
|
-
index: number
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export type SampleWSImagesResponse = {
|
|
@@ -17,14 +16,33 @@ export type WSImage = {
|
|
|
17
16
|
filename: string
|
|
18
17
|
overlays?: Array<string>
|
|
19
18
|
predictionLayers?: Array<string>
|
|
20
|
-
zoomInPoints?: Array<[number, number]>
|
|
21
19
|
metadata: string
|
|
22
|
-
annotationsData?:
|
|
23
|
-
|
|
20
|
+
annotationsData?: Array<Annotation>
|
|
21
|
+
predictions?: Array<Prediction>
|
|
22
|
+
classes?: Array<WSIClass>
|
|
24
23
|
/** ds defined uncertainity labels and colors */
|
|
25
24
|
uncertainty?: any
|
|
26
25
|
/** Color to highlight active patches */
|
|
27
26
|
activePatchColor?: string
|
|
27
|
+
/** Tile size in pixels needed for AI scripts */
|
|
28
|
+
tileSize?: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type Annotation = {
|
|
32
|
+
zoomCoordinates: [number, number]
|
|
33
|
+
class: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type Prediction = {
|
|
37
|
+
zoomCoordinates: [number, number]
|
|
38
|
+
type: string
|
|
39
|
+
class: string
|
|
40
|
+
uncertainty: number
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type TileSelection = {
|
|
44
|
+
zoomCoordinates: [number, number]
|
|
45
|
+
class?: string
|
|
28
46
|
}
|
|
29
47
|
|
|
30
48
|
export const sampleWSImagesPayload: RoutePayload = {
|