# sumitlaha/qtdicomviewer architecture

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

- Interactive diagram: https://gitdiagram.com/sumitlaha/qtdicomviewer
- Repository: https://github.com/sumitlaha/qtdicomviewer

## Overview

QtDICOMViewer is a desktop DICOM-series viewer. A user opens a folder; MainWindow enumerates and reads the series, converts it to VTK image data, then displays axial, coronal, and sagittal views and metadata. Scrollbars change each view’s slice, and refresh resets the cameras. The source confirms this core workflow; the README also documents image translation, scaling, and intensity/color interaction, but their implementation details are not shown in the sampled code.

Main entry points: [`mainwindow.cpp`](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp) (Main window), [`main.cpp`](https://github.com/sumitlaha/qtdicomviewer/blob/master/main.cpp) (Qt application), [`mainwindow.ui`](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui) (Slice controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Application workflow"]
  node_application["Qt application<br/>[main.cpp]"]
  node_window["Main window<br/>[mainwindow.cpp]"]
end

subgraph group_imaging["DICOM image pipeline"]
  node_folder["DICOM folder"]
  node_enumerator["Series enumerator<br/>[mainwindow.cpp]"]
  node_gdcm["GDCM image IO<br/>[mainwindow.cpp]"]
  node_reader["Series reader<br/>[mainwindow.cpp]"]
  node_connector["ITK-VTK connector<br/>[mainwindow.cpp]"]
  node_image["VTK image data<br/>[mainwindow.cpp]"]
end

subgraph group_interface["Viewing interface"]
  node_metadata["Metadata table<br/>[mainwindow.ui]"]
  node_views["Three orthogonal views<br/>[mainwindow.cpp]"]
  node_widgets["View widgets<br/>[mainwindow.ui]"]
  node_slice_controls["Slice controls<br/>[mainwindow.ui]"]
  node_refresh["Refresh action<br/>[mainwindow.ui]"]
end

node_user(("User"))

node_user -->|"launches"| node_application
node_application -->|"creates"| node_window
node_user -->|"opens folder"| node_window
node_window -->|"selects"| node_folder
node_window -->|"sets directory"| node_enumerator
node_enumerator -->|"file names"| node_reader
node_window -->|"configures and updates"| node_reader
node_window -->|"sets reader IO"| node_gdcm
node_reader -->|"reads series"| node_gdcm
node_window -->|"sets ITK output"| node_connector
node_connector -->|"reads output"| node_reader
node_window -->|"copies converted output"| node_image
node_connector -->|"provides output"| node_image
node_window -->|"reads metadata"| node_gdcm
node_window -->|"populates"| node_metadata
node_window -->|"sets image and orientations"| node_views
node_image -->|"image input"| node_views
node_views -->|"renders in"| node_widgets
node_user -->|"changes slice"| node_slice_controls
node_slice_controls -->|"dispatches value change"| node_window
node_window -->|"sets slice and renders"| node_views
node_user -->|"activates"| node_refresh
node_refresh -->|"dispatches refresh"| node_window
node_window -->|"resets cameras"| node_views

click node_application "https://github.com/sumitlaha/qtdicomviewer/blob/master/main.cpp"
click node_window "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_enumerator "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_gdcm "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_reader "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_connector "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_image "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_metadata "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui"
click node_views "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp"
click node_widgets "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui"
click node_slice_controls "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui"
click node_refresh "https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui"

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_application,node_window,node_user toneBlue
class node_folder,node_enumerator,node_gdcm,node_reader,node_connector,node_image toneAmber
class node_metadata,node_views,node_widgets,node_slice_controls,node_refresh toneMint
```

## Components

### Application workflow

- [Qt application](https://github.com/sumitlaha/qtdicomviewer/blob/master/main.cpp): `main.cpp`
- [Main window](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`

### DICOM image pipeline

- **DICOM folder**
- [Series enumerator](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`
- [GDCM image IO](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`
- [Series reader](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`
- [ITK-VTK connector](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`
- [VTK image data](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`

### Viewing interface

- [Metadata table](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui): `mainwindow.ui`
- [Three orthogonal views](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.cpp): `mainwindow.cpp`
- [View widgets](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui): `mainwindow.ui`
- [Slice controls](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui): `mainwindow.ui`
- [Refresh action](https://github.com/sumitlaha/qtdicomviewer/blob/master/mainwindow.ui): `mainwindow.ui`

### Other components

- **User**

## Connections

- User → Qt application: launches
- Qt application → Main window: creates
- User → Main window: opens folder
- Main window → DICOM folder: selects
- Main window → Series enumerator: sets directory
- Series enumerator → Series reader: file names
- Main window → Series reader: configures and updates
- Main window → GDCM image IO: sets reader IO
- Series reader → GDCM image IO: reads series
- Main window → ITK-VTK connector: sets ITK output
- ITK-VTK connector → Series reader: reads output
- Main window → VTK image data: copies converted output
- ITK-VTK connector → VTK image data: provides output
- Main window → GDCM image IO: reads metadata
- Main window → Metadata table: populates
- Main window → Three orthogonal views: sets image and orientations
- VTK image data → Three orthogonal views: image input
- Three orthogonal views → View widgets: renders in
- User → Slice controls: changes slice
- Slice controls → Main window: dispatches value change
- Main window → Three orthogonal views: sets slice and renders
- User → Refresh action: activates
- Refresh action → Main window: dispatches refresh
- Main window → Three orthogonal views: resets cameras
