# malaterre/gdcm architecture

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

- Interactive diagram: https://gitdiagram.com/malaterre/gdcm
- Repository: https://github.com/malaterre/gdcm

## Overview

GDCM is a DICOM library for representing and processing medical-imaging data, with additional DICOM network and VTK integration. A typical user workflow is to read a DICOM file into structured data, inspect or modify its tags and pixel values, then write or transform the result. The tree and excerpts identify the main data-model, image, and networking subsystems, but do not expose the complete reader/writer or codec call paths; those relationships are therefore left unasserted or shown as unverified.

Main entry points: [`Source/DataStructureAndEncodingDefinition/gdcmDataElement.h`](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h) (Data elements), [`Source/DataStructureAndEncodingDefinition/gdcmReader.h`](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmReader.h) (DICOM reader), [`Source/DataStructureAndEncodingDefinition/gdcmDataSet.h`](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h) (Data sets), [`Source/DataStructureAndEncodingDefinition/gdcmWriter.h`](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmWriter.h) (DICOM writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["DICOM data model"]
  node_reader["DICOM reader<br/>[gdcmReader.h]"]
  node_tag["Tag identity<br/>[gdcmTag.h]"]
  node_value["Byte values<br/>[gdcmByteValue.h]"]
  node_element["Data elements<br/>[gdcmDataElement.h]"]
  node_dataset["Data sets<br/>[gdcmDataSet.h]"]
  node_dictionary["Tag dictionary<br/>[gdcmTagToType.h]"]
  node_uids["UID definitions<br/>[gdcmUIDs.h]"]
  node_writer["DICOM writer<br/>[gdcmWriter.h]"]
end

subgraph group_image["Image processing"]
  node_imageio["Image readers and writers<br/>[gdcmImageReader.h]"]
  node_imagefilters["Image filters"]
  node_imagecodecs["Image codecs<br/>[gdcmImageCodec.h]"]
  node_anonymizer["Anonymization<br/>[gdcmAnonymizer.h]"]
end

subgraph group_network["DICOM networking"]
  node_query["DICOM queries"]
  node_connection["UL connections"]
end

subgraph group_integration["User integrations"]
  node_vtk["VTK adapters"]
  node_python["Python examples<br/>[lib.py]"]
end

node_user(("Library user"))
node_dicomfile["DICOM file"]

node_user -.->|"requests read"| node_reader
node_dicomfile -.->|"input"| node_reader
node_reader -.->|"produces data"| node_dataset
node_dataset -->|"stores elements"| node_element
node_element -->|"uses tag"| node_tag
node_element -->|"uses bytes"| node_value
node_element -->|"typed by"| node_dictionary
node_user -.->|"requests write"| node_writer
node_writer -.->|"output"| node_dicomfile
node_user -.->|"requests image access"| node_imageio
node_imageio -.->|"uses codecs"| node_imagecodecs
node_user -.->|"requests transform"| node_imagefilters
node_user -.->|"requests anonymization"| node_anonymizer
node_user -.->|"creates query"| node_query
node_query -->|"uses dataset"| node_dataset
node_user -.->|"starts exchange"| node_connection
node_user -.->|"uses adapter"| node_vtk
node_user -.->|"uses examples"| node_python

click node_reader "https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmReader.h"
click node_tag "https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmTag.h"
click node_value "https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmByteValue.h"
click node_element "https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h"
click node_dataset "https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h"
click node_dictionary "https://github.com/malaterre/gdcm/blob/master/Source/DataDictionary/gdcmTagToType.h"
click node_uids "https://github.com/malaterre/gdcm/blob/master/Source/DataDictionary/gdcmUIDs.h"
click node_writer "https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmWriter.h"
click node_imageio "https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmImageReader.h"
click node_imagefilters "https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmImageToImageFilter.h"
click node_imagecodecs "https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmImageCodec.h"
click node_anonymizer "https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmAnonymizer.h"
click node_query "https://github.com/malaterre/gdcm/blob/master/Source/MessageExchangeDefinition/gdcmBaseRootQuery.h"
click node_connection "https://github.com/malaterre/gdcm/blob/master/Source/MessageExchangeDefinition/gdcmULConnectionManager.h"
click node_vtk "https://github.com/malaterre/gdcm/blob/master/Utilities/VTK/vtkGDCMImageReader.h"
click node_python "https://github.com/malaterre/gdcm/blob/master/Applications/Python/lib.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_reader,node_tag,node_value,node_element,node_dataset,node_dictionary,node_uids,node_writer,node_user toneBlue
class node_imageio,node_imagefilters,node_imagecodecs,node_anonymizer toneAmber
class node_query,node_connection toneMint
class node_vtk,node_python toneRose
class node_dicomfile toneIndigo
```

## Components

### DICOM data model

- [DICOM reader](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmReader.h): `Source/DataStructureAndEncodingDefinition/gdcmReader.h`
- [Tag identity](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmTag.h): `Source/DataStructureAndEncodingDefinition/gdcmTag.h`
- [Byte values](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmByteValue.h): `Source/DataStructureAndEncodingDefinition/gdcmByteValue.h`
- [Data elements](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmDataElement.h): `Source/DataStructureAndEncodingDefinition/gdcmDataElement.h`
- [Data sets](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h): `Source/DataStructureAndEncodingDefinition/gdcmDataSet.h`
- [Tag dictionary](https://github.com/malaterre/gdcm/blob/master/Source/DataDictionary/gdcmTagToType.h): `Source/DataDictionary/gdcmTagToType.h`
- [UID definitions](https://github.com/malaterre/gdcm/blob/master/Source/DataDictionary/gdcmUIDs.h): `Source/DataDictionary/gdcmUIDs.h`
- [DICOM writer](https://github.com/malaterre/gdcm/blob/master/Source/DataStructureAndEncodingDefinition/gdcmWriter.h): `Source/DataStructureAndEncodingDefinition/gdcmWriter.h`

### Image processing

- [Image readers and writers](https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmImageReader.h): `Source/MediaStorageAndFileFormat/gdcmImageReader.h`
- [Image filters](https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmImageToImageFilter.h): `Source/MediaStorageAndFileFormat/gdcmImageToImageFilter.h`
- [Image codecs](https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmImageCodec.h): `Source/MediaStorageAndFileFormat/gdcmImageCodec.h`
- [Anonymization](https://github.com/malaterre/gdcm/blob/master/Source/MediaStorageAndFileFormat/gdcmAnonymizer.h): `Source/MediaStorageAndFileFormat/gdcmAnonymizer.h`

### DICOM networking

- [DICOM queries](https://github.com/malaterre/gdcm/blob/master/Source/MessageExchangeDefinition/gdcmBaseRootQuery.h): `Source/MessageExchangeDefinition/gdcmBaseRootQuery.h`
- [UL connections](https://github.com/malaterre/gdcm/blob/master/Source/MessageExchangeDefinition/gdcmULConnectionManager.h): `Source/MessageExchangeDefinition/gdcmULConnectionManager.h`

### User integrations

- [VTK adapters](https://github.com/malaterre/gdcm/blob/master/Utilities/VTK/vtkGDCMImageReader.h): `Utilities/VTK/vtkGDCMImageReader.h`
- [Python examples](https://github.com/malaterre/gdcm/blob/master/Applications/Python/lib.py): `Applications/Python/lib.py`

### Other components

- **Library user**
- **DICOM file**

## Connections

- Library user → DICOM reader: requests read
- DICOM file → DICOM reader: input
- DICOM reader → Data sets: produces data
- Data sets → Data elements: stores elements (evidence: `Source/DataStructureAndEncodingDefinition/gdcmDataSet.h`)
- Data elements → Tag identity: uses tag (evidence: `Source/DataStructureAndEncodingDefinition/gdcmDataElement.h`)
- Data elements → Byte values: uses bytes (evidence: `Source/DataStructureAndEncodingDefinition/gdcmDataElement.h`)
- Data elements → Tag dictionary: typed by (evidence: `Source/DataStructureAndEncodingDefinition/gdcmAttribute.h`)
- Library user → DICOM writer: requests write
- DICOM writer → DICOM file: output
- Library user → Image readers and writers: requests image access
- Image readers and writers → Image codecs: uses codecs
- Library user → Image filters: requests transform
- Library user → Anonymization: requests anonymization
- Library user → DICOM queries: creates query
- DICOM queries → Data sets: uses dataset (evidence: `Source/MessageExchangeDefinition/gdcmBaseRootQuery.h`)
- Library user → UL connections: starts exchange
- Library user → VTK adapters: uses adapter
- Library user → Python examples: uses examples
