@ubercode/dcmtk 0.8.2 → 0.9.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/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-B13DmBRs.d.cts → index-Bq947ilN.d.cts} +1 -0
- package/dist/{index-CCgNgve7.d.ts → index-C9oo35ZO.d.ts} +1 -0
- package/dist/index.cjs +363 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +230 -3
- package/dist/index.d.ts +230 -3
- package/dist/index.js +362 -11
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +20 -5
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.d.cts +1 -1
- package/dist/servers.d.ts +1 -1
- package/dist/servers.js +22 -6
- 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/servers.cjs
CHANGED
|
@@ -2308,13 +2308,26 @@ async function tryDirectPath(inputPath, timeoutMs, signal, verbosity) {
|
|
|
2308
2308
|
if (!jsonBinary.ok) {
|
|
2309
2309
|
return err(jsonBinary.error);
|
|
2310
2310
|
}
|
|
2311
|
-
const
|
|
2312
|
-
const
|
|
2311
|
+
const bulkDir = await createBulkTempDir();
|
|
2312
|
+
const directArgs = [...buildVerbosityArgs(verbosity), "+b", "+bd", bulkDir, inputPath];
|
|
2313
|
+
try {
|
|
2314
|
+
const execOpts = signal !== void 0 ? { timeoutMs, signal } : { timeoutMs };
|
|
2315
|
+
return await execAndParse(jsonBinary.value, directArgs, inputPath, execOpts);
|
|
2316
|
+
} finally {
|
|
2317
|
+
fs.rm(bulkDir, { recursive: true, force: true }).catch(() => {
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
async function createBulkTempDir() {
|
|
2322
|
+
return fs.mkdtemp(path.join(os.tmpdir(), "dcm2json-bulk-"));
|
|
2323
|
+
}
|
|
2324
|
+
async function execAndParse(binary, args, inputPath, execOpts) {
|
|
2325
|
+
const result = await execCommand(binary, args, execOpts);
|
|
2313
2326
|
if (!result.ok) {
|
|
2314
2327
|
return err(result.error);
|
|
2315
2328
|
}
|
|
2316
2329
|
if (result.value.exitCode !== 0) {
|
|
2317
|
-
return err(createToolError("dcm2json",
|
|
2330
|
+
return err(createToolError("dcm2json", args, result.value.exitCode, result.value.stderr));
|
|
2318
2331
|
}
|
|
2319
2332
|
try {
|
|
2320
2333
|
const repaired = repairJson(result.value.stdout);
|
|
@@ -3113,7 +3126,7 @@ var DicomReceiver = class _DicomReceiver extends events.EventEmitter {
|
|
|
3113
3126
|
acseTimeout: this.options.acseTimeout,
|
|
3114
3127
|
dimseTimeout: this.options.dimseTimeout,
|
|
3115
3128
|
maxPdu: this.options.maxPdu,
|
|
3116
|
-
filenameMode: this.options.filenameMode,
|
|
3129
|
+
filenameMode: this.options.filenameMode ?? "unique",
|
|
3117
3130
|
filenameExtension: this.options.filenameExtension,
|
|
3118
3131
|
storageMode: this.options.storageMode
|
|
3119
3132
|
});
|
|
@@ -3228,8 +3241,9 @@ var DicomReceiver = class _DicomReceiver extends events.EventEmitter {
|
|
|
3228
3241
|
const assocDir = worker.associationDir;
|
|
3229
3242
|
const moveResult = await moveFile(srcPath, destPath);
|
|
3230
3243
|
const finalPath = moveResult.ok ? destPath : srcPath;
|
|
3244
|
+
const fileSize = await statFileSafe(finalPath);
|
|
3231
3245
|
worker.files.push(finalPath);
|
|
3232
|
-
worker.fileSizes.push(
|
|
3246
|
+
worker.fileSizes.push(fileSize);
|
|
3233
3247
|
const openResult = await DicomInstance.open(finalPath);
|
|
3234
3248
|
if (!openResult.ok) {
|
|
3235
3249
|
this.emit("error", {
|
|
@@ -3245,6 +3259,7 @@ var DicomReceiver = class _DicomReceiver extends events.EventEmitter {
|
|
|
3245
3259
|
}
|
|
3246
3260
|
this.emit("FILE_RECEIVED", {
|
|
3247
3261
|
filePath: finalPath,
|
|
3262
|
+
fileSize,
|
|
3248
3263
|
associationId: assocId,
|
|
3249
3264
|
associationDir: assocDir,
|
|
3250
3265
|
callingAE: data.callingAE,
|