Skip to main content

Grassroots DICOM runtime libraries

Project description

Python version PyPI version 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-gdcm-3.0.23.1.tar.gz (3.6 MB view hashes)

Uploaded Source

Built Distributions

python_gdcm-3.0.23.1-cp312-cp312-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

python_gdcm-3.0.23.1-cp312-cp312-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.12 Windows x86

python_gdcm-3.0.23.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp312-cp312-macosx_11_0_arm64.whl (12.1 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

python_gdcm-3.0.23.1-cp312-cp312-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

python_gdcm-3.0.23.1-cp311-cp311-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

python_gdcm-3.0.23.1-cp311-cp311-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.11 Windows x86

python_gdcm-3.0.23.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp311-cp311-macosx_11_0_arm64.whl (12.1 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

python_gdcm-3.0.23.1-cp311-cp311-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

python_gdcm-3.0.23.1-cp310-cp310-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

python_gdcm-3.0.23.1-cp310-cp310-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.10 Windows x86

python_gdcm-3.0.23.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp310-cp310-macosx_11_0_arm64.whl (12.1 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

python_gdcm-3.0.23.1-cp310-cp310-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

python_gdcm-3.0.23.1-cp39-cp39-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

python_gdcm-3.0.23.1-cp39-cp39-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.9 Windows x86

python_gdcm-3.0.23.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp39-cp39-macosx_11_0_arm64.whl (12.1 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

python_gdcm-3.0.23.1-cp39-cp39-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

python_gdcm-3.0.23.1-cp38-cp38-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

python_gdcm-3.0.23.1-cp38-cp38-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.8 Windows x86

python_gdcm-3.0.23.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp38-cp38-macosx_11_0_arm64.whl (12.1 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

python_gdcm-3.0.23.1-cp38-cp38-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

python_gdcm-3.0.23.1-cp37-cp37m-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

python_gdcm-3.0.23.1-cp37-cp37m-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.7m Windows x86

python_gdcm-3.0.23.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp37-cp37m-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

python_gdcm-3.0.23.1-cp36-cp36m-win_amd64.whl (28.9 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

python_gdcm-3.0.23.1-cp36-cp36m-win32.whl (24.4 MB view hashes)

Uploaded CPython 3.6m Windows x86

python_gdcm-3.0.23.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

python_gdcm-3.0.23.1-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl (12.9 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686

python_gdcm-3.0.23.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

python_gdcm-3.0.23.1-cp36-cp36m-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page