@exini/dicom-streams-js 3.1.0 → 4.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.
Files changed (144) hide show
  1. package/README.md +8 -8
  2. package/{dist/lib → lib}/base.d.ts +8 -8
  3. package/{dist/lib → lib}/base.js +19 -9
  4. package/lib/base.js.map +1 -0
  5. package/lib/byte-parser.js.map +1 -0
  6. package/lib/detour.js.map +1 -0
  7. package/lib/dicom-elements.js.map +1 -0
  8. package/{dist/lib → lib}/dicom-flow.js +3 -1
  9. package/{dist/lib → lib}/dicom-flow.js.map +1 -1
  10. package/{dist/lib → lib}/dicom-flows.js.map +1 -1
  11. package/lib/dicom-parts.js.map +1 -0
  12. package/lib/elements-builder.js.map +1 -0
  13. package/{dist/lib → lib}/elements.d.ts +1 -1
  14. package/{dist/lib → lib}/elements.js +2 -2
  15. package/{dist/lib → lib}/elements.js.map +1 -1
  16. package/{dist/lib → lib}/modify-flow.js.map +1 -1
  17. package/lib/parse-flow.js.map +1 -0
  18. package/{dist/lib → lib}/parser.js +1 -1
  19. package/lib/parser.js.map +1 -0
  20. package/lib/parsing.js.map +1 -0
  21. package/lib/person-name.js.map +1 -0
  22. package/{dist/lib → lib}/tag-path.js.map +1 -1
  23. package/{dist/lib → lib}/tag-tree.js +5 -1
  24. package/{dist/lib → lib}/tag-tree.js.map +1 -1
  25. package/{dist/lib → lib}/value.d.ts +1 -1
  26. package/{dist/lib → lib}/value.js +13 -13
  27. package/{dist/lib → lib}/value.js.map +1 -1
  28. package/{dist/node → node}/index.js +170 -148
  29. package/node/index.js.map +1 -0
  30. package/node/index.min.js +1 -0
  31. package/package.json +28 -31
  32. package/{dist/web → web}/index.js +3045 -2376
  33. package/web/index.js.map +1 -0
  34. package/web/index.min.js +2 -0
  35. package/RELEASE-NOTES.md +0 -10
  36. package/coverage/base.css +0 -224
  37. package/coverage/block-navigation.js +0 -87
  38. package/coverage/dicom-streams-js/index.html +0 -116
  39. package/coverage/favicon.png +0 -0
  40. package/coverage/index.html +0 -146
  41. package/coverage/prettify.css +0 -1
  42. package/coverage/prettify.js +0 -2
  43. package/coverage/sort-arrow-sprite.png +0 -0
  44. package/coverage/sorter.js +0 -196
  45. package/dist/LICENSE +0 -201
  46. package/dist/README.md +0 -157
  47. package/dist/lib/base.js.map +0 -1
  48. package/dist/lib/byte-parser.js.map +0 -1
  49. package/dist/lib/detour.js.map +0 -1
  50. package/dist/lib/dicom-elements.js.map +0 -1
  51. package/dist/lib/dicom-parts.js.map +0 -1
  52. package/dist/lib/elements-builder.js.map +0 -1
  53. package/dist/lib/parse-flow.js.map +0 -1
  54. package/dist/lib/parser.js.map +0 -1
  55. package/dist/lib/parsing.js.map +0 -1
  56. package/dist/lib/person-name.js.map +0 -1
  57. package/dist/node/index.js.map +0 -1
  58. package/dist/node/index.min.js +0 -1
  59. package/dist/package.json +0 -92
  60. package/dist/web/index.js.map +0 -1
  61. package/dist/web/index.min.js +0 -2
  62. package/example/data-model.png +0 -0
  63. package/example/detour-example.js +0 -52
  64. package/example/image/example-eb.dcm +0 -0
  65. package/example/image/example-ed.dcm +0 -0
  66. package/example/image/example-el-delimited.dcm +0 -0
  67. package/example/image/example-el.dcm +0 -0
  68. package/example/image/example-il.dcm +0 -0
  69. package/example/parse-log.js +0 -13
  70. package/example/parse-modify-log.js +0 -43
  71. package/example/parse-modify-write.js +0 -40
  72. package/typings/dicom-character-set/index.d.ts +0 -5
  73. package/typings/multipipe/index.d.ts +0 -4
  74. /package/{dist/lib → lib}/byte-parser.d.ts +0 -0
  75. /package/{dist/lib → lib}/byte-parser.js +0 -0
  76. /package/{dist/lib → lib}/character-sets.d.ts +0 -0
  77. /package/{dist/lib → lib}/character-sets.js +0 -0
  78. /package/{dist/lib → lib}/character-sets.js.map +0 -0
  79. /package/{dist/lib → lib}/collect-flow.d.ts +0 -0
  80. /package/{dist/lib → lib}/collect-flow.js +0 -0
  81. /package/{dist/lib → lib}/collect-flow.js.map +0 -0
  82. /package/{dist/lib → lib}/detour.d.ts +0 -0
  83. /package/{dist/lib → lib}/detour.js +0 -0
  84. /package/{dist/lib → lib}/dicom-elements.d.ts +0 -0
  85. /package/{dist/lib → lib}/dicom-elements.js +0 -0
  86. /package/{dist/lib → lib}/dicom-flow.d.ts +0 -0
  87. /package/{dist/lib → lib}/dicom-flows.d.ts +0 -0
  88. /package/{dist/lib → lib}/dicom-flows.js +0 -0
  89. /package/{dist/lib → lib}/dicom-parts.d.ts +0 -0
  90. /package/{dist/lib → lib}/dicom-parts.js +0 -0
  91. /package/{dist/lib → lib}/element-flows.d.ts +0 -0
  92. /package/{dist/lib → lib}/element-flows.js +0 -0
  93. /package/{dist/lib → lib}/element-flows.js.map +0 -0
  94. /package/{dist/lib → lib}/element-sink.d.ts +0 -0
  95. /package/{dist/lib → lib}/element-sink.js +0 -0
  96. /package/{dist/lib → lib}/element-sink.js.map +0 -0
  97. /package/{dist/lib → lib}/elements-builder.d.ts +0 -0
  98. /package/{dist/lib → lib}/elements-builder.js +0 -0
  99. /package/{dist/lib → lib}/flows.d.ts +0 -0
  100. /package/{dist/lib → lib}/flows.js +0 -0
  101. /package/{dist/lib → lib}/flows.js.map +0 -0
  102. /package/{dist/lib → lib}/index.d.ts +0 -0
  103. /package/{dist/lib → lib}/index.js +0 -0
  104. /package/{dist/lib → lib}/index.js.map +0 -0
  105. /package/{dist/lib → lib}/lookup.d.ts +0 -0
  106. /package/{dist/lib → lib}/lookup.js +0 -0
  107. /package/{dist/lib → lib}/lookup.js.map +0 -0
  108. /package/{dist/lib → lib}/modify-flow.d.ts +0 -0
  109. /package/{dist/lib → lib}/modify-flow.js +0 -0
  110. /package/{dist/lib → lib}/parse-flow.d.ts +0 -0
  111. /package/{dist/lib → lib}/parse-flow.js +0 -0
  112. /package/{dist/lib → lib}/parser.d.ts +0 -0
  113. /package/{dist/lib → lib}/parsing.d.ts +0 -0
  114. /package/{dist/lib → lib}/parsing.js +0 -0
  115. /package/{dist/lib → lib}/person-name.d.ts +0 -0
  116. /package/{dist/lib → lib}/person-name.js +0 -0
  117. /package/{dist/lib → lib}/sinks.d.ts +0 -0
  118. /package/{dist/lib → lib}/sinks.js +0 -0
  119. /package/{dist/lib → lib}/sinks.js.map +0 -0
  120. /package/{dist/lib → lib}/sources.d.ts +0 -0
  121. /package/{dist/lib → lib}/sources.js +0 -0
  122. /package/{dist/lib → lib}/sources.js.map +0 -0
  123. /package/{dist/lib → lib}/tag-path-like.d.ts +0 -0
  124. /package/{dist/lib → lib}/tag-path-like.js +0 -0
  125. /package/{dist/lib → lib}/tag-path-like.js.map +0 -0
  126. /package/{dist/lib → lib}/tag-path.d.ts +0 -0
  127. /package/{dist/lib → lib}/tag-path.js +0 -0
  128. /package/{dist/lib → lib}/tag-to-vr.d.ts +0 -0
  129. /package/{dist/lib → lib}/tag-to-vr.js +0 -0
  130. /package/{dist/lib → lib}/tag-to-vr.js.map +0 -0
  131. /package/{dist/lib → lib}/tag-tree.d.ts +0 -0
  132. /package/{dist/lib → lib}/tag.d.ts +0 -0
  133. /package/{dist/lib → lib}/tag.js +0 -0
  134. /package/{dist/lib → lib}/tag.js.map +0 -0
  135. /package/{dist/lib → lib}/uid-to-name.d.ts +0 -0
  136. /package/{dist/lib → lib}/uid-to-name.js +0 -0
  137. /package/{dist/lib → lib}/uid-to-name.js.map +0 -0
  138. /package/{dist/lib → lib}/uid.d.ts +0 -0
  139. /package/{dist/lib → lib}/uid.js +0 -0
  140. /package/{dist/lib → lib}/uid.js.map +0 -0
  141. /package/{dist/lib → lib}/vr.d.ts +0 -0
  142. /package/{dist/lib → lib}/vr.js +0 -0
  143. /package/{dist/lib → lib}/vr.js.map +0 -0
  144. /package/{dist/web → web}/index.min.js.LICENSE.txt +0 -0
Binary file
@@ -1,52 +0,0 @@
1
- const { Readable, Transform } = require('stream');
2
- const { Detour, objectToStringFlow } = require('../dist');
3
-
4
- class Inner extends Transform {
5
- constructor(prefix) {
6
- super({
7
- highWaterMark: 10,
8
- });
9
- this.prefix = prefix || '';
10
- }
11
-
12
- _transform(chunk, _encoding, callback) {
13
- const out = this.prefix + chunk;
14
- setTimeout((obj) => callback(null, obj), 200, out);
15
- }
16
- }
17
-
18
- class Source extends Readable {
19
- constructor() {
20
- super({});
21
- this.i = 1;
22
- }
23
-
24
- _read(size) {
25
- this.push(this.i + '');
26
- this.i = this.i + 1;
27
- if (this.i > 30) {
28
- this.push(null);
29
- }
30
- }
31
- }
32
-
33
- class WithDetour extends Detour {
34
- constructor() {
35
- super({ readableObjectMode: true }, new Inner('Detour - '));
36
- }
37
-
38
- process(chunk) {
39
- const obj = { result: chunk.toString() };
40
- if (obj.result === '10') this.setDetour(true);
41
- this.push(obj);
42
- }
43
-
44
- cleanup() {
45
- this.push({ result: 'end' });
46
- }
47
- }
48
-
49
- const source = new Source();
50
- const detour = new WithDetour();
51
-
52
- source.pipe(detour).pipe(objectToStringFlow(JSON.stringify)).pipe(process.stdout);
Binary file
Binary file
Binary file
Binary file
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
- const { parseFlow, elementFlow, elementSink, pipe, VR } = require('../dist');
3
-
4
- const src = fs.createReadStream(process.argv[2]);
5
-
6
- pipe(
7
- src,
8
- parseFlow(),
9
- elementFlow(),
10
- elementSink((elements) => {
11
- console.log(elements.toString());
12
- }),
13
- );
@@ -1,43 +0,0 @@
1
- const fs = require('fs');
2
- const {
3
- TagPath,
4
- TagTree,
5
- parseFlow,
6
- allowFilter,
7
- denyFilter,
8
- toUtf8Flow,
9
- toIndeterminateLengthSequences,
10
- modifyFlow,
11
- TagModification,
12
- TagInsertion,
13
- elementFlow,
14
- elementSink,
15
- Tag,
16
- pipe,
17
- } = require('../dist');
18
-
19
- const src = fs.createReadStream(process.argv[2]);
20
-
21
- pipe(
22
- src,
23
- parseFlow(),
24
- toIndeterminateLengthSequences(),
25
- toUtf8Flow(),
26
- allowFilter([
27
- TagTree.fromTag(Tag.SpecificCharacterSet),
28
- TagTree.fromTag(Tag.PatientName),
29
- TagTree.fromTag(Tag.PatientName),
30
- TagTree.fromTag(Tag.StudyDescription),
31
- TagTree.fromTag(Tag.SeriesDate),
32
- TagTree.fromAnyItem(Tag.MACParametersSequence),
33
- ]),
34
- denyFilter([TagTree.fromAnyItem(Tag.MACParametersSequence).thenTag(Tag.DataElementsSigned)]),
35
- modifyFlow(
36
- [TagModification.equals(TagPath.fromTag(Tag.PatientName), () => Buffer.from('Anon 001'))],
37
- [new TagInsertion(TagPath.fromTag(Tag.PatientIdentityRemoved), () => Buffer.from('YES'))],
38
- ),
39
- elementFlow(),
40
- elementSink((elements) => {
41
- console.log(elements.toString());
42
- }),
43
- );
@@ -1,40 +0,0 @@
1
- const fs = require('fs');
2
- const {
3
- TagPath,
4
- TagTree,
5
- parseFlow,
6
- toBytesFlow,
7
- allowFilter,
8
- denyFilter,
9
- toUtf8Flow,
10
- toIndeterminateLengthSequences,
11
- modifyFlow,
12
- TagModification,
13
- TagInsertion,
14
- pipe,
15
- } = require('../dist');
16
-
17
- const src = fs.createReadStream(process.argv[2]);
18
- const dest = fs.createWriteStream(process.argv[3]);
19
-
20
- pipe(
21
- src,
22
- parseFlow(),
23
- toIndeterminateLengthSequences(),
24
- toUtf8Flow(),
25
- allowFilter([
26
- TagTree.fromTag(Tag.SpecificCharacterSet),
27
- TagTree.fromTag(Tag.PatientName),
28
- TagTree.fromTag(Tag.PatientName),
29
- TagTree.fromTag(Tag.StudyDescription),
30
- TagTree.fromTag(Tag.SeriesDate),
31
- TagTree.fromAnyItem(Tag.MACParametersSequence),
32
- ]),
33
- denyFilter([TagTree.fromAnyItem(Tag.MACParametersSequence).thenTag(Tag.DataElementsSigned)]),
34
- modifyFlow(
35
- [TagModification.equals(TagPath.fromTag(Tag.PatientName), () => Buffer.from('Anon 001'))],
36
- [new TagInsertion(TagPath.fromTag(Tag.PatientIdentityRemoved), () => Buffer.from('YES'))],
37
- ),
38
- toBytesFlow(),
39
- dest,
40
- );
@@ -1,5 +0,0 @@
1
- /// <reference types="node" />
2
- declare module 'dicom-character-set' {
3
- export const characterSets: Record<string, unknown>[];
4
- export function convertBytes(specificCharacterSet: any, bytes: any, options: any): string;
5
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- declare module 'multipipe' {
3
- export default function pipe(...streams: any[]): any;
4
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes