A web-based medical imaging viewer built with FastAPI (Backend) and Vanilla JS / Vite (Frontend). It supports DICOM file uploads, study/series navigation, and advanced visualization tools.
- DICOM Viewing: Load and view MRI/CT/XR studies.
- Tools:
- Window/Level: Adjust brightness and contrast (presets available).
- Pan/Zoom/Rotate: Manipulate images.
- Measurements:
- Ruler: Measure distance (mm/px).
- Angle: Measure 3-point angles (Cobb angle style).
- Pixel Probe: Inspect HU/Signal values at specific coordinates.
- Synchronization: Link scrolling across multiple viewports properly.
- Layouts: Switch between 1x1 and 2x2 grid views.
- Cine Loop: Play through image stacks.
- Python 3.8+
- Node.js 16+
Navigate to the backend directory:
cd backendCreate a virtual environment (recommended):
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun the server:
uvicorn main:app --reload --port 8000The backend API will be available at http://localhost:8000.
Docs are available at http://localhost:8000/docs.
Open a new terminal and navigate to the frontend directory:
cd frontendInstall dependencies:
npm installStart the development server:
npm run devThe application will be accessible at http://localhost:5173 (or proper port shown in terminal).
- Open the web application (
http://localhost:5173). - Upload DICOMs: Drag and drop files onto the viewport or use the "Scan Folder" / "Upload Files" buttons in the Import modal.
- Select Study: Choose a study from the study list.
- Tools: Use the toolbar on the left to measure (Ruler, Angle, Probe), adjust windowing, or change layout.
- Sync: Click the "Link" icon to enable synchronized scrolling for side-by-side comparison.
backend/: FastAPI application, database (SQLite), DICOM storage.routers/: API endpoints (studies, series, instances, upload, probe).dicom_parser.py: Core DICOM processing logic.
frontend/: Vite + Vanilla JS application.src/components/: Reusable UI components (Viewport, Toolbar, etc.).src/services/api.js: API client.src/main.js: Main application entry point.