@ubercode/dcmtk 0.8.1 → 0.9.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/dist/dicom.cjs +18 -4
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.js +18 -4
- package/dist/dicom.js.map +1 -1
- package/dist/index.cjs +359 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +229 -2
- package/dist/index.d.ts +229 -2
- package/dist/index.js +358 -9
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +16 -3
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.js +18 -4
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +18 -3
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.js +18 -3
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,12 +6,13 @@ import { spawn, execSync } from 'child_process';
|
|
|
6
6
|
import kill from 'tree-kill';
|
|
7
7
|
import { EventEmitter } from 'events';
|
|
8
8
|
import { stderr, tryCatch } from 'stderr-lib';
|
|
9
|
-
import { XMLParser } from 'fast-xml-parser';
|
|
10
9
|
import * as fs from 'fs/promises';
|
|
11
|
-
import {
|
|
12
|
-
import * as net from 'net';
|
|
10
|
+
import { mkdir, stat, rm, copyFile, unlink, mkdtemp, readdir } from 'fs/promises';
|
|
13
11
|
import * as os from 'os';
|
|
14
12
|
import { tmpdir } from 'os';
|
|
13
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
14
|
+
import * as net from 'net';
|
|
15
|
+
import { randomUUID } from 'crypto';
|
|
15
16
|
|
|
16
17
|
var __defProp = Object.defineProperty;
|
|
17
18
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -31476,13 +31477,26 @@ async function tryDirectPath(inputPath, timeoutMs, signal, verbosity) {
|
|
|
31476
31477
|
if (!jsonBinary.ok) {
|
|
31477
31478
|
return err(jsonBinary.error);
|
|
31478
31479
|
}
|
|
31479
|
-
const
|
|
31480
|
-
const
|
|
31480
|
+
const bulkDir = await createBulkTempDir();
|
|
31481
|
+
const directArgs = [...buildVerbosityArgs(verbosity), "+b", "+bd", bulkDir, inputPath];
|
|
31482
|
+
try {
|
|
31483
|
+
const execOpts = signal !== void 0 ? { timeoutMs, signal } : { timeoutMs };
|
|
31484
|
+
return await execAndParse(jsonBinary.value, directArgs, inputPath, execOpts);
|
|
31485
|
+
} finally {
|
|
31486
|
+
rm(bulkDir, { recursive: true, force: true }).catch(() => {
|
|
31487
|
+
});
|
|
31488
|
+
}
|
|
31489
|
+
}
|
|
31490
|
+
async function createBulkTempDir() {
|
|
31491
|
+
return mkdtemp(join(tmpdir(), "dcm2json-bulk-"));
|
|
31492
|
+
}
|
|
31493
|
+
async function execAndParse(binary, args, inputPath, execOpts) {
|
|
31494
|
+
const result = await execCommand(binary, args, execOpts);
|
|
31481
31495
|
if (!result.ok) {
|
|
31482
31496
|
return err(result.error);
|
|
31483
31497
|
}
|
|
31484
31498
|
if (result.value.exitCode !== 0) {
|
|
31485
|
-
return err(createToolError("dcm2json",
|
|
31499
|
+
return err(createToolError("dcm2json", args, result.value.exitCode, result.value.stderr));
|
|
31486
31500
|
}
|
|
31487
31501
|
try {
|
|
31488
31502
|
const repaired = repairJson(result.value.stdout);
|
|
@@ -36856,8 +36870,8 @@ async function moveFile(src, dest) {
|
|
|
36856
36870
|
}
|
|
36857
36871
|
async function statFileSafe(filePath) {
|
|
36858
36872
|
try {
|
|
36859
|
-
const
|
|
36860
|
-
return
|
|
36873
|
+
const stat4 = await fs.stat(filePath);
|
|
36874
|
+
return stat4.size;
|
|
36861
36875
|
} catch {
|
|
36862
36876
|
return 0;
|
|
36863
36877
|
}
|
|
@@ -38268,6 +38282,341 @@ async function batch(items, operation, options) {
|
|
|
38268
38282
|
return { results: state.results, succeeded: state.succeeded, failed: state.failed };
|
|
38269
38283
|
}
|
|
38270
38284
|
|
|
38285
|
+
// src/testing/types.ts
|
|
38286
|
+
var HammerPhase = {
|
|
38287
|
+
/** File generation phase (copy + modify). */
|
|
38288
|
+
GENERATE: "generate",
|
|
38289
|
+
/** File sending phase (dcmsend). */
|
|
38290
|
+
SEND: "send"
|
|
38291
|
+
};
|
|
38292
|
+
|
|
38293
|
+
// src/testing/DicomHammer.ts
|
|
38294
|
+
var DEFAULT_FILE_COUNT = 100;
|
|
38295
|
+
var MAX_FILE_COUNT = 1e5;
|
|
38296
|
+
var DEFAULT_CONCURRENCY2 = 4;
|
|
38297
|
+
var MAX_CONCURRENCY2 = 64;
|
|
38298
|
+
var DEFAULT_CALLING_AE = "HAMMER";
|
|
38299
|
+
var DEFAULT_CALLED_AE = "ANY-SCP";
|
|
38300
|
+
var DICOM_UID_ROOT = "2.25.";
|
|
38301
|
+
var DicomHammerOptionsSchema = z.object({
|
|
38302
|
+
sourceFile: z.string().min(1),
|
|
38303
|
+
host: z.string().min(1),
|
|
38304
|
+
port: z.number().int().min(1).max(65535),
|
|
38305
|
+
callingAETitle: z.string().min(1).max(16).refine(isValidAETitle, { message: "AE Title contains invalid characters" }).optional(),
|
|
38306
|
+
calledAETitle: z.string().min(1).max(16).refine(isValidAETitle, { message: "AE Title contains invalid characters" }).optional(),
|
|
38307
|
+
fileCount: z.number().int().min(1).max(MAX_FILE_COUNT).optional(),
|
|
38308
|
+
concurrency: z.number().int().min(1).max(MAX_CONCURRENCY2).optional(),
|
|
38309
|
+
delayMs: z.number().int().min(0).optional(),
|
|
38310
|
+
institution: z.string().min(1).optional(),
|
|
38311
|
+
erasePrivateTags: z.boolean().optional(),
|
|
38312
|
+
modifications: z.array(z.object({ tag: z.string().min(1), value: z.string() })).optional(),
|
|
38313
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
38314
|
+
signal: z.instanceof(AbortSignal).optional(),
|
|
38315
|
+
outputDir: z.string().min(1).optional(),
|
|
38316
|
+
noHalt: z.boolean().optional()
|
|
38317
|
+
}).strict();
|
|
38318
|
+
function resolveNetworkOptions(options) {
|
|
38319
|
+
return {
|
|
38320
|
+
host: options.host,
|
|
38321
|
+
port: options.port,
|
|
38322
|
+
callingAETitle: options.callingAETitle ?? DEFAULT_CALLING_AE,
|
|
38323
|
+
calledAETitle: options.calledAETitle ?? DEFAULT_CALLED_AE,
|
|
38324
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
38325
|
+
noHalt: options.noHalt ?? true
|
|
38326
|
+
};
|
|
38327
|
+
}
|
|
38328
|
+
function resolveOptions(options) {
|
|
38329
|
+
return {
|
|
38330
|
+
sourceFile: options.sourceFile,
|
|
38331
|
+
...resolveNetworkOptions(options),
|
|
38332
|
+
fileCount: options.fileCount ?? DEFAULT_FILE_COUNT,
|
|
38333
|
+
concurrency: options.concurrency ?? DEFAULT_CONCURRENCY2,
|
|
38334
|
+
delayMs: options.delayMs ?? 0,
|
|
38335
|
+
institution: options.institution,
|
|
38336
|
+
erasePrivateTags: options.erasePrivateTags ?? false,
|
|
38337
|
+
modifications: options.modifications ?? [],
|
|
38338
|
+
signal: options.signal,
|
|
38339
|
+
outputDir: options.outputDir ?? tmpdir()
|
|
38340
|
+
};
|
|
38341
|
+
}
|
|
38342
|
+
function generateUid() {
|
|
38343
|
+
const hex = randomUUID().replace(/-/g, "");
|
|
38344
|
+
const decimal = BigInt("0x" + hex).toString(10);
|
|
38345
|
+
return DICOM_UID_ROOT + decimal;
|
|
38346
|
+
}
|
|
38347
|
+
function formatDate() {
|
|
38348
|
+
const d = /* @__PURE__ */ new Date();
|
|
38349
|
+
const yyyy = String(d.getFullYear());
|
|
38350
|
+
const mm = String(d.getMonth() + 1).padStart(2, "0");
|
|
38351
|
+
const dd = String(d.getDate()).padStart(2, "0");
|
|
38352
|
+
return yyyy + mm + dd;
|
|
38353
|
+
}
|
|
38354
|
+
function buildModifications(index, opts) {
|
|
38355
|
+
const mods = [
|
|
38356
|
+
{ tag: "(0020,000D)", value: generateUid() },
|
|
38357
|
+
{ tag: "(0020,000E)", value: generateUid() },
|
|
38358
|
+
{ tag: "(0008,0018)", value: generateUid() },
|
|
38359
|
+
{ tag: "(0008,0020)", value: formatDate() },
|
|
38360
|
+
{ tag: "(0008,0050)", value: `HAMMER-${String(index + 1).padStart(6, "0")}` }
|
|
38361
|
+
];
|
|
38362
|
+
if (opts.institution !== void 0) {
|
|
38363
|
+
mods.push({ tag: "(0008,0080)", value: opts.institution });
|
|
38364
|
+
}
|
|
38365
|
+
for (const mod of opts.modifications) {
|
|
38366
|
+
mods.push({ tag: mod.tag, value: mod.value });
|
|
38367
|
+
}
|
|
38368
|
+
return mods;
|
|
38369
|
+
}
|
|
38370
|
+
function computeThroughput(succeeded, totalBytes, durationMs) {
|
|
38371
|
+
const durationSec = durationMs / 1e3;
|
|
38372
|
+
return {
|
|
38373
|
+
filesPerSec: durationSec > 0 ? succeeded / durationSec : 0,
|
|
38374
|
+
bytesPerSec: durationSec > 0 ? totalBytes / durationSec : 0
|
|
38375
|
+
};
|
|
38376
|
+
}
|
|
38377
|
+
function delay3(ms) {
|
|
38378
|
+
return new Promise((resolve) => {
|
|
38379
|
+
setTimeout(resolve, ms);
|
|
38380
|
+
});
|
|
38381
|
+
}
|
|
38382
|
+
var DicomHammer = class _DicomHammer extends EventEmitter {
|
|
38383
|
+
constructor(options) {
|
|
38384
|
+
super();
|
|
38385
|
+
__publicField(this, "opts");
|
|
38386
|
+
__publicField(this, "generatedDir");
|
|
38387
|
+
__publicField(this, "generatedFiles", []);
|
|
38388
|
+
this.opts = options;
|
|
38389
|
+
this.setMaxListeners(20);
|
|
38390
|
+
}
|
|
38391
|
+
// -----------------------------------------------------------------------
|
|
38392
|
+
// Factory
|
|
38393
|
+
// -----------------------------------------------------------------------
|
|
38394
|
+
/**
|
|
38395
|
+
* Creates a DicomHammer instance.
|
|
38396
|
+
*
|
|
38397
|
+
* @param options - Configuration for file generation and sending
|
|
38398
|
+
* @returns A Result containing the DicomHammer or a validation error
|
|
38399
|
+
*/
|
|
38400
|
+
static create(options) {
|
|
38401
|
+
const validation = DicomHammerOptionsSchema.safeParse(options);
|
|
38402
|
+
if (!validation.success) {
|
|
38403
|
+
return err(createValidationError("DicomHammer", validation.error));
|
|
38404
|
+
}
|
|
38405
|
+
return ok(new _DicomHammer(resolveOptions(options)));
|
|
38406
|
+
}
|
|
38407
|
+
// -----------------------------------------------------------------------
|
|
38408
|
+
// Generate phase
|
|
38409
|
+
// -----------------------------------------------------------------------
|
|
38410
|
+
/**
|
|
38411
|
+
* Generates modified copies of the source DICOM file.
|
|
38412
|
+
*
|
|
38413
|
+
* Each copy receives unique Study/Series/SOP Instance UIDs, a unique
|
|
38414
|
+
* accession number, and any custom modifications.
|
|
38415
|
+
*/
|
|
38416
|
+
async generate() {
|
|
38417
|
+
const start = Date.now();
|
|
38418
|
+
const dir = join(this.opts.outputDir, `dcmtk-hammer-${Date.now()}`);
|
|
38419
|
+
try {
|
|
38420
|
+
await mkdir(dir, { recursive: true });
|
|
38421
|
+
} catch {
|
|
38422
|
+
return err(new Error(`Failed to create output directory: ${dir}`));
|
|
38423
|
+
}
|
|
38424
|
+
this.generatedDir = dir;
|
|
38425
|
+
const indices = Array.from({ length: this.opts.fileCount }, (_, i) => i);
|
|
38426
|
+
const total = this.opts.fileCount;
|
|
38427
|
+
let completedCount = 0;
|
|
38428
|
+
const result = await batch(
|
|
38429
|
+
indices,
|
|
38430
|
+
async (index) => {
|
|
38431
|
+
return this.generateOneFile(index, dir);
|
|
38432
|
+
},
|
|
38433
|
+
{
|
|
38434
|
+
concurrency: this.opts.concurrency,
|
|
38435
|
+
signal: this.opts.signal,
|
|
38436
|
+
onProgress: (_completed, _total, fileResult) => {
|
|
38437
|
+
completedCount++;
|
|
38438
|
+
if (fileResult.ok) {
|
|
38439
|
+
this.emit("FILE_GENERATED", { index: completedCount - 1, total, filePath: fileResult.value });
|
|
38440
|
+
}
|
|
38441
|
+
this.emitProgress(HammerPhase.GENERATE, completedCount, total);
|
|
38442
|
+
}
|
|
38443
|
+
}
|
|
38444
|
+
);
|
|
38445
|
+
const files = result.results.filter((r) => r.ok).map((r) => r.value);
|
|
38446
|
+
this.generatedFiles = files;
|
|
38447
|
+
if (files.length === 0) {
|
|
38448
|
+
return err(new Error(`All ${total} file generations failed`));
|
|
38449
|
+
}
|
|
38450
|
+
return ok({ files, durationMs: Date.now() - start, outputDir: dir });
|
|
38451
|
+
}
|
|
38452
|
+
/** Generates a single modified copy. Extracted for function size compliance. */
|
|
38453
|
+
async generateOneFile(index, dir) {
|
|
38454
|
+
const padded = String(index + 1).padStart(6, "0");
|
|
38455
|
+
const dest = join(dir, `hammer_${padded}.dcm`);
|
|
38456
|
+
const copyResult = await copyFileSafe(this.opts.sourceFile, dest);
|
|
38457
|
+
if (!copyResult.ok) return err(copyResult.error);
|
|
38458
|
+
const modResult = await dcmodify(dest, {
|
|
38459
|
+
modifications: buildModifications(index, this.opts),
|
|
38460
|
+
erasePrivateTags: this.opts.erasePrivateTags || void 0,
|
|
38461
|
+
insertIfMissing: true,
|
|
38462
|
+
noBackup: true,
|
|
38463
|
+
timeoutMs: this.opts.timeoutMs,
|
|
38464
|
+
signal: this.opts.signal
|
|
38465
|
+
});
|
|
38466
|
+
if (!modResult.ok) return err(modResult.error);
|
|
38467
|
+
return ok(dest);
|
|
38468
|
+
}
|
|
38469
|
+
// -----------------------------------------------------------------------
|
|
38470
|
+
// Send phase
|
|
38471
|
+
// -----------------------------------------------------------------------
|
|
38472
|
+
/**
|
|
38473
|
+
* Sends files to the target SCP.
|
|
38474
|
+
*
|
|
38475
|
+
* @param files - Files to send. Defaults to previously generated files.
|
|
38476
|
+
*/
|
|
38477
|
+
async send(files) {
|
|
38478
|
+
const filesToSend = files ?? this.generatedFiles;
|
|
38479
|
+
if (filesToSend.length === 0) {
|
|
38480
|
+
return err(new Error("No files to send. Call generate() first or provide files."));
|
|
38481
|
+
}
|
|
38482
|
+
const fileSize = await this.getFileSize(filesToSend[0]);
|
|
38483
|
+
const start = Date.now();
|
|
38484
|
+
const total = filesToSend.length;
|
|
38485
|
+
const tracker = { errors: [], completedCount: 0, succeeded: 0 };
|
|
38486
|
+
await batch([...filesToSend], async (file) => this.sendOneFile(file), {
|
|
38487
|
+
concurrency: this.opts.concurrency,
|
|
38488
|
+
signal: this.opts.signal,
|
|
38489
|
+
onProgress: (_c, _t, sendResult) => this.trackSendProgress(sendResult, filesToSend, total, tracker)
|
|
38490
|
+
});
|
|
38491
|
+
return ok(this.buildSendResult(tracker, total, fileSize, Date.now() - start));
|
|
38492
|
+
}
|
|
38493
|
+
/** Tracks a single send result for progress reporting. */
|
|
38494
|
+
trackSendProgress(sendResult, files, total, tracker) {
|
|
38495
|
+
tracker.completedCount++;
|
|
38496
|
+
const file = files[tracker.completedCount - 1];
|
|
38497
|
+
if (sendResult.ok) {
|
|
38498
|
+
tracker.succeeded++;
|
|
38499
|
+
this.emit("SEND_COMPLETE", { index: tracker.completedCount - 1, total, file, durationMs: 0 });
|
|
38500
|
+
} else {
|
|
38501
|
+
tracker.errors.push({ file, error: sendResult.error });
|
|
38502
|
+
this.emit("SEND_FAILED", { index: tracker.completedCount - 1, total, file, error: sendResult.error });
|
|
38503
|
+
}
|
|
38504
|
+
this.emitProgress(HammerPhase.SEND, tracker.completedCount, total);
|
|
38505
|
+
}
|
|
38506
|
+
/** Assembles the final HammerSendResult. */
|
|
38507
|
+
buildSendResult(tracker, total, fileSize, durationMs) {
|
|
38508
|
+
const totalBytes = tracker.succeeded * fileSize;
|
|
38509
|
+
const throughput = computeThroughput(tracker.succeeded, totalBytes, durationMs);
|
|
38510
|
+
return {
|
|
38511
|
+
succeeded: tracker.succeeded,
|
|
38512
|
+
failed: tracker.errors.length,
|
|
38513
|
+
totalFiles: total,
|
|
38514
|
+
durationMs,
|
|
38515
|
+
filesPerSec: throughput.filesPerSec,
|
|
38516
|
+
bytesPerSec: throughput.bytesPerSec,
|
|
38517
|
+
totalBytes,
|
|
38518
|
+
errors: tracker.errors
|
|
38519
|
+
};
|
|
38520
|
+
}
|
|
38521
|
+
/** Sends a single file, with optional delay. */
|
|
38522
|
+
async sendOneFile(file) {
|
|
38523
|
+
if (this.opts.delayMs > 0) {
|
|
38524
|
+
await delay3(this.opts.delayMs);
|
|
38525
|
+
}
|
|
38526
|
+
const result = await dcmsend({
|
|
38527
|
+
host: this.opts.host,
|
|
38528
|
+
port: this.opts.port,
|
|
38529
|
+
files: [file],
|
|
38530
|
+
callingAETitle: this.opts.callingAETitle,
|
|
38531
|
+
calledAETitle: this.opts.calledAETitle,
|
|
38532
|
+
noHalt: this.opts.noHalt || void 0,
|
|
38533
|
+
timeoutMs: this.opts.timeoutMs,
|
|
38534
|
+
signal: this.opts.signal
|
|
38535
|
+
});
|
|
38536
|
+
if (!result.ok) return err(result.error);
|
|
38537
|
+
return ok(void 0);
|
|
38538
|
+
}
|
|
38539
|
+
/** Gets the file size in bytes, returning 0 on error. */
|
|
38540
|
+
async getFileSize(filePath) {
|
|
38541
|
+
try {
|
|
38542
|
+
const s = await stat(filePath);
|
|
38543
|
+
return s.size;
|
|
38544
|
+
} catch {
|
|
38545
|
+
return 0;
|
|
38546
|
+
}
|
|
38547
|
+
}
|
|
38548
|
+
// -----------------------------------------------------------------------
|
|
38549
|
+
// Combined run
|
|
38550
|
+
// -----------------------------------------------------------------------
|
|
38551
|
+
/**
|
|
38552
|
+
* Generates files and sends them in one call.
|
|
38553
|
+
*
|
|
38554
|
+
* @returns Combined result with timing for both phases
|
|
38555
|
+
*/
|
|
38556
|
+
async run() {
|
|
38557
|
+
const genResult = await this.generate();
|
|
38558
|
+
if (!genResult.ok) return err(genResult.error);
|
|
38559
|
+
const sendResult = await this.send(genResult.value.files);
|
|
38560
|
+
if (!sendResult.ok) return err(sendResult.error);
|
|
38561
|
+
const result = {
|
|
38562
|
+
succeeded: sendResult.value.succeeded,
|
|
38563
|
+
failed: sendResult.value.failed,
|
|
38564
|
+
totalFiles: sendResult.value.totalFiles,
|
|
38565
|
+
durationMs: genResult.value.durationMs + sendResult.value.durationMs,
|
|
38566
|
+
generateDurationMs: genResult.value.durationMs,
|
|
38567
|
+
sendDurationMs: sendResult.value.durationMs,
|
|
38568
|
+
filesPerSec: sendResult.value.filesPerSec,
|
|
38569
|
+
bytesPerSec: sendResult.value.bytesPerSec,
|
|
38570
|
+
totalBytes: sendResult.value.totalBytes,
|
|
38571
|
+
errors: sendResult.value.errors
|
|
38572
|
+
};
|
|
38573
|
+
this.emit("RUN_COMPLETE", result);
|
|
38574
|
+
return ok(result);
|
|
38575
|
+
}
|
|
38576
|
+
// -----------------------------------------------------------------------
|
|
38577
|
+
// Cleanup
|
|
38578
|
+
// -----------------------------------------------------------------------
|
|
38579
|
+
/** Removes all generated files and the output directory. */
|
|
38580
|
+
async cleanup() {
|
|
38581
|
+
if (this.generatedDir === void 0) return ok(void 0);
|
|
38582
|
+
try {
|
|
38583
|
+
await rm(this.generatedDir, { recursive: true, force: true });
|
|
38584
|
+
this.generatedDir = void 0;
|
|
38585
|
+
this.generatedFiles = [];
|
|
38586
|
+
return ok(void 0);
|
|
38587
|
+
} catch {
|
|
38588
|
+
return err(new Error(`Failed to cleanup: ${this.generatedDir}`));
|
|
38589
|
+
}
|
|
38590
|
+
}
|
|
38591
|
+
// -----------------------------------------------------------------------
|
|
38592
|
+
// Event helpers
|
|
38593
|
+
// -----------------------------------------------------------------------
|
|
38594
|
+
/** Emits a PROGRESS event. */
|
|
38595
|
+
emitProgress(phase, completed, total) {
|
|
38596
|
+
this.emit("PROGRESS", { phase, completed, total, percent: Math.round(completed / total * 100) });
|
|
38597
|
+
}
|
|
38598
|
+
/** Registers a listener for FILE_GENERATED events. */
|
|
38599
|
+
onFileGenerated(listener) {
|
|
38600
|
+
return this.on("FILE_GENERATED", listener);
|
|
38601
|
+
}
|
|
38602
|
+
/** Registers a listener for SEND_COMPLETE events. */
|
|
38603
|
+
onSendComplete(listener) {
|
|
38604
|
+
return this.on("SEND_COMPLETE", listener);
|
|
38605
|
+
}
|
|
38606
|
+
/** Registers a listener for SEND_FAILED events. */
|
|
38607
|
+
onSendFailed(listener) {
|
|
38608
|
+
return this.on("SEND_FAILED", listener);
|
|
38609
|
+
}
|
|
38610
|
+
/** Registers a listener for PROGRESS events. */
|
|
38611
|
+
onProgress(listener) {
|
|
38612
|
+
return this.on("PROGRESS", listener);
|
|
38613
|
+
}
|
|
38614
|
+
/** Registers a listener for RUN_COMPLETE events. */
|
|
38615
|
+
onRunComplete(listener) {
|
|
38616
|
+
return this.on("RUN_COMPLETE", listener);
|
|
38617
|
+
}
|
|
38618
|
+
};
|
|
38619
|
+
|
|
38271
38620
|
// src/utils/retry.ts
|
|
38272
38621
|
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
38273
38622
|
var DEFAULT_INITIAL_DELAY_MS = 1e3;
|
|
@@ -38342,6 +38691,6 @@ async function retry(operation, options) {
|
|
|
38342
38691
|
return lastResult;
|
|
38343
38692
|
}
|
|
38344
38693
|
|
|
38345
|
-
export { AETitleSchema, AssociationTracker, ChangeSet, ColorConversion, DCMPRSCP_FATAL_EVENTS, DCMPRSCP_PATTERNS, DCMPSRCV_FATAL_EVENTS, DCMPSRCV_PATTERNS, DCMQRSCP_FATAL_EVENTS, DCMQRSCP_PATTERNS, DCMRECV_FATAL_EVENTS, DCMRECV_PATTERNS, DEFAULT_BLOCK_TIMEOUT_MS, DEFAULT_DICOM_PORT, DEFAULT_DRAIN_TIMEOUT_MS, DEFAULT_PARSE_CONCURRENCY, DEFAULT_START_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, Dcm2pnmOutputFormat, Dcm2xmlCharset, DcmQRSCP, DcmdumpFormat, Dcmj2pnmOutputFormat, DcmprsCP, DcmprscpEvent, Dcmpsrcv, DcmpsrcvEvent, DcmqrscpEvent, Dcmrecv, DcmrecvEvent, DcmtkProcess, DicomDataset, DicomInstance, DicomReceiver, DicomSend, DicomSender, DicomTagPathSchema, DicomTagSchema, FilenameMode, GetQueryModel, Img2dcmInputFormat, JplsColorConversion, LineParser, LutType, MAX_BLOCK_LINES, MAX_CHANGESET_OPERATIONS, MAX_EVENT_PATTERNS, MAX_TRAVERSAL_DEPTH, MoveQueryModel, PDU_SIZE, PacsClient, PortSchema, PreferredTransferSyntax, ProcessState, ProposedTransferSyntax, QueryLevel, QueryModel, REQUIRED_BINARIES, RetrieveMode, SOP_CLASSES, STORESCP_FATAL_EVENTS, STORESCP_PATTERNS, SenderHealth, SenderMode, StorageMode, StoreSCP, StoreSCPPreset, StorescpEvent, SubdirectoryMode, TransferSyntax, UIDSchema, UNIX_SEARCH_PATHS, VR, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, WINDOWS_SEARCH_PATHS, WLMSCPFS_FATAL_EVENTS, WLMSCPFS_PATTERNS, Wlmscpfs, WlmscpfsEvent, assertUnreachable, batch, cda2dcm, clearDcmtkPathCache, createAETitle, createDicomFilePath, createDicomTag, createDicomTagPath, createPort, createSOPClassUID, createTransferSyntaxUID, dcm2cda, dcm2json, dcm2pdf, dcm2pnm, dcm2xml, dcmcjpeg, dcmcjpls, dcmconv, dcmcrle, dcmdecap, dcmdjpeg, dcmdjpls, dcmdrle, dcmdspfn, dcmdump, dcmencap, dcmftest, dcmgpdir, dcmj2pnm, dcmmkcrv, dcmmkdir, dcmmklut, dcmodify, dcmp2pgm, dcmprscu, dcmpschk, dcmpsmk, dcmpsprt, dcmqridx, dcmquant, dcmscale, dcmsend, dcod2lum, dconvlum, drtdump, dsr2xml, dsrdump, dump2dcm, echoscu, err, execCommand, findDcmtkPath, findscu, getVRCategory, getscu, img2dcm, isBinaryVR, isNumericVR, isStringVR, json2dcm, lookupTag, lookupTagByKeyword, lookupTagByName, mapResult, movescu, ok, parseAETitle, parseDicomTag, parseDicomTagPath, parsePort, parseSOPClassUID, parseTransferSyntaxUID, pdf2dcm, retry, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, spawnCommand, stl2dcm, storescu, tag, tagPathToSegments, termscu, walkTags, xml2dcm, xml2dsr, xmlToJson };
|
|
38694
|
+
export { AETitleSchema, AssociationTracker, ChangeSet, ColorConversion, DCMPRSCP_FATAL_EVENTS, DCMPRSCP_PATTERNS, DCMPSRCV_FATAL_EVENTS, DCMPSRCV_PATTERNS, DCMQRSCP_FATAL_EVENTS, DCMQRSCP_PATTERNS, DCMRECV_FATAL_EVENTS, DCMRECV_PATTERNS, DEFAULT_BLOCK_TIMEOUT_MS, DEFAULT_DICOM_PORT, DEFAULT_DRAIN_TIMEOUT_MS, DEFAULT_PARSE_CONCURRENCY, DEFAULT_START_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, Dcm2pnmOutputFormat, Dcm2xmlCharset, DcmQRSCP, DcmdumpFormat, Dcmj2pnmOutputFormat, DcmprsCP, DcmprscpEvent, Dcmpsrcv, DcmpsrcvEvent, DcmqrscpEvent, Dcmrecv, DcmrecvEvent, DcmtkProcess, DicomDataset, DicomHammer, DicomInstance, DicomReceiver, DicomSend, DicomSender, DicomTagPathSchema, DicomTagSchema, FilenameMode, GetQueryModel, HammerPhase, Img2dcmInputFormat, JplsColorConversion, LineParser, LutType, MAX_BLOCK_LINES, MAX_CHANGESET_OPERATIONS, MAX_EVENT_PATTERNS, MAX_TRAVERSAL_DEPTH, MoveQueryModel, PDU_SIZE, PacsClient, PortSchema, PreferredTransferSyntax, ProcessState, ProposedTransferSyntax, QueryLevel, QueryModel, REQUIRED_BINARIES, RetrieveMode, SOP_CLASSES, STORESCP_FATAL_EVENTS, STORESCP_PATTERNS, SenderHealth, SenderMode, StorageMode, StoreSCP, StoreSCPPreset, StorescpEvent, SubdirectoryMode, TransferSyntax, UIDSchema, UNIX_SEARCH_PATHS, VR, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, WINDOWS_SEARCH_PATHS, WLMSCPFS_FATAL_EVENTS, WLMSCPFS_PATTERNS, Wlmscpfs, WlmscpfsEvent, assertUnreachable, batch, cda2dcm, clearDcmtkPathCache, createAETitle, createDicomFilePath, createDicomTag, createDicomTagPath, createPort, createSOPClassUID, createTransferSyntaxUID, dcm2cda, dcm2json, dcm2pdf, dcm2pnm, dcm2xml, dcmcjpeg, dcmcjpls, dcmconv, dcmcrle, dcmdecap, dcmdjpeg, dcmdjpls, dcmdrle, dcmdspfn, dcmdump, dcmencap, dcmftest, dcmgpdir, dcmj2pnm, dcmmkcrv, dcmmkdir, dcmmklut, dcmodify, dcmp2pgm, dcmprscu, dcmpschk, dcmpsmk, dcmpsprt, dcmqridx, dcmquant, dcmscale, dcmsend, dcod2lum, dconvlum, drtdump, dsr2xml, dsrdump, dump2dcm, echoscu, err, execCommand, findDcmtkPath, findscu, getVRCategory, getscu, img2dcm, isBinaryVR, isNumericVR, isStringVR, json2dcm, lookupTag, lookupTagByKeyword, lookupTagByName, mapResult, movescu, ok, parseAETitle, parseDicomTag, parseDicomTagPath, parsePort, parseSOPClassUID, parseTransferSyntaxUID, pdf2dcm, retry, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, spawnCommand, stl2dcm, storescu, tag, tagPathToSegments, termscu, walkTags, xml2dcm, xml2dsr, xmlToJson };
|
|
38346
38695
|
//# sourceMappingURL=index.js.map
|
|
38347
38696
|
//# sourceMappingURL=index.js.map
|