Skip to main content
PET2BIDS: a library for converting Positron Emission Tomography data to BIDS
Anthony Galassi, Martin Norgaard, Claus Svarer, Chris Rorden, Gabriel Gonzalez-Escamilla, Paul Wighton, Russell Poldrack, Douglas Greve, Adam Thomas, Robert Innis, Gitte Moos Knudsen, Melanie Ganz & Cyril Pernet.
Presenting author:
Cyril Pernet
The Brain Imaging Data Structure (BIDS) (1) has quickly become successful and popular in the neuroimaging community with adoption by major brain imaging repositories (e.g. CONP, OpenNeuro, WeBrain) and data management tools (e.g. COINS, XNAT, Loris). This not only allows data to be shared much more easily, but also enables the development of automated data analysis pipelines (2), and together improves reproducibility. The PET-BIDS extension (3) has recently been merged into the BIDS specification, providing a structured data and metadata nomenclature, including all the necessary information to share and report on PET blood and metabolite (4). Here we present a new code library, developed in both Matlab and Python, allowing the conversion of PET imaging data (ecat and dicom) and metadata (e.g. time or blood measurements) into the brain imaging data structure specification.

File conversion: The conversion for PET data stored in DICOM files is performed using a wrapper around dcm2niix (5) and then updating the corresponding JSON file. For ECAT files, dedicated functions were written to support this conversion. The Matlab code relies on the readECAT7.m function from BT Christian (1998) and revised by RF Muzic (2002) to read the data, while new ecat2nii (.m .py) functions were written to convert into NIfTI and produce a JSON sidecar file, and optionally a SIF file (Scan Information File - used by different pharmacokinetic modelling software for model weighting). The Python code was subsequently developed in line with the Matlab code, further testing data reading (i.e. which bits are read according to the PET data frames) and writing, relying here on Nibabel (6).
Metadata: JSON files created from reading PET scanner data are always missing some of the radiotracer and pharmaceutical information. To accommodate this, a dedicated PET JSON updater was created. The PET JSON updater function takes the original JSON file and new metadata to add as input, checks that the full BIDS specification is respected (correct metadata but also consistency of metadata values for the different metadata keys) and updates the JSON file.
Spreadsheet conversion: tabular data formats (excel, csv, tsv, bld) are ubiquitous in the PET community in particular to (a) keep track of radiotracer information injected per participants and (b) record time and radiotracer concentration from the blood sampling. To facilitate conversion to BIDS, dedicated functions were created to (i) convert pre-formatted tabular data to JSON files, (ii) use pre-formatted tabular data to update JSON files, and (iii) convert a tabular pmod file to a blood.tsv file (pmod being a popular commercial pharmacokinetic modelling software -

We have successfully converted PET neuroimaging files from various scanners (Siemens, Phillips, and GE) and validated them using the BIDS-validator (some examples are available on OpenNeuro @ All the code for testing is openly available @, and we are currently testing PET2BIDS on data from other sites.
The BIDS specification for metadata information is being updated for a missing field (e.g. DoseCalibrationFactor) or unspecified details (e.g. ScalingFactor should be one if applied to the data), thanks to user testing revealing unclear details.

PET2BIDS is a new open-source library developed by Open NeuroPET ( for the PET neuroimaging community. It has been used by several groups in Europe and North America and has been shown to successfully convert PET data and metadata to the Brain Imaging Data Structure. Further development and integration with tools (e.g. BIDScoins) are planned to continue help users.

1. Gorgolewski KJ, Auer T, Calhoun VD, Craddock RC, Das S, Duff EP, et al. The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Scientific Data. 2016 Jun 21;3:160044.
2. Gorgolewski KJ, Alfaro-Almagro F, Auer T, Bellec P, Capotă M, Chakravarty MM, et al. BIDS apps: Improving ease of use, accessibility, and reproducibility of neuroimaging data analysis methods. PLOS Computational Biology. 2017 Mar 9;13(3):e1005209.
3. Norgaard M, Matheson GJ, Hansen HD, Thomas A, Searle G, Rizzo G, et al. PET-BIDS, an extension to the brain imaging data structure for positron emission tomography [Internet]. 2021 Jun [cited 2021 Dec 14] p. 2021.06.16.448390. Available from:
4. Knudsen GM, Ganz M, Appelhoff S, Boellaard R, Bormans G, Carson RE, et al. Guidelines for the content and format of PET brain data in publications and archives: A consensus paper. J Cereb Blood Flow Metab. 2020 Aug;40(8):1576–85.
5. Li X, Morgan PS, Ashburner J, Smith J, Rorden C (2016) The first step for neuroimaging data analysis: DICOM to NIfTI conversion. J Neurosci Methods. 264:47-56. doi: 10.1016/j.jneumeth.2016.03.001. PMID: 26945974
6. Brett, M., Markiewicz, C.J., Hanke, M., Côté, M-A., Cipollini, B., McCarthy, P., Jarecka, D., Cheng, C.P., Halchenko, Y.O., Cottaar, M., Larson, E., Ghosh, S., Wassermann, D., Gerhard, S., Lee, G.R., Wang, H-T., Kastman, E., Kaczmarzyk, J., Guidotti, R. (2020). nipy/nibabel: 3.2.1. Zenodo.