python-gdcm 3.2.2


pip install python-gdcm

  Latest version

Released: Oct 06, 2025

Project Links

Meta
Author: Thiago Franco de Moraes
Requires Python: >=3.7

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers
  • Science/Research

License
  • OSI Approved :: Apache Software License

Operating System
  • MacOS
  • Microsoft :: Windows
  • POSIX
  • Unix

Programming Language
  • C
  • Python
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: Implementation :: CPython

Topic
  • Scientific/Engineering

Python version PyPI version python-gdcm Downloads Last Month Downloads

Python-GDCM

Unofficial GDCM packages for Python 3 on Linux, Windows and MacOS (both Intel and Apple Silicon).

Grassroots DiCoM is a C++ library for DICOM medical files that can be wrapped for Python using SWIG. It supports datasets encoded using native, JPEG, JPEG 2000, JPEG-LS, RLE and deflated transfer syntaxes. It also comes with Parts 3, 6 & 7 of the DICOM Standard as XML files.

Installation

Using pip

pip install -U python-gdcm

From source

Install dependencies

  • Compiler for you platform (GCC, Clang, MSVC)
  • CMake
  • SWIG
  • patchelf will also be needed on Linux
  • Git to get the source code

Setup environment

If the cmake or swig executables aren't in $PATH, either add them or create CMAKE_EXE and SWIG_EXE envars:

export CMAKE_EXE="path/to/cmake/executable"
export SWIG_EXE="path/to/swig/executable"

Clone source

git clone --recurse-submodules https://github.com/tfmoraes/python-gdcm

Build and install

# Note the trailing slash!
pip install python-gdcm/

Test installed package

python -c "import gdcm; print(gdcm.GDCM_VERSION)"

If you get a ModuleNotFoundError: No module named '_gdcm.gdcmswig' error then make sure your current working directory doesn't contain a _gdcm folder.

Usage

Reading a DICOM image file

import gdcm
reader = gdcm.ImageReader()
reader.SetFileName("dicom_image_file.dcm")
ret = reader.Read()
if not ret:
    print("It was not possible to read your DICOM file")

Other Examples

See here https://github.com/malaterre/GDCM/tree/master/Examples/Python

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 CPython 3.14
macosx_10_13_x86_64
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux_2_27_aarch64
manylinux_2_27_x86_64
manylinux_2_28_aarch64
manylinux_2_28_x86_64
win_amd64

Files in release

python_gdcm-3.2.2-cp310-cp310-macosx_10_9_x86_64.whl (10.9MiB)
python_gdcm-3.2.2-cp310-cp310-macosx_11_0_arm64.whl (10.1MiB)
python_gdcm-3.2.2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (11.7MiB)
python_gdcm-3.2.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.6MiB)
python_gdcm-3.2.2-cp310-cp310-win_amd64.whl (32.6MiB)
python_gdcm-3.2.2-cp311-cp311-macosx_10_9_x86_64.whl (10.9MiB)
python_gdcm-3.2.2-cp311-cp311-macosx_11_0_arm64.whl (10.1MiB)
python_gdcm-3.2.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (11.7MiB)
python_gdcm-3.2.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.6MiB)
python_gdcm-3.2.2-cp311-cp311-win_amd64.whl (32.6MiB)
python_gdcm-3.2.2-cp312-cp312-macosx_10_13_x86_64.whl (10.8MiB)
python_gdcm-3.2.2-cp312-cp312-macosx_11_0_arm64.whl (10.2MiB)
python_gdcm-3.2.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (11.7MiB)
python_gdcm-3.2.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.6MiB)
python_gdcm-3.2.2-cp312-cp312-win_amd64.whl (32.6MiB)
python_gdcm-3.2.2-cp313-cp313-macosx_10_13_x86_64.whl (10.8MiB)
python_gdcm-3.2.2-cp313-cp313-macosx_11_0_arm64.whl (10.2MiB)
python_gdcm-3.2.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (11.7MiB)
python_gdcm-3.2.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.6MiB)
python_gdcm-3.2.2-cp313-cp313-win_amd64.whl (32.6MiB)
python_gdcm-3.2.2-cp314-cp314-macosx_10_13_x86_64.whl (10.8MiB)
python_gdcm-3.2.2-cp314-cp314-macosx_11_0_arm64.whl (10.2MiB)
python_gdcm-3.2.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (11.7MiB)
python_gdcm-3.2.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.6MiB)
python_gdcm-3.2.2-cp314-cp314-win_amd64.whl (33.1MiB)
python_gdcm-3.2.2-cp39-cp39-macosx_10_9_x86_64.whl (10.9MiB)
python_gdcm-3.2.2-cp39-cp39-macosx_11_0_arm64.whl (10.1MiB)
python_gdcm-3.2.2-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (11.7MiB)
python_gdcm-3.2.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (12.6MiB)
python_gdcm-3.2.2-cp39-cp39-win_amd64.whl (32.6MiB)
python_gdcm-3.2.2.tar.gz (3.2MiB)
No dependencies