feat: import pacs

This commit is contained in:
mozzie 2024-09-10 14:09:34 +08:00
parent 6df7442b9b
commit 3ab485fb2b
45 changed files with 4333 additions and 31 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ release
_internal
OrthancStorage

View File

@ -10,6 +10,7 @@ import { db } from "./core/db";
import axios from "axios";
import path from "node:path";
import { mkdir, stat } from "fs/promises";
import { readFileSync } from "node:fs";
/**
*
@ -237,6 +238,26 @@ const registerIpcMainHandlers = (mainWindow: Electron.BrowserWindow | null) => {
shell.openPath(resolvedPath);
}
});
ipcMain.on("request-dicom", async (event, data) => {
console.log(data);
const SeriesInstanceUID = data;
await db.read();
const series = await db.data.series.find(
(s) => s.SeriesInstanceUID === SeriesInstanceUID
);
console.log(series);
if (series) {
const { filePaths } = series;
const buffers = filePaths.map((filePath) => {
const dicomFileBuffer = readFileSync(filePath);
return dicomFileBuffer;
});
event.reply("request-dicom:response", series);
} else {
console.log("没找到series");
}
});
};
export default registerIpcMainHandlers;

View File

@ -65,6 +65,17 @@ function createWindow() {
});
});
const pacsPath =
platform !== "macos"
? path.join(
process.env.VITE_PUBLIC!,
"orthanc-win64-1.12.4",
"Orthanc.exe"
)
: path.join(process.env.VITE_PUBLIC!, "orthanc-mac-24.8.1", "Orthanc");
spawn(pacsPath);
if (VITE_DEV_SERVER_URL) {
win.loadURL(VITE_DEV_SERVER_URL);
registerIpcMainHandlers(win);

View File

@ -85,6 +85,8 @@
"vite": "^5.1.6",
"vite-plugin-electron": "^0.28.6",
"vite-plugin-electron-renderer": "^0.14.5",
"@types/lodash": "4.17.7"
"@types/lodash": "4.17.7",
"vite-plugin-static-copy": "1.0.6",
"vite-plugin-node-polyfills": "0.22.0"
}
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
{
// The reference of the Orthanc configuration file is available at:
// https://orthanc.uclouvain.be/hg/orthanc/file/default/OrthancServer/Resources/Configuration.json
"Name" : "MyOrthanc",
// Load all the Orthanc plugins that are available in this folder:
"Plugins" : [ "." ],
// Orthanc Explorer 2 configuration. Reference is available at:
// https://github.com/orthanc-server/orthanc-explorer-2/blob/master/Plugin/DefaultConfiguration.json
"OrthancExplorer2" : {
"Enable": true,
"IsDefaultOrthancUI": false
}
}

View File

@ -0,0 +1,18 @@
This package contains Orthanc and its main plugins.
QuickStart:
----------
Unzip this archive (do not run Orthanc from the zip archive).
Double-click startOrthanc.command to launch a pre-configured Orthanc instance.
Open a browser at http://localhost:8042 to reach the Orthanc Explorer.
Open the upload page, you may drop a DICOM file.
Once the DICOM file is uploaded, go back to the patients page and browse the study.
Click on 'Osimis WebViewer' to visualize the study in the web browser.
Going further:
-------------
Read the Orthanc book to learn more about Orthanc configuration and advanced usage (https://book.orthanc-server.com)

View File

@ -0,0 +1,3 @@
#!/bin/bash
cd "$(dirname "$0")"
./Orthanc configMacOS.json

Binary file not shown.

Binary file not shown.

View File

@ -134,8 +134,10 @@ const Boot = () => {
<ResizableHandle withHandle />
<ResizablePanel defaultSize={61.8}>
<div className="flex h-full items-center justify-center p-6">
{messageText.map((item) => (
<p className="font-semibold">{item}</p>
{messageText.map((item, index) => (
<p className="font-semibold" key={index}>
{item}
</p>
))}
</div>
</ResizablePanel>

View File

@ -1,12 +1,15 @@
import { useLocation } from "react-router-dom"
import { useLocation } from "react-router-dom";
export const Viewer = () => {
const location = useLocation()
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const SeriesInstanceUID = queryParams.get('SeriesInstanceUID'); // 获取URL参数
const SeriesInstanceUID = queryParams.get("SeriesInstanceUID"); // 获取URL参数
return <div>
{SeriesInstanceUID}
<p>dicom的mpr方案</p>
</div>
}
return (
<div>
{SeriesInstanceUID}
<p>dicom的mpr方案</p>
{/* <DICOMViewer /> */}
</div>
);
};

View File

@ -2,10 +2,13 @@ import { defineConfig } from "vite";
import path from "node:path";
import electron from "vite-plugin-electron/simple";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from 'vite-plugin-node-polyfills'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
nodePolyfills(),
react(),
electron({
main: {
@ -30,6 +33,8 @@ export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"cornerstone-wado-image-loader":
"cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js",
},
},
});

File diff suppressed because it is too large Load Diff