{"id":21127,"library":"dicom2nifti","title":"dicom2nifti","description":"A Python library for converting DICOM series to NIfTI format, with support for enhanced, CT, MR, and PET images. Current version 2.6.2, released 2025. Maintained by icometrix.","status":"active","version":"2.6.2","language":"python","source_language":"en","source_url":"https://github.com/icometrix/dicom2nifti","tags":["dicom","nifti","medical-imaging","conversion","icometrix"],"install":[{"cmd":"pip install dicom2nifti","lang":"bash","label":"pip"}],"dependencies":[{"reason":"NIfTI writing","package":"nibabel","optional":false},{"reason":"DICOM parsing","package":"pydicom","optional":false},{"reason":"array operations","package":"numpy","optional":false}],"imports":[{"note":"The module itself is the function; do not import submodule.","wrong":"from dicom2nifti import dicom2nifti","symbol":"dicom2nifti","correct":"import dicom2nifti"}],"quickstart":{"code":"import dicom2nifti\n\ndicom2nifti.dicom_series_to_nifti('/input/dicom/folder', '/output.nii.gz', reorient_nifti=True)","lang":"python","description":"Convert a directory of DICOM files (single series) to NIfTI."},"warnings":[{"fix":"Ensure input folder contains only one series; use `dicom_series_to_nifti` with `dir` only for single-series directories.","message":"The function `dicom_series_to_nifti` expects a folder containing exactly one DICOM series. If the folder contains multiple series or non-DICOM files, conversion may fail or produce incorrect output.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace with `dicom_series_to_nifti` using a temporary directory containing the DICOM files.","message":"The function `dicom_array_to_nifti` is deprecated since version 2.0 and may be removed in future releases. Use `dicom_series_to_nifti` with a directory instead.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"Use `dicom_series_to_nifti` for single series or `dicom_series_to_nifti_multi` for multiple series.","message":"In version 2.0, support for Python 2 was dropped and the API was simplified. Functions like `dicom_to_nifti` and `dicom_to_nifti_parallel` were removed.","severity":"breaking","affected_versions":"2.0"},{"fix":"Call with `reorient_nifti=False` if you do not want reorientation.","message":"The `reorient_nifti` parameter defaults to `True`. If you need to preserve original orientation, set it to `False` explicitly.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `pydicom` directly to extract any needed private tags before conversion.","message":"Conversion may lose private tags or metadata. The library only supports standard DICOM tags and may not preserve all attributes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.6.2':23 '2025':25 'convers':34 'convert':6 'ct':16 'current':21 'dicom':7,29 'dicom2nifti':1 'enhanc':15 'format':11 'icometrix':28,35 'imag':20,33 'librari':4 'maintain':26 'medic':32 'medical-imag':31 'mr':17 'nifti':10,30 'pet':19 'python':3 'releas':24 'seri':8 'support':13 'version':22","created_at":"2026-04-27T16:58:13.261195+00:00","updated_at":"2026-04-27T16:58:13.261195+00:00","problems":[{"fix":"Use `dicom2nifti.dicom_series_to_nifti()` instead.","cause":"The function was renamed or removed in version 2.0.","error":"AttributeError: module 'dicom2nifti' has no attribute 'dicom_to_nifti'"},{"fix":"Ensure the folder contains exactly one DICOM series with correct filenames (e.g., from a single DICOM study).","cause":"The input directory contains files that are not DICOM, multiple series, or incomplete data.","error":"ValueError: The input is not a valid DICOM series"},{"fix":"Run `pip install pydicom` or reinstall dicom2nifti with all dependencies: `pip install dicom2nifti`.","cause":"Dependency pydicom not installed.","error":"ImportError: No module named 'pydicom'"},{"fix":"Validate your DICOM files with `pydicom.dcmread()` to check for missing tags.","cause":"Some DICOM files are missing required tags because they are not valid DICOM or corrupted.","error":"KeyError: 'SeriesInstanceUID'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.6.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/icometrix/dicom2nifti","docs":null,"changelog":null,"pypi":"https://pypi.org/project/dicom2nifti/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}