@ubercode/dcmtk 0.1.1 → 0.2.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/LICENSE +21 -21
- package/README.md +18 -15
- package/dist/DicomInstance-By9zd7GM.d.cts +625 -0
- package/dist/DicomInstance-CQEIuF_x.d.ts +625 -0
- package/dist/{dcmodify-CTXBWKU9.d.cts → dcmodify-B-_uUIKB.d.ts} +4 -2
- package/dist/{dcmodify-Daeafqrm.d.ts → dcmodify-Gds9u5Vj.d.cts} +4 -2
- package/dist/dicom.cjs +329 -51
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.d.cts +368 -3
- package/dist/dicom.d.ts +368 -3
- package/dist/dicom.js +329 -51
- package/dist/dicom.js.map +1 -1
- package/dist/index.cjs +1460 -419
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1432 -413
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +2379 -196
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.d.cts +1654 -3
- package/dist/servers.d.ts +1654 -3
- package/dist/servers.js +2305 -145
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +97 -50
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +21 -4
- package/dist/tools.d.ts +21 -4
- package/dist/tools.js +97 -51
- package/dist/tools.js.map +1 -1
- package/dist/{types-zHhxS7d2.d.cts → types-Cgumy1N4.d.cts} +1 -24
- package/dist/{types-zHhxS7d2.d.ts → types-Cgumy1N4.d.ts} +1 -24
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +8 -8
- package/dist/index-BZxi4104.d.ts +0 -826
- package/dist/index-CapkWqxy.d.ts +0 -1295
- package/dist/index-DX4C3zbo.d.cts +0 -826
- package/dist/index-r7AvpkCE.d.cts +0 -1295
package/dist/tools.cjs
CHANGED
|
@@ -279,7 +279,7 @@ function buildArgs(inputPath, options) {
|
|
|
279
279
|
async function dcm2xml(inputPath, options) {
|
|
280
280
|
const validation = Dcm2xmlOptionsSchema.safeParse(options);
|
|
281
281
|
if (!validation.success) {
|
|
282
|
-
return err(
|
|
282
|
+
return err(createValidationError("dcm2xml", validation.error));
|
|
283
283
|
}
|
|
284
284
|
const binaryResult = resolveBinary("dcm2xml");
|
|
285
285
|
if (!binaryResult.ok) {
|
|
@@ -594,7 +594,7 @@ function buildArgs2(inputPath, options) {
|
|
|
594
594
|
async function dcmdump(inputPath, options) {
|
|
595
595
|
const validation = DcmdumpOptionsSchema.safeParse(options);
|
|
596
596
|
if (!validation.success) {
|
|
597
|
-
return err(
|
|
597
|
+
return err(createValidationError("dcmdump", validation.error));
|
|
598
598
|
}
|
|
599
599
|
const binaryResult = resolveBinary("dcmdump");
|
|
600
600
|
if (!binaryResult.ok) {
|
|
@@ -639,7 +639,7 @@ var DcmconvOptionsSchema = zod.z.object({
|
|
|
639
639
|
async function dcmconv(inputPath, outputPath, options) {
|
|
640
640
|
const validation = DcmconvOptionsSchema.safeParse(options);
|
|
641
641
|
if (!validation.success) {
|
|
642
|
-
return err(
|
|
642
|
+
return err(createValidationError("dcmconv", validation.error));
|
|
643
643
|
}
|
|
644
644
|
const binaryResult = resolveBinary("dcmconv");
|
|
645
645
|
if (!binaryResult.ok) {
|
|
@@ -671,7 +671,8 @@ var DcmodifyOptionsSchema = zod.z.object({
|
|
|
671
671
|
erasures: zod.z.array(zod.z.string()).optional(),
|
|
672
672
|
erasePrivateTags: zod.z.boolean().optional(),
|
|
673
673
|
noBackup: zod.z.boolean().optional(),
|
|
674
|
-
insertIfMissing: zod.z.boolean().optional()
|
|
674
|
+
insertIfMissing: zod.z.boolean().optional(),
|
|
675
|
+
ignoreMissingTags: zod.z.boolean().optional()
|
|
675
676
|
}).strict().refine((data) => data.modifications.length > 0 || data.erasures !== void 0 && data.erasures.length > 0 || data.erasePrivateTags === true, {
|
|
676
677
|
message: "At least one of modifications, erasures, or erasePrivateTags is required"
|
|
677
678
|
});
|
|
@@ -680,6 +681,9 @@ function buildArgs3(inputPath, options) {
|
|
|
680
681
|
if (options.noBackup !== false) {
|
|
681
682
|
args.push("-nb");
|
|
682
683
|
}
|
|
684
|
+
if (options.ignoreMissingTags === true) {
|
|
685
|
+
args.push("-imt");
|
|
686
|
+
}
|
|
683
687
|
const flag = options.insertIfMissing === true ? "-i" : "-m";
|
|
684
688
|
const modifications = options.modifications ?? [];
|
|
685
689
|
for (const mod of modifications) {
|
|
@@ -699,7 +703,7 @@ function buildArgs3(inputPath, options) {
|
|
|
699
703
|
async function dcmodify(inputPath, options) {
|
|
700
704
|
const validation = DcmodifyOptionsSchema.safeParse(options);
|
|
701
705
|
if (!validation.success) {
|
|
702
|
-
return err(
|
|
706
|
+
return err(createValidationError("dcmodify", validation.error));
|
|
703
707
|
}
|
|
704
708
|
const binaryResult = resolveBinary("dcmodify");
|
|
705
709
|
if (!binaryResult.ok) {
|
|
@@ -726,7 +730,7 @@ var DcmftestOptionsSchema = zod.z.object({
|
|
|
726
730
|
async function dcmftest(inputPath, options) {
|
|
727
731
|
const validation = DcmftestOptionsSchema.safeParse(options);
|
|
728
732
|
if (!validation.success) {
|
|
729
|
-
return err(
|
|
733
|
+
return err(createValidationError("dcmftest", validation.error));
|
|
730
734
|
}
|
|
731
735
|
const binaryResult = resolveBinary("dcmftest");
|
|
732
736
|
if (!binaryResult.ok) {
|
|
@@ -781,7 +785,7 @@ function buildArgs4(options) {
|
|
|
781
785
|
async function dcmgpdir(options) {
|
|
782
786
|
const validation = DcmgpdirOptionsSchema.safeParse(options);
|
|
783
787
|
if (!validation.success) {
|
|
784
|
-
return err(
|
|
788
|
+
return err(createValidationError("dcmgpdir", validation.error));
|
|
785
789
|
}
|
|
786
790
|
const binaryResult = resolveBinary("dcmgpdir");
|
|
787
791
|
if (!binaryResult.ok) {
|
|
@@ -840,7 +844,7 @@ function buildArgs5(options) {
|
|
|
840
844
|
async function dcmmkdir(options) {
|
|
841
845
|
const validation = DcmmkdirOptionsSchema.safeParse(options);
|
|
842
846
|
if (!validation.success) {
|
|
843
|
-
return err(
|
|
847
|
+
return err(createValidationError("dcmmkdir", validation.error));
|
|
844
848
|
}
|
|
845
849
|
const binaryResult = resolveBinary("dcmmkdir");
|
|
846
850
|
if (!binaryResult.ok) {
|
|
@@ -888,7 +892,7 @@ function buildArgs6(options) {
|
|
|
888
892
|
async function dcmqridx(options) {
|
|
889
893
|
const validation = DcmqridxOptionsSchema.safeParse(options);
|
|
890
894
|
if (!validation.success) {
|
|
891
|
-
return err(
|
|
895
|
+
return err(createValidationError("dcmqridx", validation.error));
|
|
892
896
|
}
|
|
893
897
|
const binaryResult = resolveBinary("dcmqridx");
|
|
894
898
|
if (!binaryResult.ok) {
|
|
@@ -931,7 +935,7 @@ function buildArgs7(inputPath, outputPath, options) {
|
|
|
931
935
|
async function xml2dcm(inputPath, outputPath, options) {
|
|
932
936
|
const validation = Xml2dcmOptionsSchema.safeParse(options);
|
|
933
937
|
if (!validation.success) {
|
|
934
|
-
return err(
|
|
938
|
+
return err(createValidationError("xml2dcm", validation.error));
|
|
935
939
|
}
|
|
936
940
|
const binaryResult = resolveBinary("xml2dcm");
|
|
937
941
|
if (!binaryResult.ok) {
|
|
@@ -958,7 +962,7 @@ var Json2dcmOptionsSchema = zod.z.object({
|
|
|
958
962
|
async function json2dcm(inputPath, outputPath, options) {
|
|
959
963
|
const validation = Json2dcmOptionsSchema.safeParse(options);
|
|
960
964
|
if (!validation.success) {
|
|
961
|
-
return err(
|
|
965
|
+
return err(createValidationError("json2dcm", validation.error));
|
|
962
966
|
}
|
|
963
967
|
const binaryResult = resolveBinary("json2dcm");
|
|
964
968
|
if (!binaryResult.ok) {
|
|
@@ -998,7 +1002,7 @@ function buildArgs8(inputPath, outputPath, options) {
|
|
|
998
1002
|
async function dump2dcm(inputPath, outputPath, options) {
|
|
999
1003
|
const validation = Dump2dcmOptionsSchema.safeParse(options);
|
|
1000
1004
|
if (!validation.success) {
|
|
1001
|
-
return err(
|
|
1005
|
+
return err(createValidationError("dump2dcm", validation.error));
|
|
1002
1006
|
}
|
|
1003
1007
|
const binaryResult = resolveBinary("dump2dcm");
|
|
1004
1008
|
if (!binaryResult.ok) {
|
|
@@ -1048,7 +1052,7 @@ function buildArgs9(inputPath, outputPath, options) {
|
|
|
1048
1052
|
async function img2dcm(inputPath, outputPath, options) {
|
|
1049
1053
|
const validation = Img2dcmOptionsSchema.safeParse(options);
|
|
1050
1054
|
if (!validation.success) {
|
|
1051
|
-
return err(
|
|
1055
|
+
return err(createValidationError("img2dcm", validation.error));
|
|
1052
1056
|
}
|
|
1053
1057
|
const binaryResult = resolveBinary("img2dcm");
|
|
1054
1058
|
if (!binaryResult.ok) {
|
|
@@ -1075,7 +1079,7 @@ var Pdf2dcmOptionsSchema = zod.z.object({
|
|
|
1075
1079
|
async function pdf2dcm(inputPath, outputPath, options) {
|
|
1076
1080
|
const validation = Pdf2dcmOptionsSchema.safeParse(options);
|
|
1077
1081
|
if (!validation.success) {
|
|
1078
|
-
return err(
|
|
1082
|
+
return err(createValidationError("pdf2dcm", validation.error));
|
|
1079
1083
|
}
|
|
1080
1084
|
const binaryResult = resolveBinary("pdf2dcm");
|
|
1081
1085
|
if (!binaryResult.ok) {
|
|
@@ -1102,7 +1106,7 @@ var Dcm2pdfOptionsSchema = zod.z.object({
|
|
|
1102
1106
|
async function dcm2pdf(inputPath, outputPath, options) {
|
|
1103
1107
|
const validation = Dcm2pdfOptionsSchema.safeParse(options);
|
|
1104
1108
|
if (!validation.success) {
|
|
1105
|
-
return err(
|
|
1109
|
+
return err(createValidationError("dcm2pdf", validation.error));
|
|
1106
1110
|
}
|
|
1107
1111
|
const binaryResult = resolveBinary("dcm2pdf");
|
|
1108
1112
|
if (!binaryResult.ok) {
|
|
@@ -1129,7 +1133,7 @@ var Cda2dcmOptionsSchema = zod.z.object({
|
|
|
1129
1133
|
async function cda2dcm(inputPath, outputPath, options) {
|
|
1130
1134
|
const validation = Cda2dcmOptionsSchema.safeParse(options);
|
|
1131
1135
|
if (!validation.success) {
|
|
1132
|
-
return err(
|
|
1136
|
+
return err(createValidationError("cda2dcm", validation.error));
|
|
1133
1137
|
}
|
|
1134
1138
|
const binaryResult = resolveBinary("cda2dcm");
|
|
1135
1139
|
if (!binaryResult.ok) {
|
|
@@ -1156,7 +1160,7 @@ var Dcm2cdaOptionsSchema = zod.z.object({
|
|
|
1156
1160
|
async function dcm2cda(inputPath, outputPath, options) {
|
|
1157
1161
|
const validation = Dcm2cdaOptionsSchema.safeParse(options);
|
|
1158
1162
|
if (!validation.success) {
|
|
1159
|
-
return err(
|
|
1163
|
+
return err(createValidationError("dcm2cda", validation.error));
|
|
1160
1164
|
}
|
|
1161
1165
|
const binaryResult = resolveBinary("dcm2cda");
|
|
1162
1166
|
if (!binaryResult.ok) {
|
|
@@ -1183,7 +1187,7 @@ var Stl2dcmOptionsSchema = zod.z.object({
|
|
|
1183
1187
|
async function stl2dcm(inputPath, outputPath, options) {
|
|
1184
1188
|
const validation = Stl2dcmOptionsSchema.safeParse(options);
|
|
1185
1189
|
if (!validation.success) {
|
|
1186
|
-
return err(
|
|
1190
|
+
return err(createValidationError("stl2dcm", validation.error));
|
|
1187
1191
|
}
|
|
1188
1192
|
const binaryResult = resolveBinary("stl2dcm");
|
|
1189
1193
|
if (!binaryResult.ok) {
|
|
@@ -1219,7 +1223,7 @@ function buildArgs10(inputPath, outputPath, options) {
|
|
|
1219
1223
|
async function dcmcrle(inputPath, outputPath, options) {
|
|
1220
1224
|
const validation = DcmcrleOptionsSchema.safeParse(options);
|
|
1221
1225
|
if (!validation.success) {
|
|
1222
|
-
return err(
|
|
1226
|
+
return err(createValidationError("dcmcrle", validation.error));
|
|
1223
1227
|
}
|
|
1224
1228
|
const binaryResult = resolveBinary("dcmcrle");
|
|
1225
1229
|
if (!binaryResult.ok) {
|
|
@@ -1255,7 +1259,7 @@ function buildArgs11(inputPath, outputPath, options) {
|
|
|
1255
1259
|
async function dcmdrle(inputPath, outputPath, options) {
|
|
1256
1260
|
const validation = DcmdrleOptionsSchema.safeParse(options);
|
|
1257
1261
|
if (!validation.success) {
|
|
1258
|
-
return err(
|
|
1262
|
+
return err(createValidationError("dcmdrle", validation.error));
|
|
1259
1263
|
}
|
|
1260
1264
|
const binaryResult = resolveBinary("dcmdrle");
|
|
1261
1265
|
if (!binaryResult.ok) {
|
|
@@ -1291,7 +1295,7 @@ function buildArgs12(inputPath, outputPath, options) {
|
|
|
1291
1295
|
async function dcmencap(inputPath, outputPath, options) {
|
|
1292
1296
|
const validation = DcmencapOptionsSchema.safeParse(options);
|
|
1293
1297
|
if (!validation.success) {
|
|
1294
|
-
return err(
|
|
1298
|
+
return err(createValidationError("dcmencap", validation.error));
|
|
1295
1299
|
}
|
|
1296
1300
|
const binaryResult = resolveBinary("dcmencap");
|
|
1297
1301
|
if (!binaryResult.ok) {
|
|
@@ -1318,7 +1322,7 @@ var DcmdecapOptionsSchema = zod.z.object({
|
|
|
1318
1322
|
async function dcmdecap(inputPath, outputPath, options) {
|
|
1319
1323
|
const validation = DcmdecapOptionsSchema.safeParse(options);
|
|
1320
1324
|
if (!validation.success) {
|
|
1321
|
-
return err(
|
|
1325
|
+
return err(createValidationError("dcmdecap", validation.error));
|
|
1322
1326
|
}
|
|
1323
1327
|
const binaryResult = resolveBinary("dcmdecap");
|
|
1324
1328
|
if (!binaryResult.ok) {
|
|
@@ -1358,7 +1362,7 @@ function buildArgs13(inputPath, outputPath, options) {
|
|
|
1358
1362
|
async function dcmcjpeg(inputPath, outputPath, options) {
|
|
1359
1363
|
const validation = DcmcjpegOptionsSchema.safeParse(options);
|
|
1360
1364
|
if (!validation.success) {
|
|
1361
|
-
return err(
|
|
1365
|
+
return err(createValidationError("dcmcjpeg", validation.error));
|
|
1362
1366
|
}
|
|
1363
1367
|
const binaryResult = resolveBinary("dcmcjpeg");
|
|
1364
1368
|
if (!binaryResult.ok) {
|
|
@@ -1407,7 +1411,7 @@ function buildArgs14(inputPath, outputPath, options) {
|
|
|
1407
1411
|
async function dcmdjpeg(inputPath, outputPath, options) {
|
|
1408
1412
|
const validation = DcmdjpegOptionsSchema.safeParse(options);
|
|
1409
1413
|
if (!validation.success) {
|
|
1410
|
-
return err(
|
|
1414
|
+
return err(createValidationError("dcmdjpeg", validation.error));
|
|
1411
1415
|
}
|
|
1412
1416
|
const binaryResult = resolveBinary("dcmdjpeg");
|
|
1413
1417
|
if (!binaryResult.ok) {
|
|
@@ -1449,7 +1453,7 @@ function buildArgs15(inputPath, outputPath, options) {
|
|
|
1449
1453
|
async function dcmcjpls(inputPath, outputPath, options) {
|
|
1450
1454
|
const validation = DcmcjplsOptionsSchema.safeParse(options);
|
|
1451
1455
|
if (!validation.success) {
|
|
1452
|
-
return err(
|
|
1456
|
+
return err(createValidationError("dcmcjpls", validation.error));
|
|
1453
1457
|
}
|
|
1454
1458
|
const binaryResult = resolveBinary("dcmcjpls");
|
|
1455
1459
|
if (!binaryResult.ok) {
|
|
@@ -1498,7 +1502,7 @@ function buildArgs16(inputPath, outputPath, options) {
|
|
|
1498
1502
|
async function dcmdjpls(inputPath, outputPath, options) {
|
|
1499
1503
|
const validation = DcmdjplsOptionsSchema.safeParse(options);
|
|
1500
1504
|
if (!validation.success) {
|
|
1501
|
-
return err(
|
|
1505
|
+
return err(createValidationError("dcmdjpls", validation.error));
|
|
1502
1506
|
}
|
|
1503
1507
|
const binaryResult = resolveBinary("dcmdjpls");
|
|
1504
1508
|
if (!binaryResult.ok) {
|
|
@@ -1557,7 +1561,7 @@ function buildArgs17(inputPath, outputPath, options) {
|
|
|
1557
1561
|
async function dcmj2pnm(inputPath, outputPath, options) {
|
|
1558
1562
|
const validation = Dcmj2pnmOptionsSchema.safeParse(options);
|
|
1559
1563
|
if (!validation.success) {
|
|
1560
|
-
return err(
|
|
1564
|
+
return err(createValidationError("dcmj2pnm", validation.error));
|
|
1561
1565
|
}
|
|
1562
1566
|
const binaryResult = resolveBinary("dcmj2pnm");
|
|
1563
1567
|
if (!binaryResult.ok) {
|
|
@@ -1613,7 +1617,7 @@ function buildArgs18(inputPath, outputPath, options) {
|
|
|
1613
1617
|
async function dcm2pnm(inputPath, outputPath, options) {
|
|
1614
1618
|
const validation = Dcm2pnmOptionsSchema.safeParse(options);
|
|
1615
1619
|
if (!validation.success) {
|
|
1616
|
-
return err(
|
|
1620
|
+
return err(createValidationError("dcm2pnm", validation.error));
|
|
1617
1621
|
}
|
|
1618
1622
|
const binaryResult = resolveBinary("dcm2pnm");
|
|
1619
1623
|
if (!binaryResult.ok) {
|
|
@@ -1661,7 +1665,7 @@ function buildArgs19(inputPath, outputPath, options) {
|
|
|
1661
1665
|
async function dcmscale(inputPath, outputPath, options) {
|
|
1662
1666
|
const validation = DcmscaleOptionsSchema.safeParse(options);
|
|
1663
1667
|
if (!validation.success) {
|
|
1664
|
-
return err(
|
|
1668
|
+
return err(createValidationError("dcmscale", validation.error));
|
|
1665
1669
|
}
|
|
1666
1670
|
const binaryResult = resolveBinary("dcmscale");
|
|
1667
1671
|
if (!binaryResult.ok) {
|
|
@@ -1701,7 +1705,7 @@ function buildArgs20(inputPath, outputPath, options) {
|
|
|
1701
1705
|
async function dcmquant(inputPath, outputPath, options) {
|
|
1702
1706
|
const validation = DcmquantOptionsSchema.safeParse(options);
|
|
1703
1707
|
if (!validation.success) {
|
|
1704
|
-
return err(
|
|
1708
|
+
return err(createValidationError("dcmquant", validation.error));
|
|
1705
1709
|
}
|
|
1706
1710
|
const binaryResult = resolveBinary("dcmquant");
|
|
1707
1711
|
if (!binaryResult.ok) {
|
|
@@ -1748,7 +1752,7 @@ function buildArgs21(options) {
|
|
|
1748
1752
|
async function dcmdspfn(options) {
|
|
1749
1753
|
const validation = DcmdspfnOptionsSchema.safeParse(options);
|
|
1750
1754
|
if (!validation.success) {
|
|
1751
|
-
return err(
|
|
1755
|
+
return err(createValidationError("dcmdspfn", validation.error));
|
|
1752
1756
|
}
|
|
1753
1757
|
const binaryResult = resolveBinary("dcmdspfn");
|
|
1754
1758
|
if (!binaryResult.ok) {
|
|
@@ -1775,7 +1779,7 @@ var Dcod2lumOptionsSchema = zod.z.object({
|
|
|
1775
1779
|
async function dcod2lum(inputPath, outputPath, options) {
|
|
1776
1780
|
const validation = Dcod2lumOptionsSchema.safeParse(options);
|
|
1777
1781
|
if (!validation.success) {
|
|
1778
|
-
return err(
|
|
1782
|
+
return err(createValidationError("dcod2lum", validation.error));
|
|
1779
1783
|
}
|
|
1780
1784
|
const binaryResult = resolveBinary("dcod2lum");
|
|
1781
1785
|
if (!binaryResult.ok) {
|
|
@@ -1811,7 +1815,7 @@ function buildArgs22(inputPath, outputPath, options) {
|
|
|
1811
1815
|
async function dconvlum(inputPath, outputPath, options) {
|
|
1812
1816
|
const validation = DconvlumOptionsSchema.safeParse(options);
|
|
1813
1817
|
if (!validation.success) {
|
|
1814
|
-
return err(
|
|
1818
|
+
return err(createValidationError("dconvlum", validation.error));
|
|
1815
1819
|
}
|
|
1816
1820
|
const binaryResult = resolveBinary("dconvlum");
|
|
1817
1821
|
if (!binaryResult.ok) {
|
|
@@ -1901,7 +1905,7 @@ function buildArgs24(options) {
|
|
|
1901
1905
|
async function dcmsend(options) {
|
|
1902
1906
|
const validation = DcmsendOptionsSchema.safeParse(options);
|
|
1903
1907
|
if (!validation.success) {
|
|
1904
|
-
return err(
|
|
1908
|
+
return err(createValidationError("dcmsend", validation.error));
|
|
1905
1909
|
}
|
|
1906
1910
|
const binaryResult = resolveBinary("dcmsend");
|
|
1907
1911
|
if (!binaryResult.ok) {
|
|
@@ -1921,6 +1925,32 @@ async function dcmsend(options) {
|
|
|
1921
1925
|
}
|
|
1922
1926
|
return ok({ success: true, stderr: result.value.stderr });
|
|
1923
1927
|
}
|
|
1928
|
+
var ProposedTransferSyntax = {
|
|
1929
|
+
UNCOMPRESSED: "uncompressed",
|
|
1930
|
+
LITTLE_ENDIAN: "littleEndian",
|
|
1931
|
+
BIG_ENDIAN: "bigEndian",
|
|
1932
|
+
IMPLICIT_VR: "implicitVR",
|
|
1933
|
+
JPEG_LOSSLESS: "jpegLossless",
|
|
1934
|
+
JPEG_8BIT: "jpeg8Bit",
|
|
1935
|
+
JPEG_12BIT: "jpeg12Bit",
|
|
1936
|
+
J2K_LOSSLESS: "j2kLossless",
|
|
1937
|
+
J2K_LOSSY: "j2kLossy",
|
|
1938
|
+
JLS_LOSSLESS: "jlsLossless",
|
|
1939
|
+
JLS_LOSSY: "jlsLossy"
|
|
1940
|
+
};
|
|
1941
|
+
var PROPOSED_TS_FLAG_MAP = {
|
|
1942
|
+
[ProposedTransferSyntax.UNCOMPRESSED]: "-x=",
|
|
1943
|
+
[ProposedTransferSyntax.LITTLE_ENDIAN]: "-xe",
|
|
1944
|
+
[ProposedTransferSyntax.BIG_ENDIAN]: "-xb",
|
|
1945
|
+
[ProposedTransferSyntax.IMPLICIT_VR]: "-xi",
|
|
1946
|
+
[ProposedTransferSyntax.JPEG_LOSSLESS]: "-xs",
|
|
1947
|
+
[ProposedTransferSyntax.JPEG_8BIT]: "-xy",
|
|
1948
|
+
[ProposedTransferSyntax.JPEG_12BIT]: "-xx",
|
|
1949
|
+
[ProposedTransferSyntax.J2K_LOSSLESS]: "-xv",
|
|
1950
|
+
[ProposedTransferSyntax.J2K_LOSSY]: "-xw",
|
|
1951
|
+
[ProposedTransferSyntax.JLS_LOSSLESS]: "-xt",
|
|
1952
|
+
[ProposedTransferSyntax.JLS_LOSSY]: "-xu"
|
|
1953
|
+
};
|
|
1924
1954
|
var StorescuOptionsSchema = zod.z.object({
|
|
1925
1955
|
timeoutMs: zod.z.number().int().positive().optional(),
|
|
1926
1956
|
signal: zod.z.instanceof(AbortSignal).optional(),
|
|
@@ -1930,7 +1960,20 @@ var StorescuOptionsSchema = zod.z.object({
|
|
|
1930
1960
|
callingAETitle: zod.z.string().min(1).max(16).refine(isValidAETitle, { message: "AE Title contains invalid characters" }).optional(),
|
|
1931
1961
|
calledAETitle: zod.z.string().min(1).max(16).refine(isValidAETitle, { message: "AE Title contains invalid characters" }).optional(),
|
|
1932
1962
|
scanDirectories: zod.z.boolean().optional(),
|
|
1933
|
-
recurse: zod.z.boolean().optional()
|
|
1963
|
+
recurse: zod.z.boolean().optional(),
|
|
1964
|
+
proposedTransferSyntax: zod.z.enum([
|
|
1965
|
+
"uncompressed",
|
|
1966
|
+
"littleEndian",
|
|
1967
|
+
"bigEndian",
|
|
1968
|
+
"implicitVR",
|
|
1969
|
+
"jpegLossless",
|
|
1970
|
+
"jpeg8Bit",
|
|
1971
|
+
"jpeg12Bit",
|
|
1972
|
+
"j2kLossless",
|
|
1973
|
+
"j2kLossy",
|
|
1974
|
+
"jlsLossless",
|
|
1975
|
+
"jlsLossy"
|
|
1976
|
+
]).optional()
|
|
1934
1977
|
}).strict();
|
|
1935
1978
|
function buildArgs25(options) {
|
|
1936
1979
|
const args = [];
|
|
@@ -1946,6 +1989,9 @@ function buildArgs25(options) {
|
|
|
1946
1989
|
if (options.recurse === true) {
|
|
1947
1990
|
args.push("+r");
|
|
1948
1991
|
}
|
|
1992
|
+
if (options.proposedTransferSyntax !== void 0) {
|
|
1993
|
+
args.push(PROPOSED_TS_FLAG_MAP[options.proposedTransferSyntax]);
|
|
1994
|
+
}
|
|
1949
1995
|
args.push(options.host, String(options.port));
|
|
1950
1996
|
args.push(...options.files);
|
|
1951
1997
|
return args;
|
|
@@ -1953,7 +1999,7 @@ function buildArgs25(options) {
|
|
|
1953
1999
|
async function storescu(options) {
|
|
1954
2000
|
const validation = StorescuOptionsSchema.safeParse(options);
|
|
1955
2001
|
if (!validation.success) {
|
|
1956
|
-
return err(
|
|
2002
|
+
return err(createValidationError("storescu", validation.error));
|
|
1957
2003
|
}
|
|
1958
2004
|
const binaryResult = resolveBinary("storescu");
|
|
1959
2005
|
if (!binaryResult.ok) {
|
|
@@ -2093,7 +2139,7 @@ function buildArgs27(options) {
|
|
|
2093
2139
|
async function movescu(options) {
|
|
2094
2140
|
const validation = MovescuOptionsSchema.safeParse(options);
|
|
2095
2141
|
if (!validation.success) {
|
|
2096
|
-
return err(
|
|
2142
|
+
return err(createValidationError("movescu", validation.error));
|
|
2097
2143
|
}
|
|
2098
2144
|
const binaryResult = resolveBinary("movescu");
|
|
2099
2145
|
if (!binaryResult.ok) {
|
|
@@ -2157,7 +2203,7 @@ function buildArgs28(options) {
|
|
|
2157
2203
|
async function getscu(options) {
|
|
2158
2204
|
const validation = GetscuOptionsSchema.safeParse(options);
|
|
2159
2205
|
if (!validation.success) {
|
|
2160
|
-
return err(
|
|
2206
|
+
return err(createValidationError("getscu", validation.error));
|
|
2161
2207
|
}
|
|
2162
2208
|
const binaryResult = resolveBinary("getscu");
|
|
2163
2209
|
if (!binaryResult.ok) {
|
|
@@ -2199,7 +2245,7 @@ function buildArgs29(options) {
|
|
|
2199
2245
|
async function termscu(options) {
|
|
2200
2246
|
const validation = TermscuOptionsSchema.safeParse(options);
|
|
2201
2247
|
if (!validation.success) {
|
|
2202
|
-
return err(
|
|
2248
|
+
return err(createValidationError("termscu", validation.error));
|
|
2203
2249
|
}
|
|
2204
2250
|
const binaryResult = resolveBinary("termscu");
|
|
2205
2251
|
if (!binaryResult.ok) {
|
|
@@ -2243,7 +2289,7 @@ function buildArgs30(inputPath, options) {
|
|
|
2243
2289
|
async function dsrdump(inputPath, options) {
|
|
2244
2290
|
const validation = DsrdumpOptionsSchema.safeParse(options);
|
|
2245
2291
|
if (!validation.success) {
|
|
2246
|
-
return err(
|
|
2292
|
+
return err(createValidationError("dsrdump", validation.error));
|
|
2247
2293
|
}
|
|
2248
2294
|
const binaryResult = resolveBinary("dsrdump");
|
|
2249
2295
|
if (!binaryResult.ok) {
|
|
@@ -2283,7 +2329,7 @@ function buildArgs31(inputPath, options) {
|
|
|
2283
2329
|
async function dsr2xml(inputPath, options) {
|
|
2284
2330
|
const validation = Dsr2xmlOptionsSchema.safeParse(options);
|
|
2285
2331
|
if (!validation.success) {
|
|
2286
|
-
return err(
|
|
2332
|
+
return err(createValidationError("dsr2xml", validation.error));
|
|
2287
2333
|
}
|
|
2288
2334
|
const binaryResult = resolveBinary("dsr2xml");
|
|
2289
2335
|
if (!binaryResult.ok) {
|
|
@@ -2323,7 +2369,7 @@ function buildArgs32(inputPath, outputPath, options) {
|
|
|
2323
2369
|
async function xml2dsr(inputPath, outputPath, options) {
|
|
2324
2370
|
const validation = Xml2dsrOptionsSchema.safeParse(options);
|
|
2325
2371
|
if (!validation.success) {
|
|
2326
|
-
return err(
|
|
2372
|
+
return err(createValidationError("xml2dsr", validation.error));
|
|
2327
2373
|
}
|
|
2328
2374
|
const binaryResult = resolveBinary("xml2dsr");
|
|
2329
2375
|
if (!binaryResult.ok) {
|
|
@@ -2359,7 +2405,7 @@ function buildArgs33(inputPath, options) {
|
|
|
2359
2405
|
async function drtdump(inputPath, options) {
|
|
2360
2406
|
const validation = DrtdumpOptionsSchema.safeParse(options);
|
|
2361
2407
|
if (!validation.success) {
|
|
2362
|
-
return err(
|
|
2408
|
+
return err(createValidationError("drtdump", validation.error));
|
|
2363
2409
|
}
|
|
2364
2410
|
const binaryResult = resolveBinary("drtdump");
|
|
2365
2411
|
if (!binaryResult.ok) {
|
|
@@ -2386,7 +2432,7 @@ var DcmpsmkOptionsSchema = zod.z.object({
|
|
|
2386
2432
|
async function dcmpsmk(inputPath, outputPath, options) {
|
|
2387
2433
|
const validation = DcmpsmkOptionsSchema.safeParse(options);
|
|
2388
2434
|
if (!validation.success) {
|
|
2389
|
-
return err(
|
|
2435
|
+
return err(createValidationError("dcmpsmk", validation.error));
|
|
2390
2436
|
}
|
|
2391
2437
|
const binaryResult = resolveBinary("dcmpsmk");
|
|
2392
2438
|
if (!binaryResult.ok) {
|
|
@@ -2413,7 +2459,7 @@ var DcmpschkOptionsSchema = zod.z.object({
|
|
|
2413
2459
|
async function dcmpschk(inputPath, options) {
|
|
2414
2460
|
const validation = DcmpschkOptionsSchema.safeParse(options);
|
|
2415
2461
|
if (!validation.success) {
|
|
2416
|
-
return err(
|
|
2462
|
+
return err(createValidationError("dcmpschk", validation.error));
|
|
2417
2463
|
}
|
|
2418
2464
|
const binaryResult = resolveBinary("dcmpschk");
|
|
2419
2465
|
if (!binaryResult.ok) {
|
|
@@ -2459,7 +2505,7 @@ function buildArgs34(options) {
|
|
|
2459
2505
|
async function dcmprscu(options) {
|
|
2460
2506
|
const validation = DcmprscuOptionsSchema.safeParse(options);
|
|
2461
2507
|
if (!validation.success) {
|
|
2462
|
-
return err(
|
|
2508
|
+
return err(createValidationError("dcmprscu", validation.error));
|
|
2463
2509
|
}
|
|
2464
2510
|
const binaryResult = resolveBinary("dcmprscu");
|
|
2465
2511
|
if (!binaryResult.ok) {
|
|
@@ -2495,7 +2541,7 @@ function buildArgs35(inputPath, options) {
|
|
|
2495
2541
|
async function dcmpsprt(inputPath, options) {
|
|
2496
2542
|
const validation = DcmpsprtOptionsSchema.safeParse(options);
|
|
2497
2543
|
if (!validation.success) {
|
|
2498
|
-
return err(
|
|
2544
|
+
return err(createValidationError("dcmpsprt", validation.error));
|
|
2499
2545
|
}
|
|
2500
2546
|
const binaryResult = resolveBinary("dcmpsprt");
|
|
2501
2547
|
if (!binaryResult.ok) {
|
|
@@ -2535,7 +2581,7 @@ function buildArgs36(inputPath, outputPath, options) {
|
|
|
2535
2581
|
async function dcmp2pgm(inputPath, outputPath, options) {
|
|
2536
2582
|
const validation = Dcmp2pgmOptionsSchema.safeParse(options);
|
|
2537
2583
|
if (!validation.success) {
|
|
2538
|
-
return err(
|
|
2584
|
+
return err(createValidationError("dcmp2pgm", validation.error));
|
|
2539
2585
|
}
|
|
2540
2586
|
const binaryResult = resolveBinary("dcmp2pgm");
|
|
2541
2587
|
if (!binaryResult.ok) {
|
|
@@ -2562,7 +2608,7 @@ var DcmmkcrvOptionsSchema = zod.z.object({
|
|
|
2562
2608
|
async function dcmmkcrv(inputPath, outputPath, options) {
|
|
2563
2609
|
const validation = DcmmkcrvOptionsSchema.safeParse(options);
|
|
2564
2610
|
if (!validation.success) {
|
|
2565
|
-
return err(
|
|
2611
|
+
return err(createValidationError("dcmmkcrv", validation.error));
|
|
2566
2612
|
}
|
|
2567
2613
|
const binaryResult = resolveBinary("dcmmkcrv");
|
|
2568
2614
|
if (!binaryResult.ok) {
|
|
@@ -2623,7 +2669,7 @@ function buildArgs37(outputPath, options) {
|
|
|
2623
2669
|
async function dcmmklut(outputPath, options) {
|
|
2624
2670
|
const validation = DcmmklutOptionsSchema.safeParse(options);
|
|
2625
2671
|
if (!validation.success) {
|
|
2626
|
-
return err(
|
|
2672
|
+
return err(createValidationError("dcmmklut", validation.error));
|
|
2627
2673
|
}
|
|
2628
2674
|
const binaryResult = resolveBinary("dcmmklut");
|
|
2629
2675
|
if (!binaryResult.ok) {
|
|
@@ -2654,6 +2700,7 @@ exports.Img2dcmInputFormat = Img2dcmInputFormat;
|
|
|
2654
2700
|
exports.JplsColorConversion = JplsColorConversion;
|
|
2655
2701
|
exports.LutType = LutType;
|
|
2656
2702
|
exports.MoveQueryModel = MoveQueryModel;
|
|
2703
|
+
exports.ProposedTransferSyntax = ProposedTransferSyntax;
|
|
2657
2704
|
exports.QueryModel = QueryModel;
|
|
2658
2705
|
exports.TransferSyntax = TransferSyntax;
|
|
2659
2706
|
exports.cda2dcm = cda2dcm;
|