@ubercode/dcmtk 0.7.3 → 0.8.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/dist/{DicomInstance-BjrSIEGN.d.ts → DicomInstance-BKUiir0G.d.ts} +8 -3
- package/dist/{DicomInstance-zsmyd7fs.d.cts → DicomInstance-CxLKC-oM.d.cts} +8 -3
- package/dist/dicom.cjs +14 -5
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.d.cts +2 -2
- package/dist/dicom.d.ts +2 -2
- package/dist/dicom.js +14 -5
- package/dist/dicom.js.map +1 -1
- package/dist/{index-AYvUunlI.d.cts → index-B13DmBRs.d.cts} +1 -1
- package/dist/{index-C20fLU5U.d.ts → index-CCgNgve7.d.ts} +1 -1
- package/dist/index.cjs +614 -295
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +201 -60
- package/dist/index.d.ts +201 -60
- package/dist/index.js +614 -296
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +14 -5
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.d.cts +2 -2
- package/dist/servers.d.ts +2 -2
- package/dist/servers.js +14 -5
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +53 -3
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +18 -0
- package/dist/tools.d.ts +18 -0
- package/dist/tools.js +53 -3
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { R as Result, E as ExecOptions, D as DcmtkProcessResult, S as SpawnOptions } from './types-Cgumy1N4.cjs';
|
|
2
2
|
export { L as LineSource, P as ProcessLine, a as ResultValue, b as assertUnreachable, e as err, m as mapResult, o as ok } from './types-Cgumy1N4.cjs';
|
|
3
|
-
import { A as AETitle, D as DicomTag, a as DicomTagPath, P as Port, S as SOPClassUID, T as TransferSyntaxUID, b as DicomDataset } from './DicomInstance-
|
|
4
|
-
export { B as Brand, C as ChangeSet, c as DicomFilePath, d as DicomInstance, W as WalkTagEntry,
|
|
3
|
+
import { A as AETitle, D as DicomTag, a as DicomTagPath, P as Port, S as SOPClassUID, T as TransferSyntaxUID, b as DicomDataset } from './DicomInstance-CxLKC-oM.cjs';
|
|
4
|
+
export { B as Brand, C as ChangeSet, c as DicomFilePath, d as DicomInstance, e as DicomOpenOptions, W as WalkTagEntry, f as WalkTagsOptions, g as createAETitle, h as createDicomFilePath, i as createDicomTag, j as createDicomTagPath, k as createPort, l as createSOPClassUID, m as createTransferSyntaxUID, t as tag, w as walkTags } from './DicomInstance-CxLKC-oM.cjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-
|
|
6
|
+
export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-B13DmBRs.cjs';
|
|
7
7
|
export { b as DcmodifyOptions, c as DcmodifyResult, D as DicomJsonElement, a as DicomJsonModel, T as TagModification, d as ToolBaseOptions, e as dcmodify, x as xmlToJson } from './dcmodify-Cf-RPHF3.cjs';
|
|
8
8
|
export { DictionaryEntry, SOPClassName, SOP_CLASSES, TagSegment, VR, VRCategoryName, VRMetadata, VRValue, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, getVRCategory, isBinaryVR, isNumericVR, isStringVR, lookupTag, lookupTagByKeyword, lookupTagByName, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, tagPathToSegments } from './dicom.cjs';
|
|
9
9
|
import { ProposedTransferSyntaxValue } from './tools.cjs';
|
|
@@ -443,24 +443,10 @@ interface DicomSenderEventMap {
|
|
|
443
443
|
* ```
|
|
444
444
|
*/
|
|
445
445
|
declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
|
|
446
|
-
private readonly
|
|
447
|
-
private readonly mode;
|
|
448
|
-
private readonly configuredMaxAssociations;
|
|
449
|
-
private readonly maxQueueLength;
|
|
446
|
+
private readonly engine;
|
|
450
447
|
private readonly defaultTimeoutMs;
|
|
451
448
|
private readonly defaultMaxRetries;
|
|
452
|
-
private readonly
|
|
453
|
-
private readonly bucketFlushMs;
|
|
454
|
-
private readonly maxBucketSize;
|
|
455
|
-
private readonly queue;
|
|
456
|
-
private activeAssociations;
|
|
457
|
-
private isStopped;
|
|
458
|
-
private health;
|
|
459
|
-
private effectiveMaxAssociations;
|
|
460
|
-
private consecutiveFailures;
|
|
461
|
-
private consecutiveSuccesses;
|
|
462
|
-
private currentBucket;
|
|
463
|
-
private bucketTimer;
|
|
449
|
+
private readonly signal;
|
|
464
450
|
private abortHandler;
|
|
465
451
|
private constructor();
|
|
466
452
|
/**
|
|
@@ -486,10 +472,6 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
|
|
|
486
472
|
* @returns A Result containing the send result or an error
|
|
487
473
|
*/
|
|
488
474
|
send(files: readonly string[], options?: SendOptions): Promise<Result<SendResult>>;
|
|
489
|
-
/** Builds SendParams from per-send options, applying instance defaults. */
|
|
490
|
-
private buildSendParams;
|
|
491
|
-
/** Dispatches a send to the appropriate mode handler. */
|
|
492
|
-
private dispatchSend;
|
|
493
475
|
/**
|
|
494
476
|
* Flushes the current bucket immediately (bucket mode only).
|
|
495
477
|
* In single/multiple mode this is a no-op.
|
|
@@ -538,42 +520,201 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
|
|
|
538
520
|
* @returns this for chaining
|
|
539
521
|
*/
|
|
540
522
|
onBucketFlushed(listener: (data: SenderBucketFlushedData) => void): this;
|
|
541
|
-
/**
|
|
542
|
-
private
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
|
|
523
|
+
/** Wires an AbortSignal to stop the sender. */
|
|
524
|
+
private wireAbortSignal;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* High-throughput DICOM sender using the dcmsend binary.
|
|
529
|
+
*
|
|
530
|
+
* Similar interface to {@link DicomSender} but wraps `dcmsend` instead of
|
|
531
|
+
* `storescu`. `dcmsend` automatically proposes each file's native transfer
|
|
532
|
+
* syntax, avoiding the need for codec licenses when sending compressed data.
|
|
533
|
+
*
|
|
534
|
+
* @module senders/DicomSend
|
|
535
|
+
*/
|
|
536
|
+
|
|
537
|
+
/** Options for creating a DicomSend instance. */
|
|
538
|
+
interface DicomSendOptions {
|
|
539
|
+
/** Remote host or IP address (required). */
|
|
540
|
+
readonly host: string;
|
|
541
|
+
/** Remote port number, 1-65535 (required). */
|
|
542
|
+
readonly port: number;
|
|
543
|
+
/** Called AE Title of the remote SCP (max 16 chars). */
|
|
544
|
+
readonly calledAETitle?: string | undefined;
|
|
545
|
+
/** Calling AE Title of the local SCU (max 16 chars). */
|
|
546
|
+
readonly callingAETitle?: string | undefined;
|
|
547
|
+
/** Sending mode. Defaults to 'multiple'. */
|
|
548
|
+
readonly mode?: 'single' | 'multiple' | 'bucket' | undefined;
|
|
549
|
+
/** Maximum concurrent dcmsend calls. Defaults to 4 (forced to 1 in single mode). */
|
|
550
|
+
readonly maxAssociations?: number | undefined;
|
|
551
|
+
/** Maximum queued send requests before rejecting. Defaults to 1000. */
|
|
552
|
+
readonly maxQueueLength?: number | undefined;
|
|
553
|
+
/** Per-dcmsend timeout in milliseconds. Defaults to 30000. */
|
|
554
|
+
readonly timeoutMs?: number | undefined;
|
|
555
|
+
/** Maximum retry attempts per send (0 = no retry). Defaults to 3. */
|
|
556
|
+
readonly maxRetries?: number | undefined;
|
|
557
|
+
/** Base retry delay in milliseconds. Defaults to 1000. */
|
|
558
|
+
readonly retryDelayMs?: number | undefined;
|
|
559
|
+
/** Bucket flush timeout in milliseconds (bucket mode only). Defaults to 5000. */
|
|
560
|
+
readonly bucketFlushMs?: number | undefined;
|
|
561
|
+
/** Maximum files per bucket before auto-flush (bucket mode only). Defaults to 50. */
|
|
562
|
+
readonly maxBucketSize?: number | undefined;
|
|
563
|
+
/** Maximum PDU receive size (4096-131072). Maps to `--max-pdu`. */
|
|
564
|
+
readonly maxPduReceive?: number | undefined;
|
|
565
|
+
/** Maximum PDU send size (4096-131072). Maps to `--max-send-pdu`. */
|
|
566
|
+
readonly maxPduSend?: number | undefined;
|
|
567
|
+
/** Association timeout in seconds. Maps to `-to`. */
|
|
568
|
+
readonly associationTimeout?: number | undefined;
|
|
569
|
+
/** ACSE timeout in seconds. Maps to `-ta`. */
|
|
570
|
+
readonly acseTimeout?: number | undefined;
|
|
571
|
+
/** DIMSE timeout in seconds. Maps to `-td`. */
|
|
572
|
+
readonly dimseTimeout?: number | undefined;
|
|
573
|
+
/** Disable DNS hostname lookup. Maps to `-nh`. */
|
|
574
|
+
readonly noHostnameLookup?: boolean | undefined;
|
|
575
|
+
/** Verbosity level. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
|
|
576
|
+
readonly verbosity?: 'verbose' | 'debug' | undefined;
|
|
577
|
+
/** Do not halt on first invalid input file. Maps to `--no-halt`. */
|
|
578
|
+
readonly noHalt?: boolean | undefined;
|
|
579
|
+
/** Do not propose illegal presentation contexts. Maps to `--no-illegal-proposal`. */
|
|
580
|
+
readonly noIllegalProposal?: boolean | undefined;
|
|
581
|
+
/** Decompression mode. Maps to `--decompress-never`/`--decompress-lossless`/`--decompress-lossy`. */
|
|
582
|
+
readonly decompress?: 'never' | 'lossless' | 'lossy' | undefined;
|
|
583
|
+
/** Use multiple associations (one after the other). `true` maps to `+ma`, `false` maps to `-ma`. */
|
|
584
|
+
readonly multiAssociations?: boolean | undefined;
|
|
585
|
+
/** Disable UID validity checking. Maps to `--no-uid-checks`. */
|
|
586
|
+
readonly noUidChecks?: boolean | undefined;
|
|
587
|
+
/** AbortSignal for external cancellation. */
|
|
588
|
+
readonly signal?: AbortSignal | undefined;
|
|
589
|
+
}
|
|
590
|
+
/** Per-send options for DicomSend. */
|
|
591
|
+
interface DcmsendSendOptions {
|
|
592
|
+
/** Override per-dcmsend timeout for this send. */
|
|
593
|
+
readonly timeoutMs?: number | undefined;
|
|
594
|
+
/** Override max retries for this send. */
|
|
595
|
+
readonly maxRetries?: number | undefined;
|
|
596
|
+
/** Override called AE Title for this send. */
|
|
597
|
+
readonly calledAETitle?: string | undefined;
|
|
598
|
+
/** Override calling AE Title for this send. */
|
|
599
|
+
readonly callingAETitle?: string | undefined;
|
|
600
|
+
}
|
|
601
|
+
/** Typed event map for DicomSend. */
|
|
602
|
+
interface DicomSendEventMap {
|
|
603
|
+
SEND_COMPLETE: [SenderSendCompleteData];
|
|
604
|
+
SEND_FAILED: [SenderSendFailedData];
|
|
605
|
+
HEALTH_CHANGED: [SenderHealthChangedData];
|
|
606
|
+
BUCKET_FLUSHED: [SenderBucketFlushedData];
|
|
607
|
+
error: [{
|
|
608
|
+
readonly error: Error;
|
|
609
|
+
readonly files?: readonly string[] | undefined;
|
|
610
|
+
}];
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* High-throughput DICOM sender wrapping the `dcmsend` binary.
|
|
614
|
+
*
|
|
615
|
+
* Unlike {@link DicomSender} (which uses `storescu`), `DicomSend` uses
|
|
616
|
+
* `dcmsend` which automatically proposes each file's native transfer
|
|
617
|
+
* syntax. This avoids the need for commercial codec licenses when
|
|
618
|
+
* sending compressed DICOM data (e.g., JPEG 2000).
|
|
619
|
+
*
|
|
620
|
+
* Supports the same three sending modes as DicomSender:
|
|
621
|
+
* - **single**: One association at a time (FIFO queue).
|
|
622
|
+
* - **multiple**: Up to N concurrent associations.
|
|
623
|
+
* - **bucket**: Accumulates files into buckets, each flushed as one association.
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* ```ts
|
|
627
|
+
* const result = DicomSend.create({
|
|
628
|
+
* host: '192.168.1.100',
|
|
629
|
+
* port: 104,
|
|
630
|
+
* calledAETitle: 'PACS',
|
|
631
|
+
* mode: 'multiple',
|
|
632
|
+
* maxAssociations: 8,
|
|
633
|
+
* });
|
|
634
|
+
* if (!result.ok) { console.error(result.error.message); return; }
|
|
635
|
+
* const sender = result.value;
|
|
636
|
+
*
|
|
637
|
+
* sender.onSendComplete(data => console.log('Sent:', data.fileCount, 'files'));
|
|
638
|
+
* sender.onSendFailed(data => console.error('Failed:', data.error.message));
|
|
639
|
+
*
|
|
640
|
+
* await sender.send(['/path/to/file1.dcm', '/path/to/file2.dcm']);
|
|
641
|
+
* await sender.stop();
|
|
642
|
+
* ```
|
|
643
|
+
*/
|
|
644
|
+
declare class DicomSend extends EventEmitter<DicomSendEventMap> {
|
|
645
|
+
private readonly engine;
|
|
646
|
+
private readonly defaultTimeoutMs;
|
|
647
|
+
private readonly defaultMaxRetries;
|
|
648
|
+
private readonly signal;
|
|
649
|
+
private abortHandler;
|
|
650
|
+
private constructor();
|
|
651
|
+
/**
|
|
652
|
+
* Creates a new DicomSend instance.
|
|
653
|
+
*
|
|
654
|
+
* @param options - Configuration options
|
|
655
|
+
* @returns A Result containing the instance or a validation error
|
|
656
|
+
*/
|
|
657
|
+
static create(options: DicomSendOptions): Result<DicomSend>;
|
|
658
|
+
/**
|
|
659
|
+
* Sends one or more DICOM files to the remote endpoint.
|
|
660
|
+
*
|
|
661
|
+
* In single/multiple mode, files are sent as one dcmsend call.
|
|
662
|
+
* In bucket mode, files are accumulated into a bucket and flushed
|
|
663
|
+
* when the bucket reaches maxBucketSize or the flush timer fires.
|
|
664
|
+
*
|
|
665
|
+
* @param files - One or more DICOM file paths
|
|
666
|
+
* @param options - Per-send overrides
|
|
667
|
+
* @returns A Result containing the send result or an error
|
|
668
|
+
*/
|
|
669
|
+
send(files: readonly string[], options?: DcmsendSendOptions): Promise<Result<SendResult>>;
|
|
670
|
+
/**
|
|
671
|
+
* Flushes the current bucket immediately (bucket mode only).
|
|
672
|
+
* In single/multiple mode this is a no-op.
|
|
673
|
+
*/
|
|
674
|
+
flush(): void;
|
|
675
|
+
/**
|
|
676
|
+
* Gracefully stops the sender. Rejects all queued items and
|
|
677
|
+
* waits for active associations to complete.
|
|
678
|
+
*/
|
|
679
|
+
stop(): Promise<void>;
|
|
680
|
+
/** Current sender status. */
|
|
681
|
+
get status(): SenderStatus;
|
|
682
|
+
/**
|
|
683
|
+
* Registers a typed listener for a DicomSend-specific event.
|
|
684
|
+
*
|
|
685
|
+
* @param event - The event name from DicomSendEventMap
|
|
686
|
+
* @param listener - Callback receiving typed event data
|
|
687
|
+
* @returns this for chaining
|
|
688
|
+
*/
|
|
689
|
+
onEvent<K extends keyof DicomSendEventMap>(event: K, listener: (...args: DicomSendEventMap[K]) => void): this;
|
|
690
|
+
/**
|
|
691
|
+
* Registers a listener for successful sends.
|
|
692
|
+
*
|
|
693
|
+
* @param listener - Callback receiving send complete data
|
|
694
|
+
* @returns this for chaining
|
|
695
|
+
*/
|
|
696
|
+
onSendComplete(listener: (data: SenderSendCompleteData) => void): this;
|
|
697
|
+
/**
|
|
698
|
+
* Registers a listener for failed sends.
|
|
699
|
+
*
|
|
700
|
+
* @param listener - Callback receiving send failed data
|
|
701
|
+
* @returns this for chaining
|
|
702
|
+
*/
|
|
703
|
+
onSendFailed(listener: (data: SenderSendFailedData) => void): this;
|
|
704
|
+
/**
|
|
705
|
+
* Registers a listener for health state changes.
|
|
706
|
+
*
|
|
707
|
+
* @param listener - Callback receiving health change data
|
|
708
|
+
* @returns this for chaining
|
|
709
|
+
*/
|
|
710
|
+
onHealthChanged(listener: (data: SenderHealthChangedData) => void): this;
|
|
711
|
+
/**
|
|
712
|
+
* Registers a listener for bucket flushes (bucket mode only).
|
|
713
|
+
*
|
|
714
|
+
* @param listener - Callback receiving bucket flush data
|
|
715
|
+
* @returns this for chaining
|
|
716
|
+
*/
|
|
717
|
+
onBucketFlushed(listener: (data: SenderBucketFlushedData) => void): this;
|
|
577
718
|
/** Wires an AbortSignal to stop the sender. */
|
|
578
719
|
private wireAbortSignal;
|
|
579
720
|
}
|
|
@@ -873,4 +1014,4 @@ declare class PacsClient {
|
|
|
873
1014
|
private executeCMove;
|
|
874
1015
|
}
|
|
875
1016
|
|
|
876
|
-
export { AETitle, AETitleSchema, DEFAULT_BLOCK_TIMEOUT_MS, DEFAULT_DICOM_PORT, DEFAULT_DRAIN_TIMEOUT_MS, DEFAULT_PARSE_CONCURRENCY, DEFAULT_START_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, DcmtkProcessResult, DicomDataset, DicomSender, type DicomSenderEventMap, type DicomSenderOptions, DicomTag, DicomTagPath, DicomTagPathSchema, DicomTagSchema, ExecOptions, type FindDcmtkPathOptions, type ImageFilter, MAX_BLOCK_LINES, MAX_CHANGESET_OPERATIONS, MAX_EVENT_PATTERNS, MAX_TRAVERSAL_DEPTH, PDU_SIZE, PacsClient, type PacsClientConfig, type PacsEchoOptions, type PacsEchoResult, type PacsMethodOptions, type PacsQueryOptions, type PacsQueryResult, type PacsRetrieveOptions, type PacsRetrieveResult, type PacsStoreOptions, type PacsStoreResult, Port, PortSchema, ProposedTransferSyntaxValue, QueryLevel, type QueryLevelValue, REQUIRED_BINARIES, Result, RetrieveMode, type RetrieveModeValue, SOPClassUID, type SendOptions, type SendResult, type SenderBucketFlushedData, type SenderErrorData, SenderHealth, type SenderHealthChangedData, type SenderHealthValue, SenderMode, type SenderModeValue, type SenderSendCompleteData, type SenderSendFailedData, type SenderStatus, type SeriesFilter, SpawnOptions, type StudyFilter, TransferSyntaxUID, UIDSchema, UNIX_SEARCH_PATHS, WINDOWS_SEARCH_PATHS, type WorklistFilter, clearDcmtkPathCache, execCommand, findDcmtkPath, parseAETitle, parseDicomTag, parseDicomTagPath, parsePort, parseSOPClassUID, parseTransferSyntaxUID, spawnCommand };
|
|
1017
|
+
export { AETitle, AETitleSchema, DEFAULT_BLOCK_TIMEOUT_MS, DEFAULT_DICOM_PORT, DEFAULT_DRAIN_TIMEOUT_MS, DEFAULT_PARSE_CONCURRENCY, DEFAULT_START_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, type DcmsendSendOptions, DcmtkProcessResult, DicomDataset, DicomSend, type DicomSendEventMap, type DicomSendOptions, DicomSender, type DicomSenderEventMap, type DicomSenderOptions, DicomTag, DicomTagPath, DicomTagPathSchema, DicomTagSchema, ExecOptions, type FindDcmtkPathOptions, type ImageFilter, MAX_BLOCK_LINES, MAX_CHANGESET_OPERATIONS, MAX_EVENT_PATTERNS, MAX_TRAVERSAL_DEPTH, PDU_SIZE, PacsClient, type PacsClientConfig, type PacsEchoOptions, type PacsEchoResult, type PacsMethodOptions, type PacsQueryOptions, type PacsQueryResult, type PacsRetrieveOptions, type PacsRetrieveResult, type PacsStoreOptions, type PacsStoreResult, Port, PortSchema, ProposedTransferSyntaxValue, QueryLevel, type QueryLevelValue, REQUIRED_BINARIES, Result, RetrieveMode, type RetrieveModeValue, SOPClassUID, type SendOptions, type SendResult, type SenderBucketFlushedData, type SenderErrorData, SenderHealth, type SenderHealthChangedData, type SenderHealthValue, SenderMode, type SenderModeValue, type SenderSendCompleteData, type SenderSendFailedData, type SenderStatus, type SeriesFilter, SpawnOptions, type StudyFilter, TransferSyntaxUID, UIDSchema, UNIX_SEARCH_PATHS, WINDOWS_SEARCH_PATHS, type WorklistFilter, clearDcmtkPathCache, execCommand, findDcmtkPath, parseAETitle, parseDicomTag, parseDicomTagPath, parsePort, parseSOPClassUID, parseTransferSyntaxUID, spawnCommand };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { R as Result, E as ExecOptions, D as DcmtkProcessResult, S as SpawnOptions } from './types-Cgumy1N4.js';
|
|
2
2
|
export { L as LineSource, P as ProcessLine, a as ResultValue, b as assertUnreachable, e as err, m as mapResult, o as ok } from './types-Cgumy1N4.js';
|
|
3
|
-
import { A as AETitle, D as DicomTag, a as DicomTagPath, P as Port, S as SOPClassUID, T as TransferSyntaxUID, b as DicomDataset } from './DicomInstance-
|
|
4
|
-
export { B as Brand, C as ChangeSet, c as DicomFilePath, d as DicomInstance, W as WalkTagEntry,
|
|
3
|
+
import { A as AETitle, D as DicomTag, a as DicomTagPath, P as Port, S as SOPClassUID, T as TransferSyntaxUID, b as DicomDataset } from './DicomInstance-BKUiir0G.js';
|
|
4
|
+
export { B as Brand, C as ChangeSet, c as DicomFilePath, d as DicomInstance, e as DicomOpenOptions, W as WalkTagEntry, f as WalkTagsOptions, g as createAETitle, h as createDicomFilePath, i as createDicomTag, j as createDicomTagPath, k as createPort, l as createSOPClassUID, m as createTransferSyntaxUID, t as tag, w as walkTags } from './DicomInstance-BKUiir0G.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-
|
|
6
|
+
export { A as AssociationAcknowledgedData, a as AssociationCompleteData, b as AssociationContext, c as AssociationReceivedData, d as AssociationSummary, e as AssociationTracker, C as CStoreRequestData, f as CannotStartListenerData, g as ConfigErrorData, D as DCMPRSCP_FATAL_EVENTS, h as DCMPRSCP_PATTERNS, i as DCMPSRCV_FATAL_EVENTS, j as DCMPSRCV_PATTERNS, k as DCMQRSCP_FATAL_EVENTS, l as DCMQRSCP_PATTERNS, m as DCMRECV_FATAL_EVENTS, n as DCMRECV_PATTERNS, o as DatabaseReadyData, p as DcmQRSCP, q as DcmQRSCPEventMap, r as DcmQRSCPOptions, s as DcmprsCP, t as DcmprsCPEventMap, u as DcmprsCPOptions, v as DcmprscpEvent, w as DcmprscpEventValue, x as Dcmpsrcv, y as DcmpsrcvEvent, z as DcmpsrcvEventMap, B as DcmpsrcvEventValue, E as DcmpsrcvOptions, F as DcmqrscpEvent, G as DcmqrscpEventValue, H as Dcmrecv, I as DcmrecvEvent, J as DcmrecvEventMap, K as DcmrecvEventValue, L as DcmrecvOptions, M as DcmtkProcess, N as DcmtkProcessConfig, O as DcmtkProcessEventMap, P as DicomReceiver, Q as DicomReceiverEventMap, R as DicomReceiverOptions, S as EventPattern, T as FileDeletedData, U as FileReceivedData, V as FilenameMode, W as FilenameModeValue, X as LineParser, Y as LineParserEventMap, Z as MultiLineConfig, _ as PoolAssociationReceivedData, $ as PoolCStoreRequestData, a0 as PoolEchoRequestData, a1 as PoolRefusingAssociationData, a2 as PoolStatus, a3 as PreferredTransferSyntax, a4 as PreferredTransferSyntaxValue, a5 as PrintAssociationAcknowledgedData, a6 as PrintAssociationReceivedData, a7 as PrintCannotStartListenerData, a8 as ProcessState, a9 as ProcessStateValue, aa as QRAssociationAcknowledgedData, ab as QRAssociationReceivedData, ac as QRCFindRequestData, ad as QRCGetRequestData, ae as QRCMoveRequestData, af as QRCStoreRequestData, ag as QRCannotStartListenerData, ah as QRListeningData, ai as ReceiverAssociationAcknowledgedData, aj as ReceiverAssociationData, ak as ReceiverAssociationReceivedData, al as ReceiverCStoreRequestData, am as ReceiverCannotStartListenerData, an as ReceiverConfigErrorData, ao as ReceiverDatabaseReadyData, ap as ReceiverEchoRequestData, aq as ReceiverErrorData, ar as ReceiverFileData, as as ReceiverListeningData, at as RefusingAssociationData, au as STORESCP_FATAL_EVENTS, av as STORESCP_PATTERNS, aw as StorageMode, ax as StorageModeValue, ay as StoreSCP, az as StoreSCPEventMap, aA as StoreSCPOptions, aB as StoreSCPPreset, aC as StoreSCPPresetName, aD as StoredFileData, aE as StorescpEvent, aF as StorescpEventValue, aG as StoringFileData, aH as SubdirectoryCreatedData, aI as SubdirectoryMode, aJ as SubdirectoryModeValue, aK as TrackedFile, aL as WLMSCPFS_FATAL_EVENTS, aM as WLMSCPFS_PATTERNS, aN as WlmAssociationAcknowledgedData, aO as WlmAssociationReceivedData, aP as WlmCFindRequestData, aQ as WlmCannotStartListenerData, aR as WlmListeningData, aS as Wlmscpfs, aT as WlmscpfsEvent, aU as WlmscpfsEventMap, aV as WlmscpfsEventValue, aW as WlmscpfsOptions } from './index-CCgNgve7.js';
|
|
7
7
|
export { b as DcmodifyOptions, c as DcmodifyResult, D as DicomJsonElement, a as DicomJsonModel, T as TagModification, d as ToolBaseOptions, e as dcmodify, x as xmlToJson } from './dcmodify-CHvwChFu.js';
|
|
8
8
|
export { DictionaryEntry, SOPClassName, SOP_CLASSES, TagSegment, VR, VRCategoryName, VRMetadata, VRValue, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, getVRCategory, isBinaryVR, isNumericVR, isStringVR, lookupTag, lookupTagByKeyword, lookupTagByName, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, tagPathToSegments } from './dicom.js';
|
|
9
9
|
import { ProposedTransferSyntaxValue } from './tools.js';
|
|
@@ -443,24 +443,10 @@ interface DicomSenderEventMap {
|
|
|
443
443
|
* ```
|
|
444
444
|
*/
|
|
445
445
|
declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
|
|
446
|
-
private readonly
|
|
447
|
-
private readonly mode;
|
|
448
|
-
private readonly configuredMaxAssociations;
|
|
449
|
-
private readonly maxQueueLength;
|
|
446
|
+
private readonly engine;
|
|
450
447
|
private readonly defaultTimeoutMs;
|
|
451
448
|
private readonly defaultMaxRetries;
|
|
452
|
-
private readonly
|
|
453
|
-
private readonly bucketFlushMs;
|
|
454
|
-
private readonly maxBucketSize;
|
|
455
|
-
private readonly queue;
|
|
456
|
-
private activeAssociations;
|
|
457
|
-
private isStopped;
|
|
458
|
-
private health;
|
|
459
|
-
private effectiveMaxAssociations;
|
|
460
|
-
private consecutiveFailures;
|
|
461
|
-
private consecutiveSuccesses;
|
|
462
|
-
private currentBucket;
|
|
463
|
-
private bucketTimer;
|
|
449
|
+
private readonly signal;
|
|
464
450
|
private abortHandler;
|
|
465
451
|
private constructor();
|
|
466
452
|
/**
|
|
@@ -486,10 +472,6 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
|
|
|
486
472
|
* @returns A Result containing the send result or an error
|
|
487
473
|
*/
|
|
488
474
|
send(files: readonly string[], options?: SendOptions): Promise<Result<SendResult>>;
|
|
489
|
-
/** Builds SendParams from per-send options, applying instance defaults. */
|
|
490
|
-
private buildSendParams;
|
|
491
|
-
/** Dispatches a send to the appropriate mode handler. */
|
|
492
|
-
private dispatchSend;
|
|
493
475
|
/**
|
|
494
476
|
* Flushes the current bucket immediately (bucket mode only).
|
|
495
477
|
* In single/multiple mode this is a no-op.
|
|
@@ -538,42 +520,201 @@ declare class DicomSender extends EventEmitter<DicomSenderEventMap> {
|
|
|
538
520
|
* @returns this for chaining
|
|
539
521
|
*/
|
|
540
522
|
onBucketFlushed(listener: (data: SenderBucketFlushedData) => void): this;
|
|
541
|
-
/**
|
|
542
|
-
private
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
|
|
523
|
+
/** Wires an AbortSignal to stop the sender. */
|
|
524
|
+
private wireAbortSignal;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* High-throughput DICOM sender using the dcmsend binary.
|
|
529
|
+
*
|
|
530
|
+
* Similar interface to {@link DicomSender} but wraps `dcmsend` instead of
|
|
531
|
+
* `storescu`. `dcmsend` automatically proposes each file's native transfer
|
|
532
|
+
* syntax, avoiding the need for codec licenses when sending compressed data.
|
|
533
|
+
*
|
|
534
|
+
* @module senders/DicomSend
|
|
535
|
+
*/
|
|
536
|
+
|
|
537
|
+
/** Options for creating a DicomSend instance. */
|
|
538
|
+
interface DicomSendOptions {
|
|
539
|
+
/** Remote host or IP address (required). */
|
|
540
|
+
readonly host: string;
|
|
541
|
+
/** Remote port number, 1-65535 (required). */
|
|
542
|
+
readonly port: number;
|
|
543
|
+
/** Called AE Title of the remote SCP (max 16 chars). */
|
|
544
|
+
readonly calledAETitle?: string | undefined;
|
|
545
|
+
/** Calling AE Title of the local SCU (max 16 chars). */
|
|
546
|
+
readonly callingAETitle?: string | undefined;
|
|
547
|
+
/** Sending mode. Defaults to 'multiple'. */
|
|
548
|
+
readonly mode?: 'single' | 'multiple' | 'bucket' | undefined;
|
|
549
|
+
/** Maximum concurrent dcmsend calls. Defaults to 4 (forced to 1 in single mode). */
|
|
550
|
+
readonly maxAssociations?: number | undefined;
|
|
551
|
+
/** Maximum queued send requests before rejecting. Defaults to 1000. */
|
|
552
|
+
readonly maxQueueLength?: number | undefined;
|
|
553
|
+
/** Per-dcmsend timeout in milliseconds. Defaults to 30000. */
|
|
554
|
+
readonly timeoutMs?: number | undefined;
|
|
555
|
+
/** Maximum retry attempts per send (0 = no retry). Defaults to 3. */
|
|
556
|
+
readonly maxRetries?: number | undefined;
|
|
557
|
+
/** Base retry delay in milliseconds. Defaults to 1000. */
|
|
558
|
+
readonly retryDelayMs?: number | undefined;
|
|
559
|
+
/** Bucket flush timeout in milliseconds (bucket mode only). Defaults to 5000. */
|
|
560
|
+
readonly bucketFlushMs?: number | undefined;
|
|
561
|
+
/** Maximum files per bucket before auto-flush (bucket mode only). Defaults to 50. */
|
|
562
|
+
readonly maxBucketSize?: number | undefined;
|
|
563
|
+
/** Maximum PDU receive size (4096-131072). Maps to `--max-pdu`. */
|
|
564
|
+
readonly maxPduReceive?: number | undefined;
|
|
565
|
+
/** Maximum PDU send size (4096-131072). Maps to `--max-send-pdu`. */
|
|
566
|
+
readonly maxPduSend?: number | undefined;
|
|
567
|
+
/** Association timeout in seconds. Maps to `-to`. */
|
|
568
|
+
readonly associationTimeout?: number | undefined;
|
|
569
|
+
/** ACSE timeout in seconds. Maps to `-ta`. */
|
|
570
|
+
readonly acseTimeout?: number | undefined;
|
|
571
|
+
/** DIMSE timeout in seconds. Maps to `-td`. */
|
|
572
|
+
readonly dimseTimeout?: number | undefined;
|
|
573
|
+
/** Disable DNS hostname lookup. Maps to `-nh`. */
|
|
574
|
+
readonly noHostnameLookup?: boolean | undefined;
|
|
575
|
+
/** Verbosity level. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
|
|
576
|
+
readonly verbosity?: 'verbose' | 'debug' | undefined;
|
|
577
|
+
/** Do not halt on first invalid input file. Maps to `--no-halt`. */
|
|
578
|
+
readonly noHalt?: boolean | undefined;
|
|
579
|
+
/** Do not propose illegal presentation contexts. Maps to `--no-illegal-proposal`. */
|
|
580
|
+
readonly noIllegalProposal?: boolean | undefined;
|
|
581
|
+
/** Decompression mode. Maps to `--decompress-never`/`--decompress-lossless`/`--decompress-lossy`. */
|
|
582
|
+
readonly decompress?: 'never' | 'lossless' | 'lossy' | undefined;
|
|
583
|
+
/** Use multiple associations (one after the other). `true` maps to `+ma`, `false` maps to `-ma`. */
|
|
584
|
+
readonly multiAssociations?: boolean | undefined;
|
|
585
|
+
/** Disable UID validity checking. Maps to `--no-uid-checks`. */
|
|
586
|
+
readonly noUidChecks?: boolean | undefined;
|
|
587
|
+
/** AbortSignal for external cancellation. */
|
|
588
|
+
readonly signal?: AbortSignal | undefined;
|
|
589
|
+
}
|
|
590
|
+
/** Per-send options for DicomSend. */
|
|
591
|
+
interface DcmsendSendOptions {
|
|
592
|
+
/** Override per-dcmsend timeout for this send. */
|
|
593
|
+
readonly timeoutMs?: number | undefined;
|
|
594
|
+
/** Override max retries for this send. */
|
|
595
|
+
readonly maxRetries?: number | undefined;
|
|
596
|
+
/** Override called AE Title for this send. */
|
|
597
|
+
readonly calledAETitle?: string | undefined;
|
|
598
|
+
/** Override calling AE Title for this send. */
|
|
599
|
+
readonly callingAETitle?: string | undefined;
|
|
600
|
+
}
|
|
601
|
+
/** Typed event map for DicomSend. */
|
|
602
|
+
interface DicomSendEventMap {
|
|
603
|
+
SEND_COMPLETE: [SenderSendCompleteData];
|
|
604
|
+
SEND_FAILED: [SenderSendFailedData];
|
|
605
|
+
HEALTH_CHANGED: [SenderHealthChangedData];
|
|
606
|
+
BUCKET_FLUSHED: [SenderBucketFlushedData];
|
|
607
|
+
error: [{
|
|
608
|
+
readonly error: Error;
|
|
609
|
+
readonly files?: readonly string[] | undefined;
|
|
610
|
+
}];
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* High-throughput DICOM sender wrapping the `dcmsend` binary.
|
|
614
|
+
*
|
|
615
|
+
* Unlike {@link DicomSender} (which uses `storescu`), `DicomSend` uses
|
|
616
|
+
* `dcmsend` which automatically proposes each file's native transfer
|
|
617
|
+
* syntax. This avoids the need for commercial codec licenses when
|
|
618
|
+
* sending compressed DICOM data (e.g., JPEG 2000).
|
|
619
|
+
*
|
|
620
|
+
* Supports the same three sending modes as DicomSender:
|
|
621
|
+
* - **single**: One association at a time (FIFO queue).
|
|
622
|
+
* - **multiple**: Up to N concurrent associations.
|
|
623
|
+
* - **bucket**: Accumulates files into buckets, each flushed as one association.
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* ```ts
|
|
627
|
+
* const result = DicomSend.create({
|
|
628
|
+
* host: '192.168.1.100',
|
|
629
|
+
* port: 104,
|
|
630
|
+
* calledAETitle: 'PACS',
|
|
631
|
+
* mode: 'multiple',
|
|
632
|
+
* maxAssociations: 8,
|
|
633
|
+
* });
|
|
634
|
+
* if (!result.ok) { console.error(result.error.message); return; }
|
|
635
|
+
* const sender = result.value;
|
|
636
|
+
*
|
|
637
|
+
* sender.onSendComplete(data => console.log('Sent:', data.fileCount, 'files'));
|
|
638
|
+
* sender.onSendFailed(data => console.error('Failed:', data.error.message));
|
|
639
|
+
*
|
|
640
|
+
* await sender.send(['/path/to/file1.dcm', '/path/to/file2.dcm']);
|
|
641
|
+
* await sender.stop();
|
|
642
|
+
* ```
|
|
643
|
+
*/
|
|
644
|
+
declare class DicomSend extends EventEmitter<DicomSendEventMap> {
|
|
645
|
+
private readonly engine;
|
|
646
|
+
private readonly defaultTimeoutMs;
|
|
647
|
+
private readonly defaultMaxRetries;
|
|
648
|
+
private readonly signal;
|
|
649
|
+
private abortHandler;
|
|
650
|
+
private constructor();
|
|
651
|
+
/**
|
|
652
|
+
* Creates a new DicomSend instance.
|
|
653
|
+
*
|
|
654
|
+
* @param options - Configuration options
|
|
655
|
+
* @returns A Result containing the instance or a validation error
|
|
656
|
+
*/
|
|
657
|
+
static create(options: DicomSendOptions): Result<DicomSend>;
|
|
658
|
+
/**
|
|
659
|
+
* Sends one or more DICOM files to the remote endpoint.
|
|
660
|
+
*
|
|
661
|
+
* In single/multiple mode, files are sent as one dcmsend call.
|
|
662
|
+
* In bucket mode, files are accumulated into a bucket and flushed
|
|
663
|
+
* when the bucket reaches maxBucketSize or the flush timer fires.
|
|
664
|
+
*
|
|
665
|
+
* @param files - One or more DICOM file paths
|
|
666
|
+
* @param options - Per-send overrides
|
|
667
|
+
* @returns A Result containing the send result or an error
|
|
668
|
+
*/
|
|
669
|
+
send(files: readonly string[], options?: DcmsendSendOptions): Promise<Result<SendResult>>;
|
|
670
|
+
/**
|
|
671
|
+
* Flushes the current bucket immediately (bucket mode only).
|
|
672
|
+
* In single/multiple mode this is a no-op.
|
|
673
|
+
*/
|
|
674
|
+
flush(): void;
|
|
675
|
+
/**
|
|
676
|
+
* Gracefully stops the sender. Rejects all queued items and
|
|
677
|
+
* waits for active associations to complete.
|
|
678
|
+
*/
|
|
679
|
+
stop(): Promise<void>;
|
|
680
|
+
/** Current sender status. */
|
|
681
|
+
get status(): SenderStatus;
|
|
682
|
+
/**
|
|
683
|
+
* Registers a typed listener for a DicomSend-specific event.
|
|
684
|
+
*
|
|
685
|
+
* @param event - The event name from DicomSendEventMap
|
|
686
|
+
* @param listener - Callback receiving typed event data
|
|
687
|
+
* @returns this for chaining
|
|
688
|
+
*/
|
|
689
|
+
onEvent<K extends keyof DicomSendEventMap>(event: K, listener: (...args: DicomSendEventMap[K]) => void): this;
|
|
690
|
+
/**
|
|
691
|
+
* Registers a listener for successful sends.
|
|
692
|
+
*
|
|
693
|
+
* @param listener - Callback receiving send complete data
|
|
694
|
+
* @returns this for chaining
|
|
695
|
+
*/
|
|
696
|
+
onSendComplete(listener: (data: SenderSendCompleteData) => void): this;
|
|
697
|
+
/**
|
|
698
|
+
* Registers a listener for failed sends.
|
|
699
|
+
*
|
|
700
|
+
* @param listener - Callback receiving send failed data
|
|
701
|
+
* @returns this for chaining
|
|
702
|
+
*/
|
|
703
|
+
onSendFailed(listener: (data: SenderSendFailedData) => void): this;
|
|
704
|
+
/**
|
|
705
|
+
* Registers a listener for health state changes.
|
|
706
|
+
*
|
|
707
|
+
* @param listener - Callback receiving health change data
|
|
708
|
+
* @returns this for chaining
|
|
709
|
+
*/
|
|
710
|
+
onHealthChanged(listener: (data: SenderHealthChangedData) => void): this;
|
|
711
|
+
/**
|
|
712
|
+
* Registers a listener for bucket flushes (bucket mode only).
|
|
713
|
+
*
|
|
714
|
+
* @param listener - Callback receiving bucket flush data
|
|
715
|
+
* @returns this for chaining
|
|
716
|
+
*/
|
|
717
|
+
onBucketFlushed(listener: (data: SenderBucketFlushedData) => void): this;
|
|
577
718
|
/** Wires an AbortSignal to stop the sender. */
|
|
578
719
|
private wireAbortSignal;
|
|
579
720
|
}
|
|
@@ -873,4 +1014,4 @@ declare class PacsClient {
|
|
|
873
1014
|
private executeCMove;
|
|
874
1015
|
}
|
|
875
1016
|
|
|
876
|
-
export { AETitle, AETitleSchema, DEFAULT_BLOCK_TIMEOUT_MS, DEFAULT_DICOM_PORT, DEFAULT_DRAIN_TIMEOUT_MS, DEFAULT_PARSE_CONCURRENCY, DEFAULT_START_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, DcmtkProcessResult, DicomDataset, DicomSender, type DicomSenderEventMap, type DicomSenderOptions, DicomTag, DicomTagPath, DicomTagPathSchema, DicomTagSchema, ExecOptions, type FindDcmtkPathOptions, type ImageFilter, MAX_BLOCK_LINES, MAX_CHANGESET_OPERATIONS, MAX_EVENT_PATTERNS, MAX_TRAVERSAL_DEPTH, PDU_SIZE, PacsClient, type PacsClientConfig, type PacsEchoOptions, type PacsEchoResult, type PacsMethodOptions, type PacsQueryOptions, type PacsQueryResult, type PacsRetrieveOptions, type PacsRetrieveResult, type PacsStoreOptions, type PacsStoreResult, Port, PortSchema, ProposedTransferSyntaxValue, QueryLevel, type QueryLevelValue, REQUIRED_BINARIES, Result, RetrieveMode, type RetrieveModeValue, SOPClassUID, type SendOptions, type SendResult, type SenderBucketFlushedData, type SenderErrorData, SenderHealth, type SenderHealthChangedData, type SenderHealthValue, SenderMode, type SenderModeValue, type SenderSendCompleteData, type SenderSendFailedData, type SenderStatus, type SeriesFilter, SpawnOptions, type StudyFilter, TransferSyntaxUID, UIDSchema, UNIX_SEARCH_PATHS, WINDOWS_SEARCH_PATHS, type WorklistFilter, clearDcmtkPathCache, execCommand, findDcmtkPath, parseAETitle, parseDicomTag, parseDicomTagPath, parsePort, parseSOPClassUID, parseTransferSyntaxUID, spawnCommand };
|
|
1017
|
+
export { AETitle, AETitleSchema, DEFAULT_BLOCK_TIMEOUT_MS, DEFAULT_DICOM_PORT, DEFAULT_DRAIN_TIMEOUT_MS, DEFAULT_PARSE_CONCURRENCY, DEFAULT_START_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, type DcmsendSendOptions, DcmtkProcessResult, DicomDataset, DicomSend, type DicomSendEventMap, type DicomSendOptions, DicomSender, type DicomSenderEventMap, type DicomSenderOptions, DicomTag, DicomTagPath, DicomTagPathSchema, DicomTagSchema, ExecOptions, type FindDcmtkPathOptions, type ImageFilter, MAX_BLOCK_LINES, MAX_CHANGESET_OPERATIONS, MAX_EVENT_PATTERNS, MAX_TRAVERSAL_DEPTH, PDU_SIZE, PacsClient, type PacsClientConfig, type PacsEchoOptions, type PacsEchoResult, type PacsMethodOptions, type PacsQueryOptions, type PacsQueryResult, type PacsRetrieveOptions, type PacsRetrieveResult, type PacsStoreOptions, type PacsStoreResult, Port, PortSchema, ProposedTransferSyntaxValue, QueryLevel, type QueryLevelValue, REQUIRED_BINARIES, Result, RetrieveMode, type RetrieveModeValue, SOPClassUID, type SendOptions, type SendResult, type SenderBucketFlushedData, type SenderErrorData, SenderHealth, type SenderHealthChangedData, type SenderHealthValue, SenderMode, type SenderModeValue, type SenderSendCompleteData, type SenderSendFailedData, type SenderStatus, type SeriesFilter, SpawnOptions, type StudyFilter, TransferSyntaxUID, UIDSchema, UNIX_SEARCH_PATHS, WINDOWS_SEARCH_PATHS, type WorklistFilter, clearDcmtkPathCache, execCommand, findDcmtkPath, parseAETitle, parseDicomTag, parseDicomTagPath, parsePort, parseSOPClassUID, parseTransferSyntaxUID, spawnCommand };
|