From DICOM to BIDS with HeuDiConv: a practical overview
Scanners write DICOM files; most modern research software expects something tidier. The Brain Imaging Data Structure (BIDS) is a community standard for naming and organising neuroimaging data, and HeuDiConv is one of the tools that converts DICOM into BIDS. This article explains the idea and the workflow at a practical level.
Learning objectives
- Explain why raw DICOM is awkward for analysis and what BIDS offers instead.
- Describe the role of HeuDiConv and its heuristic file.
- Follow the two-pass workflow from DICOM to a validated BIDS dataset.
- Recognise common pitfalls such as inconsistent protocol names and identifiable metadata.
Why DICOM needs converting
DICOM is designed for clinical archiving and exchange. Files are organised by scanner session and series, and series names are whatever the operator or protocol called them. For analysis you usually want predictable folders and file names, a consistent place for metadata, and a format that pipelines can discover automatically.
What BIDS gives you
- A predictable folder layout by subject, session and data type (for example anat, func, dwi, fmap).
- Standard file names that encode the acquisition, such as T1w or bold.
- JSON sidecar files holding acquisition parameters.
- Compatibility with BIDS-aware tools and a validator that checks your dataset.
The role of HeuDiConv
HeuDiConv reads DICOM series, applies a heuristic you write to decide what each series is, runs a converter (dcm2niix) and writes the result in BIDS layout. It also lets you de-identify subject labels. The heuristic is a short Python file that maps series descriptions to BIDS names.

A two-pass workflow
- Scan: run HeuDiConv without a converter heuristic to list the series in your data and generate a summary.
- Write the heuristic: edit a heuristic file so each series description maps to the right BIDS name.
- Convert: run HeuDiConv again with your heuristic to produce the BIDS dataset.
- Validate: run the BIDS validator and fix any reported problems.
An illustrative first-pass command is shown below. Paths, subject labels and container usage will differ in your setup, and options change between versions, so check the current HeuDiConv documentation.
heudiconv \
--files /data/dicom/sub01 \
-o /data/bids \
-f convertall \
-s 01 \
-c none
Illustrative example only. Verify options against the documentation for your installed version.
Common pitfalls
- Inconsistent series names between sessions or sites, which breaks a single heuristic.
- Repeated or aborted series that need explicit handling.
- Identifiable information left in file names or headers. Check what leaves your institution.
- Skipping validation, then discovering problems at the analysis stage.
Key takeaways
- BIDS makes datasets predictable and shareable; HeuDiConv automates the conversion.
- The heuristic file is where you encode your own protocol names.
- Scan first, then convert, then validate.
- Keep the original DICOM until the BIDS dataset is verified.
Frequently asked questions
Do I need BIDS to analyse my data?
No, but many tools and pipelines expect it, and it makes sharing and reproducing analyses much easier.
Can SpinLab help after conversion?
Yes. SpinLab can generate scripts for common neuroimaging tools once your data are organised.
Is HeuDiConv the only option?
No. Other converters and wrappers exist. This article covers one commonly used route.
References and further reading
- Gorgolewski KJ, et al. The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Sci Data. 2016;3:160044.
- HeuDiConv project documentation (heudiconv.readthedocs.io).
- BIDS specification (bids-specification.readthedocs.io).
Related articles
- Welcome to MRISpin
- Arterial spin labelling in plain English
- SpinLab Autopilot: DICOM to BIDS in seconds
- The HeuDiConv heuristic.py from SpinLab, explained
Last reviewed: 4 November 2026. Educational content for researchers, clinicians and students. It does not replace local protocols, manufacturer guidance or clinical judgement.



