dcmjs 0.49.4 → 0.50.1

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 (55) hide show
  1. package/README.md +50 -0
  2. package/build/dcmjs.es.js +1069 -107
  3. package/build/dcmjs.es.js.map +1 -1
  4. package/build/dcmjs.js +1069 -107
  5. package/build/dcmjs.js.map +1 -1
  6. package/build/dcmjs.min.js +2 -2
  7. package/build/dcmjs.min.js.map +1 -1
  8. package/generate/dictionary.mjs +56029 -0
  9. package/package.json +18 -2
  10. package/.babelrc +0 -9
  11. package/.github/workflows/lint-and-format.yml +0 -27
  12. package/.github/workflows/publish-package.yml +0 -45
  13. package/.github/workflows/tests.yml +0 -24
  14. package/.prettierrc +0 -5
  15. package/.vscode/extensions.json +0 -7
  16. package/.vscode/settings.json +0 -8
  17. package/changelog.md +0 -31
  18. package/docs/ArrayBufferExpanderListener.md +0 -303
  19. package/docs/AsyncDicomReader-skill.md +0 -730
  20. package/eslint.config.mjs +0 -30
  21. package/generate-dictionary.js +0 -145
  22. package/jest.setup.js +0 -39
  23. package/netlify.toml +0 -22
  24. package/rollup.config.mjs +0 -57
  25. package/test/ArrayBufferExpanderListener.test.js +0 -365
  26. package/test/DICOMWEB.test.js +0 -1
  27. package/test/DicomMetaDictionary.test.js +0 -73
  28. package/test/SequenceOfItems.test.js +0 -86
  29. package/test/adapters.test.js +0 -43
  30. package/test/anonymizer.test.js +0 -176
  31. package/test/arrayItem.json +0 -351
  32. package/test/async-data.test.js +0 -575
  33. package/test/data-encoding.test.js +0 -59
  34. package/test/data-options.test.js +0 -199
  35. package/test/data.test.js +0 -1776
  36. package/test/derivations.test.js +0 -1
  37. package/test/helper/DicomDataReadBufferStreamBuilder.js +0 -89
  38. package/test/information-filter.test.js +0 -165
  39. package/test/integration/DicomMessage.readFile.test.js +0 -50
  40. package/test/lossless-read-write.test.js +0 -1407
  41. package/test/mocks/minimal_fields_dataset.json +0 -17
  42. package/test/mocks/null_number_vrs_dataset.json +0 -102
  43. package/test/normalizers.test.js +0 -38
  44. package/test/odd-frame-bit-data.js +0 -138
  45. package/test/rawTags.js +0 -170
  46. package/test/readBufferStream.test.js +0 -158
  47. package/test/sample-dicom.json +0 -904
  48. package/test/sample-op.lei +0 -0
  49. package/test/sample-sr.json +0 -997
  50. package/test/sr-tid.test.js +0 -251
  51. package/test/testUtils.js +0 -85
  52. package/test/utilities/deepEqual.test.js +0 -87
  53. package/test/utilities.test.js +0 -205
  54. package/test/video-test-dict.js +0 -40
  55. package/test/writeBufferStream.test.js +0 -149
package/README.md CHANGED
@@ -106,6 +106,56 @@ git-cz --non-interactive --type=fix --subject="commit message"
106
106
 
107
107
  More info at [git-cz](https://www.npmjs.com/package/git-cz).
108
108
 
109
+ ## DICOM Dictionary
110
+
111
+ The dcmjs library includes DICOM data dictionaries that map DICOM tags to their metadata (VR, VM, etc.). To optimize load performance, the library uses a pre-compiled "fast dictionary" format.
112
+
113
+ ### Dictionary Files
114
+
115
+ - **`src/dictionary.fast.js`** - Pre-compiled fast dictionary (used at runtime)
116
+ - **`generate/dictionary.mjs`** - Source dictionary generator
117
+ - **`src/privateDictionary.js`** - Private tag definitions
118
+
119
+ ### Updating the Dictionary
120
+
121
+ When DICOM standards are updated or new tags need to be added:
122
+
123
+ 1. **Generate the dictionary from DICOM standards** (downloads latest PS3.6 and PS3.7 XML from dicom.nema.org):
124
+ ```bash
125
+ npm run generate-dictionary
126
+ ```
127
+ This creates/updates `generate/dictionary.js` with the latest tag definitions.
128
+
129
+ 2. **Pack the dictionary into optimized format**:
130
+ ```bash
131
+ npm run pack-dictionary
132
+ ```
133
+ This generates the optimized `src/dictionary.fast.js` used at runtime.
134
+
135
+ ### Why the Fast Dictionary?
136
+
137
+ The fast dictionary was introduced to significantly improve library load performance. The original dictionary format required complex runtime processing during module initialization, which added substantial overhead, especially in applications that frequently import dcmjs.
138
+
139
+ **Performance Benchmark Results (Bun):**
140
+
141
+ ```
142
+ Old dictionary (generate/dictionary.mjs): 181.16 ms
143
+ New dictionary (src/dictionary.fast.js): 19.04 ms
144
+ Performance improvement: 9.52x faster
145
+
146
+ ESM main (dcmjs.es.js): 112.01 ms
147
+ ESM private (loadPrivateTags): 0.01 ms
148
+ ESM total: 112.01 ms
149
+
150
+ UMD (dcmjs.js): 72.11 ms
151
+ ```
152
+
153
+ The fast dictionary reduces initial load time by over 9x, making it especially beneficial for:
154
+ - Server-side applications that spawn multiple workers
155
+ - Build tools and bundlers
156
+ - Applications with frequent module reloading during development
157
+ - Environments where startup time is critical
158
+
109
159
  ## Community Participation
110
160
 
111
161
  Use this repository's issues page to report any bugs. Please follow [SSCCE](http://sscce.org/) guidelines when submitting issues.