Extract image data into a 3D numpy array from a set of DICOM files.
Project description
DICOM Numpy
Overview
This python module provides utilities for extracting image data contained in DICOM files into Numpy ndarrays.
Dependencies
Python 2.7 or Python 3.3+
Numpy
PyDicom
Installation
pip install dicom_numpy
Basic Usage
import dicom
import dicom_numpy
def extract_voxel_data(list_of_dicom_files):
datasets = [dicom.read_file(f) for f in list_of_dicom_files]
try:
voxel_ndarray = dicom_numpy.combine_slices(datasets)
except dicom_numpy.DicomImportException as e:
# Either the DICOM files are not from the same series, there are missing
# internal slices (we can't detect missing end slices), or the data
# is inconsistent in some way (e.g. the size of each slice is
# inconsistent).
raise
return voxel_ndarray
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dicom_numpy-0.1.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for dicom_numpy-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd626e8a9fedb9b8da449e4eea153f395a66603d566f0811a61f8f06cbfa444d |
|
MD5 | 8c69c625894a3b68165dc8eb488c9fbf |
|
BLAKE2b-256 | 6ea141c69cdb6913cc869717f0e8e7c39237a0cc091e81462117dcc32ec40ed4 |