Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Viewers | 2,393 | 5 | 14 | a day ago | 38 | November 30, 2020 | 752 | mit | TypeScript | |
OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages | ||||||||||
Dicoogle | 350 | 3 months ago | 60 | gpl-3.0 | Java | |||||
Dicoogle - Open Source PACS | ||||||||||
U Dicom Viewer | 107 | 6 months ago | 36 | mit | JavaScript | |||||
A simple web browser DICOM viewer for any device. | ||||||||||
React Cornerstone Viewport | 79 | 9 | 8 | 9 months ago | 69 | August 26, 2022 | 30 | mit | JavaScript | |
Cornerstone medical image viewport component for React | ||||||||||
React Viewerbase | 75 | 1 | 3 | 4 years ago | 69 | July 26, 2019 | mit | JavaScript | ||
Core medical image viewer components built using React | ||||||||||
Dwv React | 69 | 2 days ago | 6 | gpl-3.0 | Java | |||||
Medical image viewer using DWV (DICOM Web Viewer) and React. | ||||||||||
Rocket_viewer | 19 | 5 years ago | n,ull | JavaScript | ||||||
This simple and generic viewer allows you to visualize different kinds of data such as medical and biological images, 3D surfaces, electric signals (ECGs) and documents. | ||||||||||
Embedded Pydicom React Viewer | 16 | 2 years ago | other | |||||||
Medical DICOM file P10 Viewer/Chrome Extension + 🐍 Python 🐍 Code In Browser (-Pyodide-> WebAssembly) + Pydicom parser + TypeScript React App (CRA) + Python FastAPI Server Deployment | ||||||||||
React Cornerstone Example | 15 | 5 years ago | 1 | mit | JavaScript | |||||
example integrating react with cornerstone.js library for viewing DICOM medical images | ||||||||||
Dicom Viewer | 3 | 5 months ago | 1 | TypeScript | ||||||
🩺 Simple DICOM viewer created using web technologies |
This experimental project demonstrates
Tested on macOS Big Sur (intel/M1), Chrome 89.
Its usage is simple. Just drag a DICOM file into the panel to view.
Download DICOM files from DICOM sample file sites
more complete list is on https://github.com/grimmer0125/dicom-web-viewer/wiki and (0028,3000) Modality LUT Sequence present DICOM & PALETTE COLOR are already supported in this project.
The Chrome extension is published, click there to install.
Besides it is an interesting thing to use Python in browser, using Python DICOM parser has some advantages.
OT-MONO2-8-hip.dcm from https://barre.dev/medical/samples/
ref:
Please use VS Code and bulit-in TypeScript/Python formatter setting. Please install Python autopep8 out of thie project environment and mare sure the VS Code setting. Also, you can enable "format on save".
The current code uses local built Pyodide 0.18.0 version to speed up loading instead of CDN, just download it once. The zip file is https://github.com/grimmer0125/embedded-pydicom-react-viewer/releases/download/untagged-77e55ea5908aaad294e1/pyodide.zip and you can just execute
$ sh download_pyodide.sh
in terminal which will download+unzip+move to public/pyodide
. These Pyodide fiels were download from https://cdn.jsdelivr.net/
, not built from scratch.
Or you can comment these
<script src="pyodide/pyodide.js"></script>
await loadPyodide({ indexURL : "pyodide/" });
await micropip.install('pyodide/pydicom-2.2.1-py3-none-any.whl')
and replace by below to fetch from CDN
<script src="https://cdn.jsdelivr.net/pyodide/dev/full/pyodide.js"></script>
await loadPyodide({ indexURL : "https://cdn.jsdelivr.net/pyodide/dev/full/" });
await micropip.install('pydicom')
nvm-sh/nvm January 2021: there are no pre-compiled NodeJS binaries for versions prior to 15.x for Apple's new M1 chip (arm64 architecture). v14.16 supports M1 but need compilation (auto done by nvm). p.s. nvm seems to still build 15.14.0
Make sure you have Node.js (v15.14.0+), Python (3.9.2+) and Poetry installed first. (Optional) pyenv is recommended to switch different Python and it will automatically switch to 3.9.2 since .python-version is created.
Python is to help Python static code analysing and code completion and host built-react code. For example, you install pydicom from wheel url and use it in runtime but you can install pydicom (poetry add pydicom -dev
) to help the auto type completion in VSCode.
Then
git submodule update --init --recursive
npm install --global yarn
yarn install
poetry shell
poetry install
Just yarn start
(it may take a whlie for the 1st time since WebAssembly decoder is added)
yarn build
to build reactapp
To launch FastAPI,
either
$ poetry shell
$ uvicorn main:app
or
$ poetry run uvicorn main:app
Using uvicorn main:app --reload
is for development but we already have create react app built-in development live server.
Building from latest code is not working now and wait for fix. yarn build
happens out of memory error when building, and it probably is due to WebAssembly decoder.
docker build --progress=plain -t pyodide-react-dicom-viewer .
docker run -p 8000:8000 -d pyodide-react-dicom-viewer
Cross compliation for intel/m1 takes much more time than normal docker build
. Building + Pushing to docker hub takes 20~30min. Several times.
docker buildx create --use --name m1_builder
docker buildx use m1_builder
docker buildx inspect --bootstrap
docker buildx build --platform linux/amd64,linux/arm64 --push -t grimmer0125/pyodide-react-dicom-viewer:0.5 .
Image: https://hub.docker.com/repository/docker/grimmer0125/pyodide-react-dicom-viewer
docker run -p 8000:8000 grimmer0125/pyodide-react-dicom-viewer:0.5
DICOM jpeg 1.2.840.10008.1.2.4.50
git clone git://git.code.sf.net/p/gdcm/gdcmdata
Most of them are archived on https://github.com/grimmer0125/embedded-pydicom-react-viewer/releases/download/v0.2/dicom_samples.zip. All jpeg compressed DICOM files need a extra JPEG decoder (except 50 baseline) to render on browser and currently it is parsed but not visible on browser. [Daikon][https://github.com/rii-mango/daikon] has done this, and cornerstonejs/dicomParser seems too. The project already borrow the decoder from Dakon.
https://barre.dev/medical/samples/:
https://github.com/pydicom/pydicom-data/tree/master/data_store/data
https://github.com/pydicom/pydicom/tree/master/pydicom/data/test_files
GDCM data, use git://git.code.sf.net/p/gdcm/gdcmdata
to download
https://www.dclunie.com/images/compressed/index.html
pydicom suported transfer syntax: https://pydicom.github.io/pydicom/dev/old/image_data_handlers.html
Below non handled items are done in another project grimmer0125/dicom-web-viewer (canvas operation is borrowed from this)
Transfer Syntax for videos (1.2.840.10008.1.2.4.100 / 1.2.840.10008.1.2.4.102 / 1.2.840.10008.1.2.4.103) and some other not often seen syntax will not be handled. ref https://www.dicomlibrary.com/dicom/transfer-syntax/
[Solved][performance] Using Python numpy in browser is slow in some cases (see below Speed test), it takes 3~4s
for 1 512*512 array operation. Using pure JavaScript takes less than 0.5s. Ref: https://github.com/pyodide/pyodide/issues/112 (the author said WebAssembly may takes 3~5x
slow). The solution might be
219299f9adec489134206faf0cfab79d8345a7df
), using pydicom to parse DICOM files, sending pixel data to JS, then use JS to flatten 2D grey data to 1D RGBA canvas image data.~~Speed test (using above sample file to test, file: OT-MONO2-8-hip.dcm
on https://barre.dev/medical/samples/):
p.s.
Besides adding back above medical file cases/features, there are some optional things we can do
pyodide micropip
to install them from PyPI). e.g. pydicom-2.1.2-py3-none-any.whl (1.9MB)This project is using my another TypeScript npm library, d4c-queue, and code is on https://github.com/grimmer0125/d4c-queue/. You can take a look.