@flywheel-io/fw-file-rs 0.7.0 → 0.8.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/dcm/dcm.d.ts CHANGED
@@ -6,6 +6,11 @@ export class Context {
6
6
  [Symbol.dispose](): void;
7
7
  static default(): Context;
8
8
  deid_header(bytes: Uint8Array): Uint8Array;
9
+ /**
10
+ * De-identify DICOM bytes and return `[bytes, report]` — see
11
+ * [`deid_result_to_js_array`] for the shape.
12
+ */
13
+ deid_header_with_report(bytes: Uint8Array): Array<any>;
9
14
  deid_profile(yaml: string): Context;
10
15
  get_deid_profile(): DeidProfile | undefined;
11
16
  get_fw_meta(header: any): any;
@@ -28,7 +33,13 @@ export class DeidProfile {
28
33
  free(): void;
29
34
  [Symbol.dispose](): void;
30
35
  deid_dcm(dcm_bytes: Uint8Array): Uint8Array;
36
+ /**
37
+ * Apply the profile and return `[bytes, report]` — see
38
+ * [`deid_result_to_js_array`] for the shape.
39
+ */
40
+ deid_dcm_with_report(dcm_bytes: Uint8Array): Array<any>;
31
41
  static from_yaml(yaml: string): DeidProfile;
42
+ static schema(): any;
32
43
  }
33
44
 
34
45
  export class WasmDCMGroup {
@@ -47,6 +58,13 @@ export function is_dicom_part10(file: File): Promise<boolean>;
47
58
 
48
59
  export function parse_header(bytes: Uint8Array, include_tags?: string[] | null): any;
49
60
 
61
+ /**
62
+ * Walk every element in the DICOM header bytes in document order, including
63
+ * sequences and their nested items. Returns an array of row objects with
64
+ * keys: path, keyword, tag, depth, is_sq, value.
65
+ */
66
+ export function parse_header_full(bytes: Uint8Array): any;
67
+
50
68
  export function read_until_pixels(file: File, stop_tags: any, max_size?: number | null): Promise<Uint8Array>;
51
69
 
52
70
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -54,8 +72,11 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
54
72
  export interface InitOutput {
55
73
  readonly memory: WebAssembly.Memory;
56
74
  readonly __wbg_context_free: (a: number, b: number) => void;
75
+ readonly __wbg_deidprofile_free: (a: number, b: number) => void;
76
+ readonly __wbg_wasmdcmgroup_free: (a: number, b: number) => void;
57
77
  readonly context_default: () => number;
58
78
  readonly context_deid_header: (a: number, b: number, c: number) => [number, number, number, number];
79
+ readonly context_deid_header_with_report: (a: number, b: number, c: number) => [number, number, number];
59
80
  readonly context_deid_profile: (a: number, b: number, c: number) => [number, number, number];
60
81
  readonly context_get_deid_profile: (a: number) => number;
61
82
  readonly context_get_fw_meta: (a: number, b: any) => [number, number, number];
@@ -65,24 +86,25 @@ export interface InitOutput {
65
86
  readonly context_is_dcm_filename: (a: number, b: number) => number;
66
87
  readonly context_matches_file_filter: (a: number, b: number, c: number) => number;
67
88
  readonly context_max_size: (a: number, b: number) => number;
89
+ readonly context_new: () => number;
68
90
  readonly context_parse_header: (a: number, b: number, c: number) => [number, number, number];
69
91
  readonly context_read_until_pixels: (a: number, b: any) => any;
70
92
  readonly context_rename_file: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
71
93
  readonly context_split_localizer: (a: number, b: number) => number;
72
94
  readonly context_stop_at_tags: (a: number, b: any) => [number, number, number];
73
- readonly context_new: () => number;
74
- readonly parse_header: (a: number, b: number, c: number, d: number) => [number, number, number];
75
- readonly get_fw_meta: (a: any, b: any) => [number, number, number];
76
- readonly __wbg_wasmdcmgroup_free: (a: number, b: number) => void;
77
95
  readonly create_dcm_as_bytes: (a: any) => [number, number, number, number];
96
+ readonly deidprofile_deid_dcm: (a: number, b: number, c: number) => [number, number, number, number];
97
+ readonly deidprofile_deid_dcm_with_report: (a: number, b: number, c: number) => [number, number, number];
98
+ readonly deidprofile_from_yaml: (a: number, b: number) => [number, number, number];
99
+ readonly deidprofile_schema: () => [number, number, number];
100
+ readonly get_fw_meta: (a: any, b: any) => [number, number, number];
78
101
  readonly group_series: (a: any, b: any, c: number) => any;
79
102
  readonly is_dicom_part10: (a: any) => any;
103
+ readonly parse_header: (a: number, b: number, c: number, d: number) => [number, number, number];
104
+ readonly parse_header_full: (a: number, b: number) => [number, number, number];
80
105
  readonly read_until_pixels: (a: any, b: any, c: number) => any;
81
- readonly __wbg_deidprofile_free: (a: number, b: number) => void;
82
- readonly deidprofile_deid_dcm: (a: number, b: number, c: number) => [number, number, number, number];
83
- readonly deidprofile_from_yaml: (a: number, b: number) => [number, number, number];
84
- readonly wasm_bindgen__convert__closures_____invoke__h023ec276d801cc59: (a: number, b: number, c: any) => [number, number];
85
- readonly wasm_bindgen__convert__closures_____invoke__h4d206e7acbddb6aa: (a: number, b: number, c: any, d: any) => void;
106
+ readonly wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
107
+ readonly wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___wasm_bindgen_46acc7fd244e2d4a___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_46acc7fd244e2d4a___JsError___true_: (a: number, b: number, c: any) => [number, number];
86
108
  readonly __wbindgen_malloc: (a: number, b: number) => number;
87
109
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
88
110
  readonly __wbindgen_exn_store: (a: number) => void;
package/dcm/dcm.js CHANGED
@@ -39,6 +39,21 @@ export class Context {
39
39
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
40
40
  return v2;
41
41
  }
42
+ /**
43
+ * De-identify DICOM bytes and return `[bytes, report]` — see
44
+ * [`deid_result_to_js_array`] for the shape.
45
+ * @param {Uint8Array} bytes
46
+ * @returns {Array<any>}
47
+ */
48
+ deid_header_with_report(bytes) {
49
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
50
+ const len0 = WASM_VECTOR_LEN;
51
+ const ret = wasm.context_deid_header_with_report(this.__wbg_ptr, ptr0, len0);
52
+ if (ret[2]) {
53
+ throw takeFromExternrefTable0(ret[1]);
54
+ }
55
+ return takeFromExternrefTable0(ret[0]);
56
+ }
42
57
  /**
43
58
  * @param {string} yaml
44
59
  * @returns {Context}
@@ -234,6 +249,21 @@ export class DeidProfile {
234
249
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
235
250
  return v2;
236
251
  }
252
+ /**
253
+ * Apply the profile and return `[bytes, report]` — see
254
+ * [`deid_result_to_js_array`] for the shape.
255
+ * @param {Uint8Array} dcm_bytes
256
+ * @returns {Array<any>}
257
+ */
258
+ deid_dcm_with_report(dcm_bytes) {
259
+ const ptr0 = passArray8ToWasm0(dcm_bytes, wasm.__wbindgen_malloc);
260
+ const len0 = WASM_VECTOR_LEN;
261
+ const ret = wasm.deidprofile_deid_dcm_with_report(this.__wbg_ptr, ptr0, len0);
262
+ if (ret[2]) {
263
+ throw takeFromExternrefTable0(ret[1]);
264
+ }
265
+ return takeFromExternrefTable0(ret[0]);
266
+ }
237
267
  /**
238
268
  * @param {string} yaml
239
269
  * @returns {DeidProfile}
@@ -247,6 +277,16 @@ export class DeidProfile {
247
277
  }
248
278
  return DeidProfile.__wrap(ret[0]);
249
279
  }
280
+ /**
281
+ * @returns {any}
282
+ */
283
+ static schema() {
284
+ const ret = wasm.deidprofile_schema();
285
+ if (ret[2]) {
286
+ throw takeFromExternrefTable0(ret[1]);
287
+ }
288
+ return takeFromExternrefTable0(ret[0]);
289
+ }
250
290
  }
251
291
  if (Symbol.dispose) DeidProfile.prototype[Symbol.dispose] = DeidProfile.prototype.free;
252
292
 
@@ -328,6 +368,23 @@ export function parse_header(bytes, include_tags) {
328
368
  return takeFromExternrefTable0(ret[0]);
329
369
  }
330
370
 
371
+ /**
372
+ * Walk every element in the DICOM header bytes in document order, including
373
+ * sequences and their nested items. Returns an array of row objects with
374
+ * keys: path, keyword, tag, depth, is_sq, value.
375
+ * @param {Uint8Array} bytes
376
+ * @returns {any}
377
+ */
378
+ export function parse_header_full(bytes) {
379
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
380
+ const len0 = WASM_VECTOR_LEN;
381
+ const ret = wasm.parse_header_full(ptr0, len0);
382
+ if (ret[2]) {
383
+ throw takeFromExternrefTable0(ret[1]);
384
+ }
385
+ return takeFromExternrefTable0(ret[0]);
386
+ }
387
+
331
388
  /**
332
389
  * @param {File} file
333
390
  * @param {any} stop_tags
@@ -341,11 +398,11 @@ export function read_until_pixels(file, stop_tags, max_size) {
341
398
  function __wbg_get_imports() {
342
399
  const import0 = {
343
400
  __proto__: null,
344
- __wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
401
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
345
402
  const ret = Error(getStringFromWasm0(arg0, arg1));
346
403
  return ret;
347
404
  },
348
- __wbg_Number_c4bdf66bb78f7977: function(arg0) {
405
+ __wbg_Number_14af1003b8dd5ead: function(arg0) {
349
406
  const ret = Number(arg0);
350
407
  return ret;
351
408
  },
@@ -356,68 +413,68 @@ function __wbg_get_imports() {
356
413
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
357
414
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
358
415
  },
359
- __wbg___wbindgen_bigint_get_as_i64_d9e915702856f831: function(arg0, arg1) {
416
+ __wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c: function(arg0, arg1) {
360
417
  const v = arg1;
361
418
  const ret = typeof(v) === 'bigint' ? v : undefined;
362
419
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
363
420
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
364
421
  },
365
- __wbg___wbindgen_boolean_get_edaed31a367ce1bd: function(arg0) {
422
+ __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
366
423
  const v = arg0;
367
424
  const ret = typeof(v) === 'boolean' ? v : undefined;
368
425
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
369
426
  },
370
- __wbg___wbindgen_debug_string_8a447059637473e2: function(arg0, arg1) {
427
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
371
428
  const ret = debugString(arg1);
372
429
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
373
430
  const len1 = WASM_VECTOR_LEN;
374
431
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
375
432
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
376
433
  },
377
- __wbg___wbindgen_in_4990f46af709e33c: function(arg0, arg1) {
434
+ __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
378
435
  const ret = arg0 in arg1;
379
436
  return ret;
380
437
  },
381
- __wbg___wbindgen_is_bigint_90b5ccfe67c78460: function(arg0) {
438
+ __wbg___wbindgen_is_bigint_b123553bed3bb382: function(arg0) {
382
439
  const ret = typeof(arg0) === 'bigint';
383
440
  return ret;
384
441
  },
385
- __wbg___wbindgen_is_function_acc5528be2b923f2: function(arg0) {
442
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
386
443
  const ret = typeof(arg0) === 'function';
387
444
  return ret;
388
445
  },
389
- __wbg___wbindgen_is_null_6d937fbfb6478470: function(arg0) {
446
+ __wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
390
447
  const ret = arg0 === null;
391
448
  return ret;
392
449
  },
393
- __wbg___wbindgen_is_object_0beba4a1980d3eea: function(arg0) {
450
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
394
451
  const val = arg0;
395
452
  const ret = typeof(val) === 'object' && val !== null;
396
453
  return ret;
397
454
  },
398
- __wbg___wbindgen_is_string_1fca8072260dd261: function(arg0) {
455
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
399
456
  const ret = typeof(arg0) === 'string';
400
457
  return ret;
401
458
  },
402
- __wbg___wbindgen_is_undefined_721f8decd50c87a3: function(arg0) {
459
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
403
460
  const ret = arg0 === undefined;
404
461
  return ret;
405
462
  },
406
- __wbg___wbindgen_jsval_eq_4e8c38722cb8ff51: function(arg0, arg1) {
463
+ __wbg___wbindgen_jsval_eq_02babf21faa37971: function(arg0, arg1) {
407
464
  const ret = arg0 === arg1;
408
465
  return ret;
409
466
  },
410
- __wbg___wbindgen_jsval_loose_eq_4b9aba9e5b3c4582: function(arg0, arg1) {
467
+ __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
411
468
  const ret = arg0 == arg1;
412
469
  return ret;
413
470
  },
414
- __wbg___wbindgen_number_get_1cc01dd708740256: function(arg0, arg1) {
471
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
415
472
  const obj = arg1;
416
473
  const ret = typeof(obj) === 'number' ? obj : undefined;
417
474
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
418
475
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
419
476
  },
420
- __wbg___wbindgen_string_get_71bb4348194e31f0: function(arg0, arg1) {
477
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
421
478
  const obj = arg1;
422
479
  const ret = typeof(obj) === 'string' ? obj : undefined;
423
480
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -425,56 +482,56 @@ function __wbg_get_imports() {
425
482
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
426
483
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
427
484
  },
428
- __wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
485
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
429
486
  throw new Error(getStringFromWasm0(arg0, arg1));
430
487
  },
431
- __wbg__wbg_cb_unref_33c39e13d73b25f6: function(arg0) {
488
+ __wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
432
489
  arg0._wbg_cb_unref();
433
490
  },
434
- __wbg_arrayBuffer_e3174a1300c67c95: function(arg0) {
491
+ __wbg_arrayBuffer_0fe6e1300abcf908: function(arg0) {
435
492
  const ret = arg0.arrayBuffer();
436
493
  return ret;
437
494
  },
438
- __wbg_call_5575218572ead796: function() { return handleError(function (arg0, arg1, arg2) {
495
+ __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
439
496
  const ret = arg0.call(arg1, arg2);
440
497
  return ret;
441
498
  }, arguments); },
442
- __wbg_call_8e98ed2f3c86c4b5: function() { return handleError(function (arg0, arg1) {
499
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
443
500
  const ret = arg0.call(arg1);
444
501
  return ret;
445
502
  }, arguments); },
446
- __wbg_done_b62d4a7d2286852a: function(arg0) {
503
+ __wbg_done_b41a1d26cdb37fb6: function(arg0) {
447
504
  const ret = arg0.done;
448
505
  return ret;
449
506
  },
450
- __wbg_entries_c261c3fa1f281256: function(arg0) {
507
+ __wbg_entries_fb6397112b1de25f: function(arg0) {
451
508
  const ret = Object.entries(arg0);
452
509
  return ret;
453
510
  },
454
- __wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
511
+ __wbg_getRandomValues_a608c4436c19407a: function() { return handleError(function (arg0, arg1) {
455
512
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
456
513
  }, arguments); },
457
- __wbg_getTime_7a770f8a2ec8d634: function(arg0) {
514
+ __wbg_getTime_f5a55efff2585d5d: function(arg0) {
458
515
  const ret = arg0.getTime();
459
516
  return ret;
460
517
  },
461
- __wbg_getTimezoneOffset_d6fba5332f80c3da: function(arg0) {
518
+ __wbg_getTimezoneOffset_2e851fdaecc2dc92: function(arg0) {
462
519
  const ret = arg0.getTimezoneOffset();
463
520
  return ret;
464
521
  },
465
- __wbg_get_197a3fe98f169e38: function(arg0, arg1) {
466
- const ret = arg0[arg1 >>> 0];
467
- return ret;
468
- },
469
- __wbg_get_9a29be2cb383ed9a: function() { return handleError(function (arg0, arg1) {
522
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
470
523
  const ret = Reflect.get(arg0, arg1);
471
524
  return ret;
472
525
  }, arguments); },
473
- __wbg_get_unchecked_54a4374c38e08460: function(arg0, arg1) {
526
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
474
527
  const ret = arg0[arg1 >>> 0];
475
528
  return ret;
476
529
  },
477
- __wbg_instanceof_ArrayBuffer_2a7bb09fee70c2da: function(arg0) {
530
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
531
+ const ret = arg0[arg1 >>> 0];
532
+ return ret;
533
+ },
534
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
478
535
  let result;
479
536
  try {
480
537
  result = arg0 instanceof ArrayBuffer;
@@ -484,7 +541,7 @@ function __wbg_get_imports() {
484
541
  const ret = result;
485
542
  return ret;
486
543
  },
487
- __wbg_instanceof_Map_afa18d5840c04c15: function(arg0) {
544
+ __wbg_instanceof_Map_b2611749102d7ba3: function(arg0) {
488
545
  let result;
489
546
  try {
490
547
  result = arg0 instanceof Map;
@@ -494,7 +551,7 @@ function __wbg_get_imports() {
494
551
  const ret = result;
495
552
  return ret;
496
553
  },
497
- __wbg_instanceof_Uint8Array_f080092dc70f5d58: function(arg0) {
554
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
498
555
  let result;
499
556
  try {
500
557
  result = arg0 instanceof Uint8Array;
@@ -504,62 +561,62 @@ function __wbg_get_imports() {
504
561
  const ret = result;
505
562
  return ret;
506
563
  },
507
- __wbg_isArray_145a34fd0a38d37b: function(arg0) {
564
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
508
565
  const ret = Array.isArray(arg0);
509
566
  return ret;
510
567
  },
511
- __wbg_isSafeInteger_a3389a198582f5f6: function(arg0) {
568
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
512
569
  const ret = Number.isSafeInteger(arg0);
513
570
  return ret;
514
571
  },
515
- __wbg_iterator_cc47ba25a2be735a: function() {
572
+ __wbg_iterator_e3c31c892080e444: function() {
516
573
  const ret = Symbol.iterator;
517
574
  return ret;
518
575
  },
519
- __wbg_length_589238bdcf171f0e: function(arg0) {
576
+ __wbg_length_7f3c00c40364105e: function(arg0) {
520
577
  const ret = arg0.length;
521
578
  return ret;
522
579
  },
523
- __wbg_length_c6054974c0a6cdb9: function(arg0) {
580
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
524
581
  const ret = arg0.length;
525
582
  return ret;
526
583
  },
527
- __wbg_new_0_1b32bedde98fef4b: function() {
584
+ __wbg_new_0_72d020f0c63443d4: function() {
528
585
  const ret = new Date();
529
586
  return ret;
530
587
  },
531
- __wbg_new_2e117a478906f062: function() {
532
- const ret = new Object();
588
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
589
+ const ret = new Uint8Array(arg0);
533
590
  return ret;
534
591
  },
535
- __wbg_new_3444eb7412549f0b: function() {
592
+ __wbg_new_28744009d011f847: function() {
536
593
  const ret = new Map();
537
594
  return ret;
538
595
  },
539
- __wbg_new_36e147a8ced3c6e0: function() {
540
- const ret = new Array();
596
+ __wbg_new_34e56228080aa9f8: function(arg0) {
597
+ const ret = new Date(arg0);
541
598
  return ret;
542
599
  },
543
- __wbg_new_47ab770c8bd3b6bb: function(arg0) {
544
- const ret = new Date(arg0);
600
+ __wbg_new_617a8cdb8bb1130e: function() {
601
+ const ret = new Object();
545
602
  return ret;
546
603
  },
547
- __wbg_new_81880fb5002cb255: function(arg0) {
548
- const ret = new Uint8Array(arg0);
604
+ __wbg_new_ee2291f50781bf1d: function() {
605
+ const ret = new Array();
549
606
  return ret;
550
607
  },
551
- __wbg_new_from_slice_543b875b27789a8f: function(arg0, arg1) {
608
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
552
609
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
553
610
  return ret;
554
611
  },
555
- __wbg_new_typed_00a409eb4ec4f2d9: function(arg0, arg1) {
612
+ __wbg_new_typed_b01cb72a8af741a3: function(arg0, arg1) {
556
613
  try {
557
614
  var state0 = {a: arg0, b: arg1};
558
615
  var cb0 = (arg0, arg1) => {
559
616
  const a = state0.a;
560
617
  state0.a = 0;
561
618
  try {
562
- return wasm_bindgen__convert__closures_____invoke__h4d206e7acbddb6aa(a, state0.b, arg0, arg1);
619
+ return wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined_______true_(a, state0.b, arg0, arg1);
563
620
  } finally {
564
621
  state0.a = a;
565
622
  }
@@ -570,95 +627,99 @@ function __wbg_get_imports() {
570
627
  state0.a = 0;
571
628
  }
572
629
  },
573
- __wbg_next_0c4066e251d2eff9: function() { return handleError(function (arg0) {
574
- const ret = arg0.next();
575
- return ret;
576
- }, arguments); },
577
- __wbg_next_402fa10b59ab20c3: function(arg0) {
630
+ __wbg_next_33784799010f1bbe: function(arg0) {
578
631
  const ret = arg0.next;
579
632
  return ret;
580
633
  },
581
- __wbg_prototypesetcall_d721637c7ca66eb8: function(arg0, arg1, arg2) {
634
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
635
+ const ret = arg0.next();
636
+ return ret;
637
+ }, arguments); },
638
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
582
639
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
583
640
  },
584
- __wbg_queueMicrotask_1c9b3800e321a967: function(arg0) {
641
+ __wbg_push_2baf45db356cf468: function(arg0, arg1) {
642
+ const ret = arg0.push(arg1);
643
+ return ret;
644
+ },
645
+ __wbg_queueMicrotask_9833f9a49df95a49: function(arg0) {
585
646
  const ret = arg0.queueMicrotask;
586
647
  return ret;
587
648
  },
588
- __wbg_queueMicrotask_311744e534a929a3: function(arg0) {
649
+ __wbg_queueMicrotask_a72f977e97f23c5f: function(arg0) {
589
650
  queueMicrotask(arg0);
590
651
  },
591
- __wbg_resolve_d82363d90af6928a: function(arg0) {
652
+ __wbg_resolve_0076e10020304ede: function(arg0) {
592
653
  const ret = Promise.resolve(arg0);
593
654
  return ret;
594
655
  },
595
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
596
- arg0[arg1] = arg2;
597
- },
598
- __wbg_set_9a1d61e17de7054c: function(arg0, arg1, arg2) {
656
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
599
657
  const ret = arg0.set(arg1, arg2);
600
658
  return ret;
601
659
  },
602
- __wbg_set_dc601f4a69da0bc2: function(arg0, arg1, arg2) {
660
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
661
+ arg0[arg1] = arg2;
662
+ },
663
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
603
664
  arg0[arg1 >>> 0] = arg2;
604
665
  },
605
- __wbg_size_3a5e8d210d038789: function(arg0) {
666
+ __wbg_size_8f1c0b1a1fbb3810: function(arg0) {
606
667
  const ret = arg0.size;
607
668
  return ret;
608
669
  },
609
- __wbg_slice_faf194aa1e582f72: function() { return handleError(function (arg0, arg1, arg2) {
670
+ __wbg_slice_afd8274aed4149c0: function() { return handleError(function (arg0, arg1, arg2) {
610
671
  const ret = arg0.slice(arg1, arg2);
611
672
  return ret;
612
673
  }, arguments); },
613
- __wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938: function() {
614
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
674
+ __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
675
+ const ret = typeof global === 'undefined' ? null : global;
615
676
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
616
677
  },
617
- __wbg_static_accessor_GLOBAL_ce44e66a4935da8c: function() {
618
- const ret = typeof global === 'undefined' ? null : global;
678
+ __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
679
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
619
680
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
620
681
  },
621
- __wbg_static_accessor_SELF_44f6e0cb5e67cdad: function() {
682
+ __wbg_static_accessor_SELF_0b583911f537483a: function() {
622
683
  const ret = typeof self === 'undefined' ? null : self;
623
684
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
624
685
  },
625
- __wbg_static_accessor_WINDOW_168f178805d978fe: function() {
686
+ __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
626
687
  const ret = typeof window === 'undefined' ? null : window;
627
688
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
628
689
  },
629
- __wbg_then_05edfc8a4fea5106: function(arg0, arg1, arg2) {
690
+ __wbg_then_c949d5a25a4e78f8: function(arg0, arg1, arg2) {
630
691
  const ret = arg0.then(arg1, arg2);
631
692
  return ret;
632
693
  },
633
- __wbg_then_591b6b3a75ee817a: function(arg0, arg1) {
694
+ __wbg_then_e71170d78fcf8954: function(arg0, arg1) {
634
695
  const ret = arg0.then(arg1);
635
696
  return ret;
636
697
  },
637
- __wbg_value_49f783bb59765962: function(arg0) {
698
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
638
699
  const ret = arg0.value;
639
700
  return ret;
640
701
  },
641
- __wbindgen_cast_0000000000000001: function(arg0, arg1) {
642
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1256, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
643
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h023ec276d801cc59);
702
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
703
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1346, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
704
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___wasm_bindgen_46acc7fd244e2d4a___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_46acc7fd244e2d4a___JsError___true_);
644
705
  return ret;
645
706
  },
646
- __wbindgen_cast_0000000000000002: function(arg0) {
707
+ __wbindgen_generic_0000000000000002: function(arg0) {
647
708
  // Cast intrinsic for `F64 -> Externref`.
648
709
  const ret = arg0;
649
710
  return ret;
650
711
  },
651
- __wbindgen_cast_0000000000000003: function(arg0) {
712
+ __wbindgen_generic_0000000000000003: function(arg0) {
652
713
  // Cast intrinsic for `I64 -> Externref`.
653
714
  const ret = arg0;
654
715
  return ret;
655
716
  },
656
- __wbindgen_cast_0000000000000004: function(arg0, arg1) {
717
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
657
718
  // Cast intrinsic for `Ref(String) -> Externref`.
658
719
  const ret = getStringFromWasm0(arg0, arg1);
659
720
  return ret;
660
721
  },
661
- __wbindgen_cast_0000000000000005: function(arg0) {
722
+ __wbindgen_generic_0000000000000005: function(arg0) {
662
723
  // Cast intrinsic for `U64 -> Externref`.
663
724
  const ret = BigInt.asUintN(64, arg0);
664
725
  return ret;
@@ -679,15 +740,15 @@ function __wbg_get_imports() {
679
740
  };
680
741
  }
681
742
 
682
- function wasm_bindgen__convert__closures_____invoke__h023ec276d801cc59(arg0, arg1, arg2) {
683
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h023ec276d801cc59(arg0, arg1, arg2);
743
+ function wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___wasm_bindgen_46acc7fd244e2d4a___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_46acc7fd244e2d4a___JsError___true_(arg0, arg1, arg2) {
744
+ const ret = wasm.wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___wasm_bindgen_46acc7fd244e2d4a___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_46acc7fd244e2d4a___JsError___true_(arg0, arg1, arg2);
684
745
  if (ret[1]) {
685
746
  throw takeFromExternrefTable0(ret[0]);
686
747
  }
687
748
  }
688
749
 
689
- function wasm_bindgen__convert__closures_____invoke__h4d206e7acbddb6aa(arg0, arg1, arg2, arg3) {
690
- wasm.wasm_bindgen__convert__closures_____invoke__h4d206e7acbddb6aa(arg0, arg1, arg2, arg3);
750
+ function wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
751
+ wasm.wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
691
752
  }
692
753
 
693
754
  const ContextFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -943,11 +1004,15 @@ function __wbg_finalize_init(instance, module) {
943
1004
 
944
1005
  async function __wbg_load(module, imports) {
945
1006
  if (typeof Response === 'function' && module instanceof Response) {
1007
+ if (!module.ok) {
1008
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
1009
+ }
1010
+
946
1011
  if (typeof WebAssembly.instantiateStreaming === 'function') {
947
1012
  try {
948
1013
  return await WebAssembly.instantiateStreaming(module, imports);
949
1014
  } catch (e) {
950
- const validResponse = module.ok && expectedResponseType(module.type);
1015
+ const validResponse = expectedResponseType(module.type);
951
1016
 
952
1017
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
953
1018
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
package/dcm/dcm_bg.wasm CHANGED
Binary file
@@ -2,8 +2,11 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_context_free: (a: number, b: number) => void;
5
+ export const __wbg_deidprofile_free: (a: number, b: number) => void;
6
+ export const __wbg_wasmdcmgroup_free: (a: number, b: number) => void;
5
7
  export const context_default: () => number;
6
8
  export const context_deid_header: (a: number, b: number, c: number) => [number, number, number, number];
9
+ export const context_deid_header_with_report: (a: number, b: number, c: number) => [number, number, number];
7
10
  export const context_deid_profile: (a: number, b: number, c: number) => [number, number, number];
8
11
  export const context_get_deid_profile: (a: number) => number;
9
12
  export const context_get_fw_meta: (a: number, b: any) => [number, number, number];
@@ -13,24 +16,25 @@ export const context_include_tags: (a: number, b: any) => [number, number, numbe
13
16
  export const context_is_dcm_filename: (a: number, b: number) => number;
14
17
  export const context_matches_file_filter: (a: number, b: number, c: number) => number;
15
18
  export const context_max_size: (a: number, b: number) => number;
19
+ export const context_new: () => number;
16
20
  export const context_parse_header: (a: number, b: number, c: number) => [number, number, number];
17
21
  export const context_read_until_pixels: (a: number, b: any) => any;
18
22
  export const context_rename_file: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
19
23
  export const context_split_localizer: (a: number, b: number) => number;
20
24
  export const context_stop_at_tags: (a: number, b: any) => [number, number, number];
21
- export const context_new: () => number;
22
- export const parse_header: (a: number, b: number, c: number, d: number) => [number, number, number];
23
- export const get_fw_meta: (a: any, b: any) => [number, number, number];
24
- export const __wbg_wasmdcmgroup_free: (a: number, b: number) => void;
25
25
  export const create_dcm_as_bytes: (a: any) => [number, number, number, number];
26
+ export const deidprofile_deid_dcm: (a: number, b: number, c: number) => [number, number, number, number];
27
+ export const deidprofile_deid_dcm_with_report: (a: number, b: number, c: number) => [number, number, number];
28
+ export const deidprofile_from_yaml: (a: number, b: number) => [number, number, number];
29
+ export const deidprofile_schema: () => [number, number, number];
30
+ export const get_fw_meta: (a: any, b: any) => [number, number, number];
26
31
  export const group_series: (a: any, b: any, c: number) => any;
27
32
  export const is_dicom_part10: (a: any) => any;
33
+ export const parse_header: (a: number, b: number, c: number, d: number) => [number, number, number];
34
+ export const parse_header_full: (a: number, b: number) => [number, number, number];
28
35
  export const read_until_pixels: (a: any, b: any, c: number) => any;
29
- export const __wbg_deidprofile_free: (a: number, b: number) => void;
30
- export const deidprofile_deid_dcm: (a: number, b: number, c: number) => [number, number, number, number];
31
- export const deidprofile_from_yaml: (a: number, b: number) => [number, number, number];
32
- export const wasm_bindgen__convert__closures_____invoke__h023ec276d801cc59: (a: number, b: number, c: any) => [number, number];
33
- export const wasm_bindgen__convert__closures_____invoke__h4d206e7acbddb6aa: (a: number, b: number, c: any, d: any) => void;
36
+ export const wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined___js_sys_e24e7246c4058216___Function_fn_wasm_bindgen_46acc7fd244e2d4a___JsValue_____wasm_bindgen_46acc7fd244e2d4a___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
37
+ export const wasm_bindgen_46acc7fd244e2d4a___convert__closures_____invoke___wasm_bindgen_46acc7fd244e2d4a___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_46acc7fd244e2d4a___JsError___true_: (a: number, b: number, c: any) => [number, number];
34
38
  export const __wbindgen_malloc: (a: number, b: number) => number;
35
39
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
36
40
  export const __wbindgen_exn_store: (a: number) => void;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Flywheel <support@flywheel.io>"
6
6
  ],
7
7
  "description": "JavaScript/WebAssembly bindings for fw-file rust crate",
8
- "version": "0.7.0",
8
+ "version": "0.8.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",