scaramallion / python-gdcm

GDCM Packaging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python-GDCM

Unoficial GDCM packages for Python.

Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports RAW,JPEG (lossy/lossless),J2K,JPEG-LS, RLE and deflated. It also comes with DICOM Part 3,6 & 7 of the standard as XML files.

Installation

Using PIP

pip install python-gdcm

From source

  • Install building dependencies
  • Build and install python-gdcm
    • If cmake isn't in $PATH export the env variable CMAKE_EXE to its path
      $ export CMAKE_EXE=/CMAKE/PATH
      
    • If swig isn't in $PATH export the env variable SWIG_EXE to its path
      $ export SWIG_EXE=/SWIG/PATH
      
    • Build and install
      $ python setup.py install
      

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

About

GDCM Packaging


Languages

Language:Python 88.8%Language:Shell 11.2%