LightDICOM is a fast as light, light as feather Python3 package for managing DICOM files.
The only 3rd party dependency is numpy
, thus fast and light.
ryoungwoo.jang@vuno.co
from LightClass import LightDCMClass
lc = LightDCMClass()
lc.path = path_to_dicom
d = lc.get_data('0010,0010') # Read tag (0010, 0010), which is "Patient's Name"
npy = lc.read_pixel() # Read pixel values
Or
from LightClass import LightDCMClass
lc = LightDCMClass(path=path_to_dicom)
d = lc.get_data('0010,0010') # Read tag (0010, 0010), which is "Patient's Name"
npy = lc.read_pixel() # Read pixel values
lc = LightDCMClass()
lc.path = path_to_dicom
# Equivalent code : lc = LightDCMClass(path=path_to_dicom)
all_headers = lc.read_all(with_pixel=True)
In .read_all method, there are two arguments:
- Python 3.x
- Numpy
If numpy
is not installed, first install it by pip
, conda
or other method of your choice.
git clone https://github.com/jryoungw/lightdicom
This is a prototype version, so do remember that bugs or unexpected behaviors may exist.
Whenever bugs are found, please contact via the aforementioned methods. PRs are welcome!