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.
- package/README.md +50 -0
- package/build/dcmjs.es.js +1069 -107
- package/build/dcmjs.es.js.map +1 -1
- package/build/dcmjs.js +1069 -107
- package/build/dcmjs.js.map +1 -1
- package/build/dcmjs.min.js +2 -2
- package/build/dcmjs.min.js.map +1 -1
- package/generate/dictionary.mjs +56029 -0
- package/package.json +18 -2
- package/.babelrc +0 -9
- package/.github/workflows/lint-and-format.yml +0 -27
- package/.github/workflows/publish-package.yml +0 -45
- package/.github/workflows/tests.yml +0 -24
- package/.prettierrc +0 -5
- package/.vscode/extensions.json +0 -7
- package/.vscode/settings.json +0 -8
- package/changelog.md +0 -31
- package/docs/ArrayBufferExpanderListener.md +0 -303
- package/docs/AsyncDicomReader-skill.md +0 -730
- package/eslint.config.mjs +0 -30
- package/generate-dictionary.js +0 -145
- package/jest.setup.js +0 -39
- package/netlify.toml +0 -22
- package/rollup.config.mjs +0 -57
- package/test/ArrayBufferExpanderListener.test.js +0 -365
- package/test/DICOMWEB.test.js +0 -1
- package/test/DicomMetaDictionary.test.js +0 -73
- package/test/SequenceOfItems.test.js +0 -86
- package/test/adapters.test.js +0 -43
- package/test/anonymizer.test.js +0 -176
- package/test/arrayItem.json +0 -351
- package/test/async-data.test.js +0 -575
- package/test/data-encoding.test.js +0 -59
- package/test/data-options.test.js +0 -199
- package/test/data.test.js +0 -1776
- package/test/derivations.test.js +0 -1
- package/test/helper/DicomDataReadBufferStreamBuilder.js +0 -89
- package/test/information-filter.test.js +0 -165
- package/test/integration/DicomMessage.readFile.test.js +0 -50
- package/test/lossless-read-write.test.js +0 -1407
- package/test/mocks/minimal_fields_dataset.json +0 -17
- package/test/mocks/null_number_vrs_dataset.json +0 -102
- package/test/normalizers.test.js +0 -38
- package/test/odd-frame-bit-data.js +0 -138
- package/test/rawTags.js +0 -170
- package/test/readBufferStream.test.js +0 -158
- package/test/sample-dicom.json +0 -904
- package/test/sample-op.lei +0 -0
- package/test/sample-sr.json +0 -997
- package/test/sr-tid.test.js +0 -251
- package/test/testUtils.js +0 -85
- package/test/utilities/deepEqual.test.js +0 -87
- package/test/utilities.test.js +0 -205
- package/test/video-test-dict.js +0 -40
- 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.
|