Registry / data / dcmstack

dcmstack

JSON →
library0.9.0pypypi✓ verified 85d ago

dcmstack is a Python library (currently v0.9.0, last released stable) that stacks DICOM images into 3D volumes and converts them to NIfTI format. It has a very slow release cadence (last release in 2015) and supports Python >=2.7. The project is effectively in maintenance mode.

pip install dcmstack
INSTALL
IMPORT
SIG · DCMSTACK
D
dcmstack
datapythonv0.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dcmstack
import dcmstack
The library is imported directly; there are no submodules.

Basic usage: add DICOM files to a DicomStack and convert to NIfTI.

import dcmstack from glob import glob # Stack a series of DICOM files into a NIfTI file file_list = sorted(glob('path/to/dicom/*.dcm')) stack = dcmstack.DicomStack() for f in file_list: stack.add_file(f) nifti_img = stack.to_nifti() nib.save(nifti_img, 'output.nii.gz')
Debug
Known issues
deprecateddcmstack is no longer actively maintained. The last release was in 2015, and it only supports Python 2.7 officially. Consider using dcm2niix or Dicom2Nifti for modern projects.
fix
Migrate to dcm2niix (command-line) or the Python library dicom2nifti.
affects: >=0.8.0
gotchaThe library does not handle gzipped NIfTI output directly; you must use nibabel to save as .nii.gz.
fix
After calling stack.to_nifti(), save the resulting nibabel image using nib.save(img, 'output.nii.gz').
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dcmstack'
dcmstack is not installed or installed in the wrong Python environment.
fix
Run: pip install dcmstack
AttributeError: 'DicomStack' object has no attribute 'add_file'
Using an outdated version (<0.8.0) where the API was different.
fix
Upgrade to version 0.9.0: pip install dcmstack==0.9.0
Upgrade
Version history
0.9.0latest on PyPI · released Sep 24, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
dcmstack — pip install dcmstack · libregistry