feat(node): move to node 20 (#4594)
This commit is contained in:
1 parent
ab41183ce5
commit
1f04d6c1be
24 files changed
+173
-135
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -3,45 +3,98 @@ sidebar_position: 5
|
||||
sidebar_label: Static Files
|
||||
---
|
||||
|
||||
# Static Files
|
||||
|
||||
There is a binary DICOM to static file generator, which provides easily served
|
||||
binary files. The files are all compressed in order to reduce space
|
||||
significantly, and are pre-computed for the files required for OHIF, so that the
|
||||
performance of serving the files is just the read from disk/write to http stream
|
||||
time, without any extra processing time.
|
||||
# Static DICOMweb Files for Enhanced Performance
|
||||
|
||||
The project for the static wado files is located here: [static-wado]:
|
||||
https://github.com/OHIF/static-wado
|
||||
This section describes how to generate and serve static DICOMweb files, significantly improving the performance of your OHIF Viewer setup. These files are pre-processed and compressed, minimizing storage space and reducing serving time to the bare minimum (disk read and HTTP stream write).
|
||||
|
||||
It can be compiled with Java and Gradle, and then run against a set of dicom, in
|
||||
the example located in /dicom/study1 outputting to /dicomweb, and then a server
|
||||
run against that data, like this:
|
||||
## Static-DICOMWeb Project
|
||||
|
||||
```bash
|
||||
git clone https://github.com/OHIF/static-wado
|
||||
cd static-wado
|
||||
./gradlew installDist
|
||||
StaticWado/build/install/StaticWado/bin/StaticWado -d /dicomweb /dicom/study1
|
||||
cd /dicomweb
|
||||
npx http-server -p 5000 --cors -g
|
||||
The core tool for this process is the `static-wado` project, available on GitHub:
|
||||
|
||||
# you can use npx serve ./dist -l 8080 -c ../public/serve.json as an alternative to http-server
|
||||
```
|
||||
[static-wado]: https://github.com/RadicalImaging/Static-DICOMWeb
|
||||
|
||||
There is then a dev environment in the platform/app directory which can be
|
||||
run against those files, like this:
|
||||
This project contains two main components:
|
||||
|
||||
```
|
||||
cd platform/app
|
||||
yarn dev:static
|
||||
```
|
||||
* **`static-wado-creator`:** Converts raw DICOM files into a DICOMweb-compliant directory structure, optimizing them for efficient serving.
|
||||
* **`static-wado-webserver`:** A simple web server specifically designed to serve the generated static DICOMweb files.
|
||||
|
||||
Additional studies can be added to the dicomweb by re-running the StaticWado
|
||||
command. It will create a single studies.gz index file (JSON DICOM file,
|
||||
compressed) containing an index of all studies created. There is then a small
|
||||
extension to OHIF which performs client side indexing.
|
||||
## Prerequisites
|
||||
|
||||
The StaticWado command also knows how to deploy a client and dicomweb directory
|
||||
to Amazon s3, which can then server files up directly. There is another build
|
||||
setup build:aws in the viewer package.json to create such a deployment.
|
||||
- Node.js and npm (or yarn) installed on your system.
|
||||
|
||||
## Installation
|
||||
|
||||
1. **Clone the Repository:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/RadicalImaging/Static-DICOMWeb
|
||||
cd Static-DICOMWeb
|
||||
```
|
||||
|
||||
2. **Install Dependencies:**
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
## Generating Static DICOMweb Files
|
||||
|
||||
1. **Prepare your DICOM data:** Organize your DICOM files into a directory. For example `/Users/alireza/dicom/test-static-script/ACRIN-CT`.
|
||||
|
||||
2. **Convert to DICOMweb Structure:**
|
||||
Use the `mkdicomweb.js` script from the `static-wado-creator` package to create the DICOMweb directory:
|
||||
|
||||
```bash
|
||||
node packages/static-wado-creator/bin/mkdicomweb.js '/Users/alireza/dicom/test-static-script/ACRIN-CT' -o '/Users/alireza/dicom/test-static-script/output'
|
||||
```
|
||||
|
||||
* **Replace:**
|
||||
* `/Users/alireza/dicom/test-static-script/ACRIN-CT` with the path to your directory of DICOM files.
|
||||
* `/Users/alireza/dicom/test-static-script/output` with your desired output directory for the DICOMweb structure.
|
||||
|
||||
This command will generate a directory structure similar to this in your output location:
|
||||
|
||||

|
||||
|
||||
## Serving Static Files with the Web Server
|
||||
|
||||
1. **Start the Server:**
|
||||
|
||||
Run the `dicomwebserver.mjs` script from the `static-wado-webserver` package, specifying the port and the DICOMweb directory:
|
||||
|
||||
```bash
|
||||
node packages/static-wado-webserver/bin/dicomwebserver.mjs -p 3001 -o /Users/alireza/dicom/test-static-script/output
|
||||
```
|
||||
|
||||
* **`-p 3001`:** Sets the server to listen on port 3001. You can change this if needed.
|
||||
* **`-o /Users/alireza/dicom/test-static-script/output`:** Specifies the path to your generated DICOMweb directory.
|
||||
|
||||
:::info
|
||||
The `-p` (port) and `-o` (output directory) flags are used to configure the server.
|
||||
:::
|
||||
|
||||
## Running OHIF Viewer with Static Data
|
||||
|
||||
1. **Use the `local_static.js` Configuration:**
|
||||
|
||||
Start the OHIF Viewer in development mode using the provided `local_static.js` configuration file:
|
||||
|
||||
```bash
|
||||
yarn dev:static
|
||||
```
|
||||
|
||||
2. **Configuration Details:**
|
||||
|
||||
The `local_static.js` configuration file is pre-configured to point to:
|
||||
|
||||
```js
|
||||
qidoRoot: 'http://localhost:3001/dicomweb',
|
||||
wadoRoot: 'http://localhost:3001/dicomweb',
|
||||
```
|
||||
|
||||
This matches the default port (3001) used by the `static-wado-webserver`.
|
||||
|
||||
:::info
|
||||
If you change the port or output directory when running the `static-wado-webserver`, you **must** also update the `qidoRoot` and `wadoRoot` values in your `local_static.js` configuration file accordingly to ensure the OHIF Viewer can access the data.
|
||||
:::
|
||||
@@ -16,7 +16,7 @@
|
||||
[build.environment]
|
||||
# If 'production', `yarn install` does not install devDependencies
|
||||
NODE_ENV = "development"
|
||||
NODE_VERSION = "18.16.1"
|
||||
NODE_VERSION = "20.18.1"
|
||||
YARN_VERSION = "1.22.5"
|
||||
RUBY_VERSION = "2.6.2"
|
||||
YARN_FLAGS = "--no-ignore-optional --pure-lockfile"
|
||||
|
||||
Reference in new issue
Block a user