dcmnorm 0.15.1 → 0.16.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/README.md +81 -5
- package/index.d.ts +216 -7
- package/index.js +61 -56
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -165,15 +165,23 @@ const { width, height, channels, pixels } = await renderPixels("in.dcm", 0, { wi
|
|
|
165
165
|
|
|
166
166
|
- `buildVolume(filePaths: string[]): Promise<DicomVolumeHandle>` — reads and decodes every slice
|
|
167
167
|
of a parallel stack (e.g. one CT/MR/PT series), spatially re-sorted by `ImagePositionPatient`
|
|
168
|
-
regardless of input order.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
regardless of input order.
|
|
169
|
+
- Enhanced multi-frame objects work too: a single Enhanced CT/MR/PET file is a whole volume.
|
|
170
|
+
Each frame's Plane Position, Plane Orientation and Pixel Measures functional groups and its
|
|
171
|
+
own rescale are used. Frames that repeat a position are skipped (later temporal positions or
|
|
172
|
+
echoes): the first in file and frame order is kept.
|
|
173
|
+
- A gantry-tilted stack, whose slice origins drift within the slice plane, is desheared onto an
|
|
174
|
+
orthogonal grid that covers every slice. `rows`/`cols` can then exceed the source images.
|
|
175
|
+
- Rejects fewer than 2 slices, mismatched Rows/Columns, or a non-parallel stack.
|
|
176
|
+
- This is the expensive step. Build once per series and keep the returned handle resident (e.g.
|
|
177
|
+
in a volume cache), so every later `reformat()` call is cheap.
|
|
172
178
|
- `DicomVolumeHandle` — an opaque, read-only handle around the built volume:
|
|
173
179
|
- getters: `rows`, `cols`, `numSlices`, `nativeBasis` (`[rowDir(3), colDir(3)]`, the volume's own
|
|
174
180
|
acquisition-native orientation — a reasonable seed for an "axial" reformat), `center`
|
|
175
181
|
(`[x,y,z]` LPS mm, the volume's physical center), `minSpacingMm` (its smallest voxel
|
|
176
|
-
dimension, a reasonable default output spacing)
|
|
182
|
+
dimension, a reasonable default output spacing), `modality`, `frameOfReferenceUid`,
|
|
183
|
+
`seriesInstanceUid`, `studyInstanceUid` (from the files, or `null`), `gantryTiltDeg`,
|
|
184
|
+
`desheared`, `irregularSpacing`, `voxelToPatient` (row-major 4x4, `(col, row, slice, 1)` to LPS mm)
|
|
177
185
|
- `reformat(options): Promise<RenderedFrame>` — resamples one plane through the volume and
|
|
178
186
|
encodes it exactly like `renderFrame`'s output shape, so callers reuse their existing
|
|
179
187
|
image-display code path. `options`: `{ origin: number[3], rowDir: number[3], colDir: number[3],
|
|
@@ -185,6 +193,74 @@ const { width, height, channels, pixels } = await renderPixels("in.dcm", 0, { wi
|
|
|
185
193
|
- `exportTexture(options?): Promise<TextureExportResult>` — see
|
|
186
194
|
[Texture export](#texture-export) below.
|
|
187
195
|
|
|
196
|
+
### Registration
|
|
197
|
+
|
|
198
|
+
Every matrix is 16 numbers, row-major, mapping MOVING patient LPS mm to FIXED patient LPS mm
|
|
199
|
+
(`p_fixed = M * [x, y, z, 1]`). That is the DICOM Spatial Registration convention, with the item's
|
|
200
|
+
Frame of Reference the moving one and the REG's own the fixed one, so a result goes into
|
|
201
|
+
`writeSpatialRegistration` unchanged. Volumes are `buildVolume` handles. The algorithm is described
|
|
202
|
+
in [the CLI docs](../../docs/cli.md#register-two-volumes).
|
|
203
|
+
|
|
204
|
+
- `registerVolumes(fixed, moving, options?, cancel?: RegistrationCancelToken): Promise<RegistrationResult>`
|
|
205
|
+
- What it does: rigid 6-DOF registration of any CT/MR/PT pairing.
|
|
206
|
+
- `options`:
|
|
207
|
+
- `metric` (`'auto'` | `'ncc'` | `'mattes-mi'`)
|
|
208
|
+
- `fixedModality` / `movingModality`: override the files' Modality
|
|
209
|
+
- `initialMatrix` (number[16]): a starting moving -> fixed transform
|
|
210
|
+
- `initialize` (`'translation'` default | `'centroid'` | `'none'`): used without `initialMatrix`
|
|
211
|
+
- `levelsMm` (default `[8, 4, 2]`)
|
|
212
|
+
- `maxIterations` (per level, default 40)
|
|
213
|
+
- `timeLimitMs` (default 30000)
|
|
214
|
+
- `mask` (`'auto'` | `'none'`)
|
|
215
|
+
- `roiMinMm` / `roiMaxMm`: a box in fixed patient coordinates
|
|
216
|
+
- `histogramBins` (32), `maxSamples` (100000), `maxMemoryBytes` (256 MiB; a level that would
|
|
217
|
+
exceed it is coarsened)
|
|
218
|
+
- Result fields:
|
|
219
|
+
- `matrix`, `rotationDeg` and `translationMm` (of the matrix), `centerMm`
|
|
220
|
+
- `metric`, `metricValue`, `initialMetricValue`, `normalizedMetric`, `overlapFraction`
|
|
221
|
+
- `quality` (0..1) and `qualityLabel` (`'good'` | `'fair'` | `'poor'`)
|
|
222
|
+
- `iterations`, `metricEvaluations`, `levels[]`, `initialization`
|
|
223
|
+
- `converged`, `stopReason` (`'converged'` | `'max-iterations'` | `'time-limit'`)
|
|
224
|
+
- `timingMs`, `workingBytes`
|
|
225
|
+
- Rejects when a volume was released, when there are no body voxels or no overlap, on invalid
|
|
226
|
+
options, and when cancelled (the message starts "registration cancelled"). Results are
|
|
227
|
+
deterministic across runs and thread counts.
|
|
228
|
+
- `new RegistrationCancelToken()`: `.cancel()`, `.cancelled`.
|
|
229
|
+
- `estimateTranslation(fixed, moving, options?): Promise<TranslationEstimate>`
|
|
230
|
+
- What it does: the fast translation-only estimate, which also seeds `registerVolumes`.
|
|
231
|
+
- `options`: `fixedModality`, `movingModality`, `minOverlapMm` (60), `maxShiftMm`.
|
|
232
|
+
- Result: `matrix`, `translationMm`, `confidence` (0..1; below about 0.3, fall back to
|
|
233
|
+
capture-on-link), `peakCorrelation`, `secondPeakCorrelation`, `overlapMm`, `profiles`,
|
|
234
|
+
`timingMs`.
|
|
235
|
+
- `readSpatialRegistration(filePath): Promise<string>`
|
|
236
|
+
- What it does: a Spatial Registration object (`.66.1`, or the pre/post matrices of a
|
|
237
|
+
Deformable `.66.3`) as a JSON string.
|
|
238
|
+
- Top-level fields: `frameOfReferenceUid` (the REG's own registered frame), the SOP, series,
|
|
239
|
+
study and patient identifiers, `contentLabel`, `contentDate`, `deformable`.
|
|
240
|
+
- `registrations[]`: `frameOfReferenceUid`, `matrix` (the item frame -> REG frame, composed over
|
|
241
|
+
its Matrix Sequence in order), `matrixType`, `matrices[]`, `registrationType`, `comment`,
|
|
242
|
+
`referencedImages[]`, `isIdentity`.
|
|
243
|
+
- Also `referencedSeries[]` (the Common Instance Reference) and `warnings[]` (IOD problems).
|
|
244
|
+
- Rejects any other SOP Class.
|
|
245
|
+
- `writeSpatialRegistration(specJson: string, outputPath?): Promise<{ json, dataset, sopInstanceUid, seriesInstanceUid, data? }>`
|
|
246
|
+
- What it does: builds a conformant REG in the fixed study. Item 1 holds the fixed Frame of
|
|
247
|
+
Reference with the identity, item 2 the moving one with `matrix`.
|
|
248
|
+
- Spec fields:
|
|
249
|
+
- `matrix`, `matrixType` (`'RIGID'` default, validated orthonormal; `'RIGID_SCALE'`; `'AFFINE'`)
|
|
250
|
+
- `registrationType` (`'auto'` → DCM 125024 | `'manual'` → 125025 | `'identity'` → 125021)
|
|
251
|
+
- `fixed` / `moving`: `{ frameOfReferenceUid, studyInstanceUid, seriesInstanceUid, instances?: [{ sopClassUid, sopInstanceUid }] }`
|
|
252
|
+
- `copyPatientStudyFrom`: a path to one fixed-study file
|
|
253
|
+
- `patient` / `study` overrides
|
|
254
|
+
- `sopInstanceUid`, `seriesInstanceUid` (generated when omitted), `seriesNumber` (9902),
|
|
255
|
+
`seriesDescription`, `instanceNumber`, `contentLabel`, `contentDescription`,
|
|
256
|
+
`contentCreatorName`, `manufacturer`, `comment`
|
|
257
|
+
- Returns:
|
|
258
|
+
- `json`: the object in `readSpatialRegistration`'s form
|
|
259
|
+
- `dataset`: standard PS3.18 DICOM JSON, ready for `writeJson`
|
|
260
|
+
- `data`: the Part 10 bytes, when `outputPath` is omitted
|
|
261
|
+
- Rejects specs that would not make a conformant object, for example fixed and moving in one
|
|
262
|
+
Frame of Reference, or a non-rigid `'RIGID'` matrix.
|
|
263
|
+
|
|
188
264
|
### Texture export
|
|
189
265
|
|
|
190
266
|
Packs a volume, a single frame, or several independent frames as a lossless, GPU-upload-ready
|
package/index.d.ts
CHANGED
|
@@ -20,9 +20,12 @@ export declare class DicomServerHandle {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export declare class DicomVolumeHandle {
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Rows of the volume's slice grid (image height). The source images' Rows, except for a
|
|
25
|
+
* desheared (gantry-tilted) stack, whose grid covers every slice's footprint.
|
|
26
|
+
*/
|
|
24
27
|
get rows(): number
|
|
25
|
-
/** Columns
|
|
28
|
+
/** Columns of the volume's slice grid (image width); see `rows`. */
|
|
26
29
|
get cols(): number
|
|
27
30
|
/** Number of slices in the built volume. */
|
|
28
31
|
get numSlices(): number
|
|
@@ -48,6 +51,31 @@ export declare class DicomVolumeHandle {
|
|
|
48
51
|
get center(): Array<number>
|
|
49
52
|
/** The volume's own smallest voxel dimension, in mm - a reasonable default output spacing. */
|
|
50
53
|
get minSpacingMm(): number
|
|
54
|
+
/** `Modality` of the source images (`CT`, `MR`, `PT`, ...), or `null`. */
|
|
55
|
+
get modality(): string | null
|
|
56
|
+
/** `FrameOfReferenceUID` of the source images, or `null`. */
|
|
57
|
+
get frameOfReferenceUid(): string | null
|
|
58
|
+
/** `SeriesInstanceUID` of the source images, or `null`. */
|
|
59
|
+
get seriesInstanceUid(): string | null
|
|
60
|
+
/** `StudyInstanceUID` of the source images, or `null`. */
|
|
61
|
+
get studyInstanceUid(): string | null
|
|
62
|
+
/**
|
|
63
|
+
* Gantry tilt of the acquisition, degrees: the angle between the slice-to-slice position
|
|
64
|
+
* step and the slice normal. `0` for an ordinary stack.
|
|
65
|
+
*/
|
|
66
|
+
get gantryTiltDeg(): number
|
|
67
|
+
/** Whether the stack was sheared (gantry tilt) and resampled onto an orthogonal grid. */
|
|
68
|
+
get desheared(): boolean
|
|
69
|
+
/**
|
|
70
|
+
* Whether the slice gaps are irregular (a missing slice, variable pitch). Reformats
|
|
71
|
+
* interpolate by real position either way; `exportTexture` resamples to a uniform lattice.
|
|
72
|
+
*/
|
|
73
|
+
get irregularSpacing(): boolean
|
|
74
|
+
/**
|
|
75
|
+
* Row-major 4x4 matrix from voxel index `(col, row, slice, 1)` to patient LPS mm (slice
|
|
76
|
+
* axis at the nominal uniform spacing).
|
|
77
|
+
*/
|
|
78
|
+
get voxelToPatient(): Array<number>
|
|
51
79
|
/**
|
|
52
80
|
* Resamples one plane through this volume and encodes it exactly like a normal 2D render
|
|
53
81
|
* (same `RenderedFrame` shape `renderFrame` returns), so callers can reuse their existing
|
|
@@ -117,6 +145,16 @@ export declare class MoveScuHandle {
|
|
|
117
145
|
abort(): Promise<MoveScuResult>
|
|
118
146
|
}
|
|
119
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Cancels a running `registerVolumes`: pass it as the 4th argument and call `cancel()`; the
|
|
150
|
+
* registration rejects with "registration cancelled" at its next metric evaluation.
|
|
151
|
+
*/
|
|
152
|
+
export declare class RegistrationCancelToken {
|
|
153
|
+
constructor()
|
|
154
|
+
cancel(): void
|
|
155
|
+
get cancelled(): boolean
|
|
156
|
+
}
|
|
157
|
+
|
|
120
158
|
export declare class StoreScuHandle {
|
|
121
159
|
/**
|
|
122
160
|
* The eventual per-file `{sopInstanceUid, status}` results, without requesting
|
|
@@ -137,11 +175,13 @@ export declare class StoreScuHandle {
|
|
|
137
175
|
|
|
138
176
|
/**
|
|
139
177
|
* Builds a 3D volume from a parallel stack of DICOM slice files (e.g. every image instance in
|
|
140
|
-
* one CT/MR/PT series) sharing consistent `ImageOrientationPatient
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
178
|
+
* one CT/MR/PT series) sharing consistent `ImageOrientationPatient`, or from Enhanced
|
|
179
|
+
* multi-frame objects (one Enhanced CT/MR/PET file is enough; per-frame positions and rescale
|
|
180
|
+
* are honoured). Slices are spatially re-sorted internally by `ImagePositionPatient`,
|
|
181
|
+
* regardless of `filePaths`' own order; a gantry-tilted stack is desheared onto an orthogonal
|
|
182
|
+
* grid. Returns a `DicomVolumeHandle` for repeated `reformat()` calls. Rejects (rather than
|
|
183
|
+
* silently mis-rendering) fewer than 2 slices, mismatched Rows/Columns, or a non-parallel
|
|
184
|
+
* stack.
|
|
145
185
|
*/
|
|
146
186
|
export declare function buildVolume(filePaths: Array<string>): Promise<unknown>
|
|
147
187
|
|
|
@@ -263,6 +303,25 @@ export interface EditTagsOptions {
|
|
|
263
303
|
removePrivateTags?: boolean
|
|
264
304
|
}
|
|
265
305
|
|
|
306
|
+
/**
|
|
307
|
+
* A fast moving -> fixed translation: the S-I shift from cross-correlating per-height profiles
|
|
308
|
+
* (body area; plus lung and bone area for CT-CT, integrated intensity for MR-MR / PT-PT), the
|
|
309
|
+
* in-plane shift from body-mask centroids over the matched overlap. Works for any acquisition
|
|
310
|
+
* orientation. Tens of milliseconds for a typical CT.
|
|
311
|
+
*/
|
|
312
|
+
export declare function estimateTranslation(fixed: DicomVolumeHandle, moving: DicomVolumeHandle, options?: EstimateTranslationOptions | undefined | null): Promise<unknown>
|
|
313
|
+
|
|
314
|
+
export interface EstimateTranslationOptions {
|
|
315
|
+
/** Overrides the fixed volume's Modality ('CT', 'MR', 'PT', ...). */
|
|
316
|
+
fixedModality?: string
|
|
317
|
+
/** Overrides the moving volume's Modality. */
|
|
318
|
+
movingModality?: string
|
|
319
|
+
/** Smallest S-I overlap of the two scans a z shift may imply, mm (default 60). */
|
|
320
|
+
minOverlapMm?: number
|
|
321
|
+
/** Largest |z shift| considered, mm (default: anything with enough overlap). */
|
|
322
|
+
maxShiftMm?: number
|
|
323
|
+
}
|
|
324
|
+
|
|
266
325
|
/**
|
|
267
326
|
* Packs several independent frames (from one or more files) as one texture-array upload - see
|
|
268
327
|
* `dcmnorm::dicom_io::pack_frame_stack_texture`'s own doc for the full contract (no resampling,
|
|
@@ -568,6 +627,16 @@ export interface ReadJsonOptions {
|
|
|
568
627
|
omitKeywordVm?: boolean
|
|
569
628
|
}
|
|
570
629
|
|
|
630
|
+
/**
|
|
631
|
+
* Reads a DICOM Spatial Registration object (1.2.840.10008.5.1.4.1.1.66.1; for a Deformable
|
|
632
|
+
* one, .66.3, only its pre/post-deformation matrices) and resolves with its JSON form as a
|
|
633
|
+
* string: the REG's own (registered) Frame of Reference, one entry per Registration Sequence
|
|
634
|
+
* item with its Frame of Reference, the composed item -> REG matrix (row-major), its type and
|
|
635
|
+
* referenced images, the Common Instance Reference series, and `warnings` (IOD problems).
|
|
636
|
+
* Rejects anything that is not a registration object.
|
|
637
|
+
*/
|
|
638
|
+
export declare function readSpatialRegistration(filePath: string): Promise<unknown>
|
|
639
|
+
|
|
571
640
|
export declare function readTags(filePath: string, tags: Array<string>): Promise<unknown>
|
|
572
641
|
|
|
573
642
|
export interface ReformatPlaneOptions {
|
|
@@ -603,6 +672,96 @@ export interface ReformatPlaneOptions {
|
|
|
603
672
|
slabProjection?: string
|
|
604
673
|
}
|
|
605
674
|
|
|
675
|
+
/**
|
|
676
|
+
* Rigid (6-DOF) registration of `moving` onto `fixed`, any CT / MR / PT pairing: a multi-
|
|
677
|
+
* resolution pyramid, modality-aware body masks (CT table removed), NCC for the same modality
|
|
678
|
+
* and Mattes mutual information across modalities, Powell's optimizer. Deterministic, bounded
|
|
679
|
+
* by `maxMemoryBytes` and `timeLimitMs`, cancellable through `cancel`. Resolves with the
|
|
680
|
+
* moving -> fixed patient matrix, the metric, a quality score and timing; rejects when the
|
|
681
|
+
* volumes have no body or do not overlap, on invalid options, or when cancelled.
|
|
682
|
+
*/
|
|
683
|
+
export declare function registerVolumes(fixed: DicomVolumeHandle, moving: DicomVolumeHandle, options?: RegisterVolumesOptions | undefined | null, cancel?: RegistrationCancelToken | undefined | null): Promise<unknown>
|
|
684
|
+
|
|
685
|
+
export interface RegisterVolumesOptions {
|
|
686
|
+
/**
|
|
687
|
+
* 'auto' (default: 'ncc' for the same modality, 'mattes-mi' across modalities), 'ncc' or
|
|
688
|
+
* 'mattes-mi'.
|
|
689
|
+
*/
|
|
690
|
+
metric?: string
|
|
691
|
+
fixedModality?: string
|
|
692
|
+
movingModality?: string
|
|
693
|
+
/** Starting moving -> fixed transform (16 numbers, row-major), e.g. the viewer's translation. */
|
|
694
|
+
initialMatrix?: Array<number>
|
|
695
|
+
/**
|
|
696
|
+
* Without `initialMatrix`: 'translation' (default; estimateTranslation, then the mask
|
|
697
|
+
* centroids when it is not confident), 'centroid' or 'none'.
|
|
698
|
+
*/
|
|
699
|
+
initialize?: string
|
|
700
|
+
/** Working-grid spacing per pyramid level, coarse to fine, mm (default [8, 4, 2]). */
|
|
701
|
+
levelsMm?: Array<number>
|
|
702
|
+
/** Optimizer iterations per level (default 40). */
|
|
703
|
+
maxIterations?: number
|
|
704
|
+
/**
|
|
705
|
+
* Wall-clock limit, ms (default 30000). On expiry the best result so far is returned with
|
|
706
|
+
* `stopReason: 'time-limit'`.
|
|
707
|
+
*/
|
|
708
|
+
timeLimitMs?: number
|
|
709
|
+
/** 'auto' (default: modality-aware body mask, CT table removed) or 'none'. */
|
|
710
|
+
mask?: string
|
|
711
|
+
/** Optional box in FIXED patient coordinates the fixed mask is limited to (min corner). */
|
|
712
|
+
roiMinMm?: Array<number>
|
|
713
|
+
/** Max corner of `roiMinMm`'s box. */
|
|
714
|
+
roiMaxMm?: Array<number>
|
|
715
|
+
/** Mutual-information histogram bins (default 32). */
|
|
716
|
+
histogramBins?: number
|
|
717
|
+
/** Metric sample points per level (default 100000). */
|
|
718
|
+
maxSamples?: number
|
|
719
|
+
/** Working-memory cap in bytes (default 268435456); a level that would exceed it is coarsened. */
|
|
720
|
+
maxMemoryBytes?: number
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
export interface RegistrationLevel {
|
|
724
|
+
spacingMm: number
|
|
725
|
+
iterations: number
|
|
726
|
+
metricEvaluations: number
|
|
727
|
+
metricValue: number
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export interface RegistrationResult {
|
|
731
|
+
/** Moving -> fixed patient, row-major 4x4. */
|
|
732
|
+
matrix: Array<number>
|
|
733
|
+
/** Euler angles of the matrix's rotation, degrees (`R = Rz * Ry * Rx`). */
|
|
734
|
+
rotationDeg: Array<number>
|
|
735
|
+
/** The matrix's translation column, mm. */
|
|
736
|
+
translationMm: Array<number>
|
|
737
|
+
/** Centre of rotation the optimizer used (fixed body centroid), fixed patient mm. */
|
|
738
|
+
centerMm: Array<number>
|
|
739
|
+
/** 'ncc' or 'mattes-mi'. */
|
|
740
|
+
metric: string
|
|
741
|
+
/** NCC correlation (-1..1), or mutual information (nats). */
|
|
742
|
+
metricValue: number
|
|
743
|
+
initialMetricValue: number
|
|
744
|
+
/** NCC correlation, or MI's entropy correlation coefficient (0..1). */
|
|
745
|
+
normalizedMetric: number
|
|
746
|
+
/** Fraction of the fixed body samples that land inside the moving volume. */
|
|
747
|
+
overlapFraction: number
|
|
748
|
+
/** 0..1 heuristic; show it, and never apply a 'poor' result silently. */
|
|
749
|
+
quality: number
|
|
750
|
+
/** 'good' (>= 0.7), 'fair' (>= 0.4) or 'poor'. */
|
|
751
|
+
qualityLabel: string
|
|
752
|
+
iterations: number
|
|
753
|
+
metricEvaluations: number
|
|
754
|
+
levels: Array<RegistrationLevel>
|
|
755
|
+
/** 'matrix', 'translation', 'centroid' or 'none'. */
|
|
756
|
+
initialization: string
|
|
757
|
+
converged: boolean
|
|
758
|
+
/** 'converged', 'max-iterations' or 'time-limit'. */
|
|
759
|
+
stopReason: string
|
|
760
|
+
timingMs: number
|
|
761
|
+
/** Peak bytes of working images and samples held. */
|
|
762
|
+
workingBytes: number
|
|
763
|
+
}
|
|
764
|
+
|
|
606
765
|
export interface RenderedFrame {
|
|
607
766
|
mimeType: string
|
|
608
767
|
width: number
|
|
@@ -846,6 +1005,23 @@ export interface TransferSyntaxSupportInfo {
|
|
|
846
1005
|
canTranscodeTo: boolean
|
|
847
1006
|
}
|
|
848
1007
|
|
|
1008
|
+
export interface TranslationEstimate {
|
|
1009
|
+
/** Moving -> fixed patient (a pure translation), row-major 4x4. */
|
|
1010
|
+
matrix: Array<number>
|
|
1011
|
+
translationMm: Array<number>
|
|
1012
|
+
/**
|
|
1013
|
+
* 0..1: the correlation peak's height and its margin over the next peak 20+ mm away.
|
|
1014
|
+
* Below ~0.3, fall back to capture-on-link.
|
|
1015
|
+
*/
|
|
1016
|
+
confidence: number
|
|
1017
|
+
peakCorrelation: number
|
|
1018
|
+
secondPeakCorrelation: number
|
|
1019
|
+
overlapMm: number
|
|
1020
|
+
/** The profiles correlated: 'body', 'lung', 'bone' (CT-CT), 'intensity' (MR-MR, PT-PT). */
|
|
1021
|
+
profiles: Array<string>
|
|
1022
|
+
timingMs: number
|
|
1023
|
+
}
|
|
1024
|
+
|
|
849
1025
|
/** The dictionary VR of a tag, or null. */
|
|
850
1026
|
export declare function vrOf(tag: number): string | null
|
|
851
1027
|
|
|
@@ -896,3 +1072,36 @@ export interface WriteJsonOptions {
|
|
|
896
1072
|
*/
|
|
897
1073
|
bulkDataSourcePath?: string
|
|
898
1074
|
}
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Builds a DICOM Spatial Registration instance from `specJson` (a JSON string) and writes it to
|
|
1078
|
+
* `outputPath`, or returns its bytes as `data` when `outputPath` is omitted. The REG goes in the
|
|
1079
|
+
* FIXED study and Frame of Reference: item 1 maps the fixed frame with the identity, item 2 the
|
|
1080
|
+
* moving frame with `matrix` (moving -> fixed, row-major, what registerVolumes returns).
|
|
1081
|
+
*
|
|
1082
|
+
* spec: `{ matrix: number[16], matrixType?: 'RIGID' (default) | 'RIGID_SCALE' | 'AFFINE',
|
|
1083
|
+
* registrationType?: 'auto' | 'manual' | 'identity', fixed: { frameOfReferenceUid,
|
|
1084
|
+
* studyInstanceUid, seriesInstanceUid, instances?: [{ sopClassUid, sopInstanceUid }] }, moving:
|
|
1085
|
+
* { ...same }, copyPatientStudyFrom?: path to one fixed-study DICOM file, patient?: {
|
|
1086
|
+
* patientName, patientId, patientBirthDate, patientSex }, study?: { studyDate, studyTime,
|
|
1087
|
+
* accessionNumber, referringPhysicianName, studyId, studyDescription }, sopInstanceUid?,
|
|
1088
|
+
* seriesInstanceUid?, seriesNumber?, seriesDescription?, instanceNumber?, contentLabel?,
|
|
1089
|
+
* contentDescription?, contentCreatorName?, manufacturer?, comment? }`. Rejects a spec that would
|
|
1090
|
+
* not produce a conformant object (missing UIDs, a non-rigid RIGID matrix, fixed and moving in
|
|
1091
|
+
* one Frame of Reference, ...).
|
|
1092
|
+
*/
|
|
1093
|
+
export declare function writeSpatialRegistration(specJson: string, outputPath?: string | undefined | null): Promise<unknown>
|
|
1094
|
+
|
|
1095
|
+
export interface WrittenSpatialRegistration {
|
|
1096
|
+
/** The written object in readSpatialRegistration's JSON form (a string). */
|
|
1097
|
+
json: string
|
|
1098
|
+
/**
|
|
1099
|
+
* The written object as standard PS3.18 DICOM JSON (hex tag keys, `{vr, Value}`), a
|
|
1100
|
+
* string, ready for `writeJson`.
|
|
1101
|
+
*/
|
|
1102
|
+
dataset: string
|
|
1103
|
+
sopInstanceUid: string
|
|
1104
|
+
seriesInstanceUid: string
|
|
1105
|
+
/** The Part 10 file's bytes, when no `outputPath` was given. */
|
|
1106
|
+
data?: Buffer
|
|
1107
|
+
}
|
package/index.js
CHANGED
|
@@ -94,8 +94,8 @@ function requireNative() {
|
|
|
94
94
|
try {
|
|
95
95
|
const binding = require('@dcmnorm/android-arm64')
|
|
96
96
|
const bindingPackageVersion = require('@dcmnorm/android-arm64/package.json').version
|
|
97
|
-
if (bindingPackageVersion !== '0.
|
|
98
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
97
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
98
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
99
99
|
}
|
|
100
100
|
return binding
|
|
101
101
|
} catch (e) {
|
|
@@ -110,8 +110,8 @@ function requireNative() {
|
|
|
110
110
|
try {
|
|
111
111
|
const binding = require('@dcmnorm/android-arm-eabi')
|
|
112
112
|
const bindingPackageVersion = require('@dcmnorm/android-arm-eabi/package.json').version
|
|
113
|
-
if (bindingPackageVersion !== '0.
|
|
114
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
113
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
114
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
115
115
|
}
|
|
116
116
|
return binding
|
|
117
117
|
} catch (e) {
|
|
@@ -131,8 +131,8 @@ function requireNative() {
|
|
|
131
131
|
try {
|
|
132
132
|
const binding = require('@dcmnorm/win32-x64-gnu')
|
|
133
133
|
const bindingPackageVersion = require('@dcmnorm/win32-x64-gnu/package.json').version
|
|
134
|
-
if (bindingPackageVersion !== '0.
|
|
135
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
134
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
135
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
136
136
|
}
|
|
137
137
|
return binding
|
|
138
138
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@dcmnorm/win32-x64-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@dcmnorm/win32-x64-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -164,8 +164,8 @@ function requireNative() {
|
|
|
164
164
|
try {
|
|
165
165
|
const binding = require('@dcmnorm/win32-ia32-msvc')
|
|
166
166
|
const bindingPackageVersion = require('@dcmnorm/win32-ia32-msvc/package.json').version
|
|
167
|
-
if (bindingPackageVersion !== '0.
|
|
168
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
167
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
168
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
169
169
|
}
|
|
170
170
|
return binding
|
|
171
171
|
} catch (e) {
|
|
@@ -180,8 +180,8 @@ function requireNative() {
|
|
|
180
180
|
try {
|
|
181
181
|
const binding = require('@dcmnorm/win32-arm64-msvc')
|
|
182
182
|
const bindingPackageVersion = require('@dcmnorm/win32-arm64-msvc/package.json').version
|
|
183
|
-
if (bindingPackageVersion !== '0.
|
|
184
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
183
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
184
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
185
185
|
}
|
|
186
186
|
return binding
|
|
187
187
|
} catch (e) {
|
|
@@ -199,8 +199,8 @@ function requireNative() {
|
|
|
199
199
|
try {
|
|
200
200
|
const binding = require('@dcmnorm/darwin-universal')
|
|
201
201
|
const bindingPackageVersion = require('@dcmnorm/darwin-universal/package.json').version
|
|
202
|
-
if (bindingPackageVersion !== '0.
|
|
203
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
202
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
203
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
204
204
|
}
|
|
205
205
|
return binding
|
|
206
206
|
} catch (e) {
|
|
@@ -215,8 +215,8 @@ function requireNative() {
|
|
|
215
215
|
try {
|
|
216
216
|
const binding = require('@dcmnorm/darwin-x64')
|
|
217
217
|
const bindingPackageVersion = require('@dcmnorm/darwin-x64/package.json').version
|
|
218
|
-
if (bindingPackageVersion !== '0.
|
|
219
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
218
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
219
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
220
220
|
}
|
|
221
221
|
return binding
|
|
222
222
|
} catch (e) {
|
|
@@ -231,8 +231,8 @@ function requireNative() {
|
|
|
231
231
|
try {
|
|
232
232
|
const binding = require('@dcmnorm/darwin-arm64')
|
|
233
233
|
const bindingPackageVersion = require('@dcmnorm/darwin-arm64/package.json').version
|
|
234
|
-
if (bindingPackageVersion !== '0.
|
|
235
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
234
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
235
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
236
236
|
}
|
|
237
237
|
return binding
|
|
238
238
|
} catch (e) {
|
|
@@ -251,8 +251,8 @@ function requireNative() {
|
|
|
251
251
|
try {
|
|
252
252
|
const binding = require('@dcmnorm/freebsd-x64')
|
|
253
253
|
const bindingPackageVersion = require('@dcmnorm/freebsd-x64/package.json').version
|
|
254
|
-
if (bindingPackageVersion !== '0.
|
|
255
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
254
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
255
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
256
256
|
}
|
|
257
257
|
return binding
|
|
258
258
|
} catch (e) {
|
|
@@ -267,8 +267,8 @@ function requireNative() {
|
|
|
267
267
|
try {
|
|
268
268
|
const binding = require('@dcmnorm/freebsd-arm64')
|
|
269
269
|
const bindingPackageVersion = require('@dcmnorm/freebsd-arm64/package.json').version
|
|
270
|
-
if (bindingPackageVersion !== '0.
|
|
271
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
270
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
271
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
272
272
|
}
|
|
273
273
|
return binding
|
|
274
274
|
} catch (e) {
|
|
@@ -283,8 +283,8 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require('@dcmnorm/freebsd-ppc64')
|
|
285
285
|
const bindingPackageVersion = require('@dcmnorm/freebsd-ppc64/package.json').version
|
|
286
|
-
if (bindingPackageVersion !== '0.
|
|
287
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
286
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
287
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
288
288
|
}
|
|
289
289
|
return binding
|
|
290
290
|
} catch (e) {
|
|
@@ -304,8 +304,8 @@ function requireNative() {
|
|
|
304
304
|
try {
|
|
305
305
|
const binding = require('@dcmnorm/linux-x64-musl')
|
|
306
306
|
const bindingPackageVersion = require('@dcmnorm/linux-x64-musl/package.json').version
|
|
307
|
-
if (bindingPackageVersion !== '0.
|
|
308
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
307
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
308
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
309
309
|
}
|
|
310
310
|
return binding
|
|
311
311
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@dcmnorm/linux-x64-gnu')
|
|
322
322
|
const bindingPackageVersion = require('@dcmnorm/linux-x64-gnu/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '0.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
323
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -338,8 +338,8 @@ function requireNative() {
|
|
|
338
338
|
try {
|
|
339
339
|
const binding = require('@dcmnorm/linux-arm64-musl')
|
|
340
340
|
const bindingPackageVersion = require('@dcmnorm/linux-arm64-musl/package.json').version
|
|
341
|
-
if (bindingPackageVersion !== '0.
|
|
342
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
341
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
342
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
343
343
|
}
|
|
344
344
|
return binding
|
|
345
345
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@dcmnorm/linux-arm64-gnu')
|
|
356
356
|
const bindingPackageVersion = require('@dcmnorm/linux-arm64-gnu/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '0.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
357
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -372,8 +372,8 @@ function requireNative() {
|
|
|
372
372
|
try {
|
|
373
373
|
const binding = require('@dcmnorm/linux-arm-musleabihf')
|
|
374
374
|
const bindingPackageVersion = require('@dcmnorm/linux-arm-musleabihf/package.json').version
|
|
375
|
-
if (bindingPackageVersion !== '0.
|
|
376
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
375
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
376
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
377
377
|
}
|
|
378
378
|
return binding
|
|
379
379
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@dcmnorm/linux-arm-gnueabihf')
|
|
390
390
|
const bindingPackageVersion = require('@dcmnorm/linux-arm-gnueabihf/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '0.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
391
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -406,8 +406,8 @@ function requireNative() {
|
|
|
406
406
|
try {
|
|
407
407
|
const binding = require('@dcmnorm/linux-loong64-musl')
|
|
408
408
|
const bindingPackageVersion = require('@dcmnorm/linux-loong64-musl/package.json').version
|
|
409
|
-
if (bindingPackageVersion !== '0.
|
|
410
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
409
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
410
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
411
411
|
}
|
|
412
412
|
return binding
|
|
413
413
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@dcmnorm/linux-loong64-gnu')
|
|
424
424
|
const bindingPackageVersion = require('@dcmnorm/linux-loong64-gnu/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '0.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
425
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@dcmnorm/linux-riscv64-musl')
|
|
442
442
|
const bindingPackageVersion = require('@dcmnorm/linux-riscv64-musl/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@dcmnorm/linux-riscv64-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@dcmnorm/linux-riscv64-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -473,8 +473,8 @@ function requireNative() {
|
|
|
473
473
|
try {
|
|
474
474
|
const binding = require('@dcmnorm/linux-ppc64-gnu')
|
|
475
475
|
const bindingPackageVersion = require('@dcmnorm/linux-ppc64-gnu/package.json').version
|
|
476
|
-
if (bindingPackageVersion !== '0.
|
|
477
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
476
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
477
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
478
478
|
}
|
|
479
479
|
return binding
|
|
480
480
|
} catch (e) {
|
|
@@ -489,8 +489,8 @@ function requireNative() {
|
|
|
489
489
|
try {
|
|
490
490
|
const binding = require('@dcmnorm/linux-s390x-gnu')
|
|
491
491
|
const bindingPackageVersion = require('@dcmnorm/linux-s390x-gnu/package.json').version
|
|
492
|
-
if (bindingPackageVersion !== '0.
|
|
493
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
492
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
493
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
494
494
|
}
|
|
495
495
|
return binding
|
|
496
496
|
} catch (e) {
|
|
@@ -509,8 +509,8 @@ function requireNative() {
|
|
|
509
509
|
try {
|
|
510
510
|
const binding = require('@dcmnorm/openharmony-arm64')
|
|
511
511
|
const bindingPackageVersion = require('@dcmnorm/openharmony-arm64/package.json').version
|
|
512
|
-
if (bindingPackageVersion !== '0.
|
|
513
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
512
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
513
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
514
514
|
}
|
|
515
515
|
return binding
|
|
516
516
|
} catch (e) {
|
|
@@ -525,8 +525,8 @@ function requireNative() {
|
|
|
525
525
|
try {
|
|
526
526
|
const binding = require('@dcmnorm/openharmony-x64')
|
|
527
527
|
const bindingPackageVersion = require('@dcmnorm/openharmony-x64/package.json').version
|
|
528
|
-
if (bindingPackageVersion !== '0.
|
|
529
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
528
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
529
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
530
530
|
}
|
|
531
531
|
return binding
|
|
532
532
|
} catch (e) {
|
|
@@ -541,8 +541,8 @@ function requireNative() {
|
|
|
541
541
|
try {
|
|
542
542
|
const binding = require('@dcmnorm/openharmony-arm')
|
|
543
543
|
const bindingPackageVersion = require('@dcmnorm/openharmony-arm/package.json').version
|
|
544
|
-
if (bindingPackageVersion !== '0.
|
|
545
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
544
|
+
if (bindingPackageVersion !== '0.16.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
545
|
+
throw new Error(`Native binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
546
546
|
}
|
|
547
547
|
return binding
|
|
548
548
|
} catch (e) {
|
|
@@ -683,8 +683,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
683
683
|
if (!candidateFailed) {
|
|
684
684
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
685
685
|
const bindingPackageVersion = require('@dcmnorm/wasm32-wasi/package.json').version
|
|
686
|
-
if (bindingPackageVersion !== '0.
|
|
687
|
-
throw new Error(`WASI binding package version mismatch, expected 0.
|
|
686
|
+
if (bindingPackageVersion !== '0.16.0') {
|
|
687
|
+
throw new Error(`WASI binding package version mismatch, expected 0.16.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
wasiBinding = require('@dcmnorm/wasm32-wasi')
|
|
@@ -840,6 +840,7 @@ module.exports.DicomVolumeHandle = nativeBinding.DicomVolumeHandle
|
|
|
840
840
|
module.exports.EchoScuHandle = nativeBinding.EchoScuHandle
|
|
841
841
|
module.exports.FindScuHandle = nativeBinding.FindScuHandle
|
|
842
842
|
module.exports.MoveScuHandle = nativeBinding.MoveScuHandle
|
|
843
|
+
module.exports.RegistrationCancelToken = nativeBinding.RegistrationCancelToken
|
|
843
844
|
module.exports.StoreScuHandle = nativeBinding.StoreScuHandle
|
|
844
845
|
module.exports.buildVolume = nativeBinding.buildVolume
|
|
845
846
|
module.exports.checkDicom = nativeBinding.checkDicom
|
|
@@ -852,6 +853,7 @@ module.exports.datasetTranscode = nativeBinding.datasetTranscode
|
|
|
852
853
|
module.exports.datasetWrite = nativeBinding.datasetWrite
|
|
853
854
|
module.exports.echoScu = nativeBinding.echoScu
|
|
854
855
|
module.exports.editTags = nativeBinding.editTags
|
|
856
|
+
module.exports.estimateTranslation = nativeBinding.estimateTranslation
|
|
855
857
|
module.exports.exportFrameStackTexture = nativeBinding.exportFrameStackTexture
|
|
856
858
|
module.exports.exportFrameStackTextureRgb = nativeBinding.exportFrameStackTextureRgb
|
|
857
859
|
module.exports.exportFrameTexture = nativeBinding.exportFrameTexture
|
|
@@ -860,7 +862,9 @@ module.exports.findScu = nativeBinding.findScu
|
|
|
860
862
|
module.exports.keywordOf = nativeBinding.keywordOf
|
|
861
863
|
module.exports.moveScu = nativeBinding.moveScu
|
|
862
864
|
module.exports.readJson = nativeBinding.readJson
|
|
865
|
+
module.exports.readSpatialRegistration = nativeBinding.readSpatialRegistration
|
|
863
866
|
module.exports.readTags = nativeBinding.readTags
|
|
867
|
+
module.exports.registerVolumes = nativeBinding.registerVolumes
|
|
864
868
|
module.exports.renderFrame = nativeBinding.renderFrame
|
|
865
869
|
module.exports.renderMovie = nativeBinding.renderMovie
|
|
866
870
|
module.exports.startDicomServer = nativeBinding.startDicomServer
|
|
@@ -874,3 +878,4 @@ module.exports.transferSyntaxSupport = nativeBinding.transferSyntaxSupport
|
|
|
874
878
|
module.exports.vrOf = nativeBinding.vrOf
|
|
875
879
|
module.exports.writeDicomdir = nativeBinding.writeDicomdir
|
|
876
880
|
module.exports.writeJson = nativeBinding.writeJson
|
|
881
|
+
module.exports.writeSpatialRegistration = nativeBinding.writeSpatialRegistration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcmnorm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Native Node.js bindings for dcmnorm: DICOM read/edit/transcode/render and DIMSE networking in-process (no CLI subprocess)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Jason Klotzer",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"build": "napi build --platform --release && node prepare-npm.js --fix-loader",
|
|
51
51
|
"build:debug": "napi build --platform && node prepare-npm.js --fix-loader",
|
|
52
52
|
"build:docker": "./build-in-docker.sh",
|
|
53
|
-
"test": "node test/smoke.js && node test/dataset.js"
|
|
53
|
+
"test": "node test/smoke.js && node test/dataset.js && node test/registration.js"
|
|
54
54
|
},
|
|
55
55
|
"optionalDependencies": {
|
|
56
|
-
"@dcmnorm/linux-x64-gnu": "0.
|
|
57
|
-
"@dcmnorm/linux-arm64-gnu": "0.
|
|
58
|
-
"@dcmnorm/win32-x64-msvc": "0.
|
|
59
|
-
"@dcmnorm/darwin-arm64": "0.
|
|
60
|
-
"@dcmnorm/darwin-x64": "0.
|
|
56
|
+
"@dcmnorm/linux-x64-gnu": "0.16.0",
|
|
57
|
+
"@dcmnorm/linux-arm64-gnu": "0.16.0",
|
|
58
|
+
"@dcmnorm/win32-x64-msvc": "0.16.0",
|
|
59
|
+
"@dcmnorm/darwin-arm64": "0.16.0",
|
|
60
|
+
"@dcmnorm/darwin-x64": "0.16.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@napi-rs/cli": "^3.7.3"
|