Skip to content

Latest commit

Β 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OmniRad Logo

OmniRad

Open-Source AI-Powered Radiology Workstation

Features β€’ Architecture β€’ Getting Started β€’ AI Providers β€’ PACS & DICOM β€’ FHIR R4 β€’ Security β€’ Contributing

Next.js 16 React 19 Tailwind CSS v4 LangGraph Python 3.13 MIT License


πŸ“Έ Screenshots

OmniRad Dashboard β€” Report Generation

Dashboard β€” Generate AI-powered radiology reports from patient data & medical images


OmniRad Reports β€” History & Management

Reports History β€” Review, approve, edit, and export reports with full audit trail


✨ Features

🧠 AI Report Generation

  • Upload medical images (X-Ray, CT, MRI, Ultrasound) with patient context and receive structured, clinically formatted radiology reports in seconds.
  • Powered by LangGraph multi-step agent workflow with structured output parsing and automatic JSON extraction fallback.
  • Reports include Findings (with anatomical regions & status), Impression, Urgency classification, and Recommendations.

πŸ€– AI Copilot Workspace

  • Interactive split-pane workspace combining a DICOM image viewer with a conversational AI assistant.
  • Streaming SSE responses with real-time activity indicators (Thinking β†’ Searching β†’ Fetching β†’ Generating).
  • Natural language commands to search patients, retrieve reports, compare studies, and navigate imaging data.
  • AI-powered image segmentation & annotation β€” ask the copilot to highlight findings, segment structures, or annotate report-grounded observations directly on the image.
  • Annotation styles automatically adapt: arrows for pointing, circles for lesions, bounding boxes for localization, overlays for diffuse findings.
  • Slice navigation β€” ask "take me to the slice with the lesion" and the copilot locates and navigates to the relevant slice.
  • Persistent chat history with session management.

πŸ–ΌοΈ Medical Image Viewing

  • Built-in Cornerstone.js v4 DICOM viewer with full rendering pipeline.
  • Window/Level adjustment, zoom, pan, and standard radiological tools.
  • Support for multi-frame / multi-slice DICOM series with slice navigation.
  • Inline image viewer for standard formats (JPEG, PNG) when DICOM is unavailable.

πŸ₯ PACS / DICOMweb Integration

  • Connect to any Orthanc or DICOMweb-compliant PACS server.
  • Browse, search, and filter studies by patient name, modality, date range, and study description.
  • Pull individual series into the DICOM viewer or directly into report generation.
  • Configurable authentication: None, Basic Auth, or Bearer Token.

πŸ”— HL7 FHIR R4 Integration

  • Expose and consume FHIR R4 resources:
    • Patient β€” demographics mapping
    • DiagnosticReport β€” structured report output
    • ImagingStudy β€” study references
    • ServiceRequest β€” order management
  • Connect to external FHIR servers (Epic, Cerner, HAPI FHIR, etc.) for bidirectional data exchange.

πŸ‘₯ Patient Management

  • Full patient registry with demographics, contact info, and clinical notes.
  • Patient search with fuzzy matching.
  • Timeline view showing all reports, studies, and interactions per patient.
  • Patient-linked reports with cascade deletion.

πŸ“„ Report Management & Export

  • Three built-in report templates: Standard, Modern, and Minimal.
  • Rich inline report editor for radiologist review and modification.
  • Approval workflow β€” Approve, Reject, or mark as Pending with audit logging.
  • PDF export with hospital branding (custom logo + hospital name), digital signature support, and professional formatting.
  • Full report overlay view with section-by-section navigation.

πŸ’Ύ Hybrid Storage Model

Layer Technology Purpose
Local SQLite + Drizzle ORM Primary storage, offline-first, full DICOM image caching
Cloud Supabase (PostgreSQL) Optional cloud sync β€” images are auto-stripped before upload to save bandwidth

πŸ‘€ User Management & Authentication

  • Multi-user support with role-based access (Admin / User).
  • Session-based authentication with secure cookie management.
  • First-run setup wizard for initial admin account creation.
  • App Lock toggle β€” admins can disable login requirements for single-user deployments.
  • Auto-login flow for unlocked mode.

βš™οΈ Flexible AI Configuration

  • Configure separate AI providers for Report Generation and Copilot.
  • Support for multiple LLM providers (see AI Providers).
  • Per-provider settings: model selection, temperature, max tokens, timeout.
  • LangSmith integration for AI observability and tracing.
  • Built-in connection test with automatic model discovery.

🎨 Appearance & Branding

  • Dark / Light mode with zero-flash theme switching.
  • Customizable hospital branding β€” logo upload and hospital name for all exports.
  • Switchable report templates with live preview.

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    OmniRad Application                       β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚   Next.js 16 App   β”‚       β”‚   Python AI Service    β”‚     β”‚
β”‚  β”‚   (React 19 + SSR) │◄─────►│   (FastAPI + LangGraph)β”‚     β”‚
β”‚  β”‚                    β”‚  REST β”‚                        β”‚     β”‚
β”‚  β”‚  β€’ Dashboard       β”‚       β”‚  β€’ Report Generation   β”‚     β”‚
β”‚  β”‚  β€’ Copilot UI      β”‚  SSE  β”‚  β€’ Copilot Agent       β”‚     β”‚
β”‚  β”‚  β€’ PACS Browser    │◄─────►│  β€’ Segmentation        β”‚     β”‚
β”‚  β”‚  β€’ Patient Mgmt    β”‚       β”‚  β€’ AI Annotation       β”‚     β”‚
β”‚  β”‚  β€’ Report Viewer   β”‚       β”‚                        β”‚     β”‚
β”‚  β”‚  β€’ Settings        β”‚       β”‚  Providers:            β”‚     β”‚
β”‚  β”‚  β€’ Admin Panel     β”‚       β”‚  β”œβ”€ Google Gemini      β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚  β”œβ”€ OpenAI / Azure     β”‚     β”‚
β”‚           β”‚                   β”‚  β”œβ”€ Ollama (local)     β”‚     β”‚
β”‚           β”‚                   β”‚  └─ Any OpenAI-compat. β”‚     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚  β”‚     Data Layer     β”‚                                      β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  β”‚ SQLite       β”‚  β”‚  β”‚ Supabase     β”‚ β”‚ PACS/Orthanc β”‚   β”‚
β”‚  β”‚  β”‚ (Drizzle ORM)β”‚  β”‚  β”‚ (Cloud Sync) β”‚ β”‚ (DICOMweb)   β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Component Technology
Frontend Next.js 16, React 19, Tailwind CSS v4
AI Backend Python 3.13, FastAPI, LangGraph, LangChain
DICOM Viewer Cornerstone.js v4 (core + tools + DICOM loader)
Local Database SQLite via better-sqlite3 + Drizzle ORM
Cloud Database Supabase (PostgreSQL)
PDF Export html2pdf.js
Auth bcryptjs + cookie-based sessions
Icons lucide-react
FHIR Custom HL7 FHIR R4 client

πŸš€ Getting Started

Prerequisites

Requirement Version
Node.js β‰₯ 18
Python β‰₯ 3.13
uv latest (install)

Installation

# 1. Clone the repository
git clone https://github.com/omniradiology/omnirad.git
cd omnirad

# 2. Install Node.js dependencies
npm install

# 3. Install Python AI service dependencies
cd ai_service
uv sync
cd ..

Running the App

OmniRad runs two services concurrently β€” the Next.js frontend and the Python AI backend:

# Start both services with a single command
npm run dev

This uses concurrently to launch:

  • Next.js on http://localhost:3000
  • AI Service (FastAPI) on http://localhost:8001

Alternatively, run them separately:

# Terminal 1 β€” Next.js frontend
npm run dev:next

# Terminal 2 β€” Python AI backend
cd ai_service && python -m uv run main.py

First-Time Setup

  1. Open http://localhost:3000 β€” you'll be redirected to the Setup Wizard.
  2. Create your admin account (username, email, password).
  3. Navigate to Settings β†’ AI Configuration to connect your AI provider.
  4. Start generating reports from the Dashboard!

πŸ€– AI Providers

OmniRad supports multiple LLM providers out of the box. Configure them in Settings β†’ AI Configuration:

Provider Type Vision Support Notes
Google Gemini Cloud API βœ… Recommended. Models auto-discovered via API.
OpenAI Cloud API βœ… GPT-4o, GPT-4 Turbo, etc.
Azure OpenAI Cloud API βœ… Use your Azure endpoint URL.
Ollama Local βœ… Run models locally. Zero cloud dependency.
Any OpenAI-compatible Custom API Varies LM Studio, vLLM, Together AI, Groq, etc.

Dual-provider setup: Configure one provider for Report Generation and a different one for AI Copilot (e.g., a fast local model for copilot, a powerful cloud model for reports).

LangSmith Observability

Enable AI tracing by adding your LangSmith API key in the AI configuration panel. All LangGraph runs are automatically traced to your project dashboard.


πŸ₯ PACS & DICOM

Connecting to a PACS Server

  1. Go to Settings β†’ PACS Configuration.
  2. Enter your Orthanc / DICOMweb server URL (e.g., http://localhost:8042).
  3. Select authentication type and provide credentials if required.
  4. Save β€” the PACS browser is now available from the sidebar.

Supported PACS Features

  • Study-level browsing with search filters (patient name, modality, date range)
  • Series-level viewing with thumbnail previews
  • Direct DICOM rendering via Cornerstone.js
  • Import to report β€” pull PACS studies directly into the report generation workflow

πŸ”— FHIR R4 Integration

OmniRad implements an HL7 FHIR R4 interface for healthcare interoperability:

Exposed Resources

Resource Endpoint Description
Patient /api/fhir/Patient Patient demographics
DiagnosticReport /api/fhir/DiagnosticReport Structured radiology reports
ImagingStudy /api/fhir/ImagingStudy Study references & metadata
ServiceRequest /api/fhir/ServiceRequest Radiology orders

External FHIR Server

Connect to external FHIR servers (Epic, Cerner, HAPI FHIR) via the Settings β†’ FHIR Integration panel to enable bidirectional patient and report exchange.


πŸ”’ Security & Compliance

OmniRad includes built-in security features designed with healthcare compliance in mind:

Feature Implementation
Audit Trail Immutable audit logs for all PHI access and modifications (HIPAA Β§164.312(b))
PHI Redaction Automatic redaction of Protected Health Information from server logs
Role-Based Access Admin / User roles with route-level authorization
Rate Limiting Per-endpoint rate limiting to prevent abuse
Secrets Management Encrypted storage for API keys and credentials
Session Security Secure, httpOnly cookie-based sessions with expiration
RBAC Enforcement Server-side authorization checks on all API routes
Safe Logging PHI-aware logging utilities (safeLog, safeError, safeWarn)

⚠️ Disclaimer: OmniRad is an open-source project and is not certified for clinical use. Always consult with your compliance team before deploying in a production healthcare environment. AI-generated reports must be reviewed by a qualified radiologist.


πŸ—„οΈ Supabase Cloud Sync (Optional)

Enable cloud sync to access your reports from any device:

  1. Create a project at supabase.com.
  2. Run the following SQL in your Supabase SQL Editor:
-- Create the reports table
CREATE TABLE public.reports (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  created_at TIMESTAMPTZ DEFAULT timezone('utc'::text, now()) NOT NULL,
  patient_name TEXT,
  modality TEXT,
  urgency TEXT,
  report_status TEXT DEFAULT 'Pending',
  report_data JSONB NOT NULL
);

-- Enable Row Level Security
ALTER TABLE public.reports ENABLE ROW LEVEL SECURITY;

-- Create access policy (restrict in production)
CREATE POLICY "Enable all access for all users" ON public.reports
  FOR ALL USING (true) WITH CHECK (true);
  1. Copy your Project URL and Anon Key from Supabase β†’ Settings β†’ API.
  2. Paste them into OmniRad Settings β†’ Cloud Sync.

Note: DICOM images are automatically stripped before cloud upload to minimize bandwidth and storage costs. Full image data is always retained locally.


πŸ“ Project Structure

omnirad/
β”œβ”€β”€ app/                     # Next.js App Router pages
β”‚   β”œβ”€β”€ api/                 # API routes (REST + FHIR)
β”‚   β”‚   β”œβ”€β”€ ai-config/       # AI provider management
β”‚   β”‚   β”œβ”€β”€ auth/            # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ compliance/      # Compliance & audit APIs
β”‚   β”‚   β”œβ”€β”€ copilot/         # Copilot proxy endpoints
β”‚   β”‚   β”œβ”€β”€ fhir/            # FHIR R4 resource endpoints
β”‚   β”‚   β”œβ”€β”€ pacs/            # PACS/DICOMweb proxy
β”‚   β”‚   β”œβ”€β”€ patients/        # Patient CRUD
β”‚   β”‚   β”œβ”€β”€ reports/         # Report CRUD & export
β”‚   β”‚   └── settings/        # App configuration
β”‚   β”œβ”€β”€ copilot/             # AI Copilot workspace page
β”‚   β”œβ”€β”€ history/             # Report history page
β”‚   β”œβ”€β”€ login/               # Login page
β”‚   β”œβ”€β”€ pacs/                # PACS browser page
β”‚   β”œβ”€β”€ patients/            # Patient management page
β”‚   β”œβ”€β”€ reports/             # Report detail pages
β”‚   β”œβ”€β”€ settings/            # Settings page
β”‚   β”œβ”€β”€ setup/               # First-run setup wizard
β”‚   └── page.tsx             # Dashboard (report generation)
β”œβ”€β”€ ai_service/              # Python AI backend
β”‚   β”œβ”€β”€ agent/               # LangGraph agent workflows
β”‚   β”‚   β”œβ”€β”€ workflow.py      # Report generation pipeline
β”‚   β”‚   β”œβ”€β”€ copilot_workflow.py   # Copilot chat agent
β”‚   β”‚   β”œβ”€β”€ copilot_tools.py     # LangChain tools (search, retrieve, view)
β”‚   β”‚   └── segmentation_tools.py # AI segmentation & annotation
β”‚   β”œβ”€β”€ models/              # Pydantic models & AI model services
β”‚   β”œβ”€β”€ main.py              # FastAPI entry point
β”‚   └── pyproject.toml       # Python dependencies (uv)
β”œβ”€β”€ components/              # React UI components
β”‚   β”œβ”€β”€ copilot/             # Copilot workspace components
β”‚   β”œβ”€β”€ dashboard/           # Dashboard & report generation
β”‚   β”œβ”€β”€ pacs/                # PACS browser components
β”‚   β”œβ”€β”€ patients/            # Patient management UI
β”‚   β”œβ”€β”€ settings/            # Settings panels
β”‚   β”œβ”€β”€ admin/               # Admin panel (audit logs)
β”‚   β”œβ”€β”€ layout/              # App shell (sidebar, header)
β”‚   └── ui/                  # Shared UI primitives
β”œβ”€β”€ db/                      # Database schema & migrations
β”‚   β”œβ”€β”€ schema.ts            # Drizzle ORM schema definitions
β”‚   └── index.ts             # Database connection & initialization
β”œβ”€β”€ lib/                     # Shared utilities
β”‚   β”œβ”€β”€ api.ts               # Client-side API helpers
β”‚   β”œβ”€β”€ fhir/                # FHIR R4 resource builders
β”‚   β”œβ”€β”€ pacs/                # DICOMweb client utilities
β”‚   β”œβ”€β”€ security/            # Audit, RBAC, PHI redaction, rate limiting
β”‚   β”œβ”€β”€ dicomImageExtractor.ts
β”‚   β”œβ”€β”€ dicomMetadataParser.ts
β”‚   β”œβ”€β”€ pdfHelper.ts         # PDF generation
β”‚   └── reportHtmlGenerator.ts # Report template renderer
β”œβ”€β”€ types/                   # TypeScript type definitions
β”œβ”€β”€ public/                  # Static assets (logos, icons)
β”œβ”€β”€ drizzle.config.ts        # Drizzle ORM configuration
β”œβ”€β”€ middleware.ts             # Auth & setup middleware
β”œβ”€β”€ next.config.ts           # Next.js configuration
└── package.json

🀝 Contributing

Contributions are welcome! To get started:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m "feat: add amazing feature"
  4. Push to your branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Notes

  • The app uses Tailwind CSS v4 with CSS custom properties for theming.
  • Database migrations are managed via Drizzle Kit (drizzle-kit push or manual migration scripts).
  • The AI service uses uv for Python dependency management.
  • All AI-related API calls are proxied through the Next.js backend to the FastAPI service.

πŸ“„ License

This project is released under the MIT License. See LICENSE for details.


Built with ❀️ by the OmniRadiology community

About

OpenRad: AI-Assisted Radiology Report Generation Platform Your Team

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages