{"id":27682,"library":"dcmstack","title":"dcmstack","description":"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.","status":"maintenance","version":"0.9.0","language":"python","source_language":"en","source_url":"https://github.com/moloney/dcmstack","tags":["dicom","nifti","medical-imaging"],"install":[{"cmd":"pip install dcmstack","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"The library is imported directly; there are no submodules.","wrong":"","symbol":"dcmstack","correct":"import dcmstack"}],"quickstart":{"code":"import dcmstack\nfrom glob import glob\n\n# Stack a series of DICOM files into a NIfTI file\nfile_list = sorted(glob('path/to/dicom/*.dcm'))\nstack = dcmstack.DicomStack()\nfor f in file_list:\n    stack.add_file(f)\nnifti_img = stack.to_nifti()\nnib.save(nifti_img, 'output.nii.gz')","lang":"python","description":"Basic usage: add DICOM files to a DicomStack and convert to NIfTI."},"warnings":[{"fix":"Migrate to dcm2niix (command-line) or the Python library dicom2nifti.","message":"dcmstack 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.","severity":"deprecated","affected_versions":">=0.8.0"},{"fix":"After calling stack.to_nifti(), save the resulting nibabel image using nib.save(img, 'output.nii.gz').","message":"The library does not handle gzipped NIfTI output directly; you must use nibabel to save as .nii.gz.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run: pip install dcmstack","cause":"dcmstack is not installed or installed in the wrong Python environment.","error":"ModuleNotFoundError: No module named 'dcmstack'"},{"fix":"Upgrade to version 0.9.0: pip install dcmstack==0.9.0","cause":"Using an outdated version (<0.8.0) where the API was different.","error":"AttributeError: 'DicomStack' object has no attribute 'add_file'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}