# databricks-industry-solutions/pixels architecture

> Architecture diagram of the GitHub repository databricks-industry-solutions/pixels, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/databricks-industry-solutions/pixels
- Repository: https://github.com/databricks-industry-solutions/pixels

## Overview

Pixels is a Databricks healthcare-imaging solution accelerator: it catalogs DICOM files, extracts and protects metadata, and supports SQL analysis, OHIF viewing, segmentation, and model workflows. The central documented path is catalog → metadata extraction → save for SQL access; interactive viewing and inference use separate app and serving paths. Gateway internals are represented where excerpts establish their role. Several broader capabilities, including training and anonymization, are documented in the README but their implementation details were not sampled.

Main entry points: [`apps/dicom-web-gateway/app.py`](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/app.py) (DICOMweb gateway), [`apps/dicom-web/app.py`](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web/app.py) (OHIF viewer app), [`src/dbx/pixels/catalog.py`](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/catalog.py) (DICOM catalog), [`src/dbx/pixels/dicom/dicom_meta_extractor.py`](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/dicom_meta_extractor.py) (Metadata extractors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingest and protect"]
  node_catalog["DICOM catalog<br/>[catalog.py]"]
  node_extract["Metadata extractors"]
  node_anonymize["Metadata anonymizer"]
  node_redact["Image redaction<br/>[Redactor.py]"]
end

subgraph group_analytics["Metadata analytics"]
  node_catalog_store[("Catalog tables<br/>[catalog.py]")]
  node_sql_analysis["SQL analysis"]
end

subgraph group_viewer["Viewer and DICOMweb"]
  node_viewer_app["OHIF viewer app<br/>[app.py]"]
  node_ohif["OHIF viewer client<br/>[app-config.js]"]
  node_gateway["DICOMweb gateway<br/>[app.py]"]
  node_qido["QIDO search<br/>[_qido.py]"]
  node_wado["WADO retrieval<br/>[_wado.py]"]
  node_stow["STOW ingestion<br/>[_stow.py]"]
  node_nifti["NIfTI overlays<br/>[_nifti.py]"]
  node_file_io["Volume file I/O<br/>[dicom_io.py]"]
end

subgraph group_ai["AI workflows"]
  node_serving["Model serving<br/>[client.py]"]
  node_monai["MONAI inference<br/>[ModelServing.py]"]
  node_training["Model training<br/>[_training.py]"]
end

subgraph group_platform["Shared platform"]
  node_common_routes["Shared app routes<br/>[routes.py]"]
  node_middleware["App middleware<br/>[middleware.py]"]
  node_lakebase[("Lakebase index<br/>[lakebase.py]")]
  node_sql_client["SQL client<br/>[sql_client.py]"]
end

node_user(("Imaging user"))
node_volumes[("Unity Catalog Volumes")]
node_warehouse[("Databricks SQL warehouse")]
node_serving_endpoint["Serving endpoint"]

node_user -->|"catalogs files"| node_catalog
node_catalog -->|"provides catalog"| node_extract
node_extract -->|"saves metadata"| node_catalog_store
node_user -->|"queries metadata"| node_sql_analysis
node_extract -.->|"protects metadata"| node_anonymize
node_user -.->|"protects images"| node_redact
node_user -->|"views and labels"| node_ohif
node_ohif -->|"uses app"| node_viewer_app
node_viewer_app -->|"proxies DICOMweb"| node_gateway
node_gateway -->|"routes search"| node_qido
node_gateway -->|"routes retrieval"| node_wado
node_gateway -->|"routes storage"| node_stow
node_gateway -->|"routes overlays"| node_nifti
node_wado -.->|"reads image bytes"| node_file_io
node_stow -->|"writes instances"| node_file_io
node_file_io -->|"reads and writes"| node_volumes
node_gateway -.->|"queries index"| node_sql_client
node_sql_client -->|"executes SQL"| node_warehouse
node_gateway -->|"uses index cache"| node_lakebase
node_user -->|"requests inference"| node_serving
node_serving -.->|"calls endpoint"| node_serving_endpoint
node_serving_endpoint -.->|"runs model"| node_monai
node_user -->|"launches training"| node_training
node_viewer_app -->|"shares app routes"| node_common_routes
node_common_routes -->|"proxies inference"| node_serving
node_viewer_app -->|"configures requests"| node_middleware
node_catalog -->|"indexes files"| node_volumes

click node_catalog "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/catalog.py"
click node_extract "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/dicom_meta_extractor.py"
click node_anonymize "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/dicom_anonymizer_extractor.py"
click node_redact "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/redactor/Redactor.py"
click node_catalog_store "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/catalog.py"
click node_sql_analysis "https://github.com/databricks-industry-solutions/pixels/blob/main/notebooks/DE-ID/DICOM%20-%20Catalog%20Dataset.py"
click node_viewer_app "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web/app.py"
click node_ohif "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web/ohif/app-config.js"
click node_gateway "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/app.py"
click node_qido "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_qido.py"
click node_wado "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_wado.py"
click node_stow "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_stow.py"
click node_nifti "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_nifti.py"
click node_file_io "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/dicom_io.py"
click node_serving "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/modelserving/client.py"
click node_monai "https://github.com/databricks-industry-solutions/pixels/blob/main/models/monai/ModelServing.py"
click node_training "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/modeltraining/_training.py"
click node_common_routes "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/common/routes.py"
click node_middleware "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/common/middleware.py"
click node_lakebase "https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/lakebase.py"
click node_sql_client "https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/sql_client.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_catalog,node_extract,node_anonymize,node_redact,node_user toneBlue
class node_catalog_store,node_sql_analysis,node_volumes,node_warehouse toneAmber
class node_viewer_app,node_ohif,node_gateway,node_qido,node_wado,node_stow,node_nifti,node_file_io toneMint
class node_serving,node_monai,node_training toneRose
class node_common_routes,node_middleware,node_lakebase,node_sql_client,node_serving_endpoint toneIndigo
```

## Components

### Ingest and protect

- [DICOM catalog](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/catalog.py): `src/dbx/pixels/catalog.py`
- [Metadata extractors](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/dicom_meta_extractor.py): `src/dbx/pixels/dicom/dicom_meta_extractor.py`
- [Metadata anonymizer](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/dicom_anonymizer_extractor.py): `src/dbx/pixels/dicom/dicom_anonymizer_extractor.py`
- [Image redaction](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/dicom/redactor/Redactor.py): `src/dbx/pixels/dicom/redactor/Redactor.py`

### Metadata analytics

- [Catalog tables](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/catalog.py): `src/dbx/pixels/catalog.py`
- [SQL analysis](https://github.com/databricks-industry-solutions/pixels/blob/main/notebooks/DE-ID/DICOM%20-%20Catalog%20Dataset.py): `notebooks/DE-ID/DICOM - Catalog Dataset.py`

### Viewer and DICOMweb

- [OHIF viewer app](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web/app.py): `apps/dicom-web/app.py`
- [OHIF viewer client](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web/ohif/app-config.js): `apps/dicom-web/ohif/app-config.js`
- [DICOMweb gateway](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/app.py): `apps/dicom-web-gateway/app.py`
- [QIDO search](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_qido.py): `apps/dicom-web-gateway/utils/handlers/_qido.py`
- [WADO retrieval](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_wado.py): `apps/dicom-web-gateway/utils/handlers/_wado.py`
- [STOW ingestion](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_stow.py): `apps/dicom-web-gateway/utils/handlers/_stow.py`
- [NIfTI overlays](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/handlers/_nifti.py): `apps/dicom-web-gateway/utils/handlers/_nifti.py`
- [Volume file I/O](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/dicom_io.py): `apps/dicom-web-gateway/utils/dicom_io.py`

### AI workflows

- [Model serving](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/modelserving/client.py): `src/dbx/pixels/modelserving/client.py`
- [MONAI inference](https://github.com/databricks-industry-solutions/pixels/blob/main/models/monai/ModelServing.py): `models/monai/ModelServing.py`
- [Model training](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/modeltraining/_training.py): `src/dbx/pixels/modeltraining/_training.py`

### Shared platform

- [Shared app routes](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/common/routes.py): `src/dbx/pixels/common/routes.py`
- [App middleware](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/common/middleware.py): `src/dbx/pixels/common/middleware.py`
- [Lakebase index](https://github.com/databricks-industry-solutions/pixels/blob/main/src/dbx/pixels/lakebase.py): `src/dbx/pixels/lakebase.py`
- [SQL client](https://github.com/databricks-industry-solutions/pixels/blob/main/apps/dicom-web-gateway/utils/sql_client.py): `apps/dicom-web-gateway/utils/sql_client.py`

### Other components

- **Imaging user**
- **Unity Catalog Volumes**
- **Databricks SQL warehouse**
- **Serving endpoint**

## Connections

- Imaging user → DICOM catalog: catalogs files (evidence: `README.md`)
- DICOM catalog → Metadata extractors: provides catalog (evidence: `README.md`)
- Metadata extractors → Catalog tables: saves metadata (evidence: `README.md`)
- Imaging user → SQL analysis: queries metadata (evidence: `README.md`)
- Metadata extractors → Metadata anonymizer: protects metadata (evidence: `README.md`)
- Imaging user → Image redaction: protects images (evidence: `README.md`)
- Imaging user → OHIF viewer client: views and labels (evidence: `README.md`)
- OHIF viewer client → OHIF viewer app: uses app (evidence: `apps/dicom-web/app.py`)
- OHIF viewer app → DICOMweb gateway: proxies DICOMweb (evidence: `apps/dicom-web/app.py`)
- DICOMweb gateway → QIDO search: routes search (evidence: `apps/dicom-web-gateway/app.py`)
- DICOMweb gateway → WADO retrieval: routes retrieval (evidence: `apps/dicom-web-gateway/app.py`)
- DICOMweb gateway → STOW ingestion: routes storage (evidence: `apps/dicom-web-gateway/app.py`)
- DICOMweb gateway → NIfTI overlays: routes overlays (evidence: `apps/dicom-web-gateway/app.py`)
- WADO retrieval → Volume file I/O: reads image bytes
- STOW ingestion → Volume file I/O: writes instances (evidence: `apps/dicom-web-gateway/utils/handlers/_stow.py`)
- Volume file I/O → Unity Catalog Volumes: reads and writes (evidence: `apps/dicom-web-gateway/utils/dicom_io.py`)
- DICOMweb gateway → SQL client: queries index
- SQL client → Databricks SQL warehouse: executes SQL (evidence: `apps/dicom-web-gateway/utils/sql_client.py`)
- DICOMweb gateway → Lakebase index: uses index cache
- Imaging user → Model serving: requests inference (evidence: `README.md`)
- Model serving → Serving endpoint: calls endpoint
- Serving endpoint → MONAI inference: runs model (evidence: `README.md`)
- Imaging user → Model training: launches training (evidence: `README.md`)
- OHIF viewer app → Shared app routes: shares app routes (evidence: `apps/dicom-web/app.py`)
- Shared app routes → Model serving: proxies inference (evidence: `src/dbx/pixels/common/routes.py`)
- OHIF viewer app → App middleware: configures requests (evidence: `apps/dicom-web/app.py`)
- DICOM catalog → Unity Catalog Volumes: indexes files (evidence: `README.md`)
