File Conversion Tools
Installing Conversion Software
For converting anatomical MR files to BIDS, we will use dcm2niix
, and for converting PET files to BIDS, we will use PET2BIDS
. To use PET2BIDS
, we will first install Python and conda (although PET2BIDS can also be used with MATLAB - see the full documentation for details).
Python
Windows
-
Install Python
- Download the latest Python installer from python.org
- Run the installer
- Important: Check "Add Python to PATH"
- Select "Install Now"
-
Install Miniconda
- Download Miniconda from conda.io
- Run the installer
- Accept the license agreement
- Select "Just Me" when asked who to install for
- Choose a destination folder (the default is fine)
- Check both options in the Advanced Installation Options
- Click "Install"
Linux (Ubuntu/Debian)
-
Install Python (if not already installed)
- Open Terminal
- Update package lists and install Python:
sudo apt update sudo apt install python3 python3-pip python3-venv
-
Install Miniconda
- Download Miniconda:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
- Make the installer executable:
chmod +x Miniconda3-latest-Linux-x86_64.sh
- Run the installer:
./Miniconda3-latest-Linux-x86_64.sh
- Follow the prompts, accept the license agreement
- Allow the installer to initialize Miniconda
- Download Miniconda:
PET2BIDS
PET2BIDS is a well-validated tool for converting ecat7 (.v
) and DICOM (.dcm
) files to BIDS files.
Assuming Python and conda (or miniconda) are already installed, we start by creating and activating a PETBIDS environment
conda create --name PETBIDS
conda activate PETBIDS
And then we can proceed to install the PET2BIDS software
pip install pypet2bids
The full package documentation can be found here.
dcm2niix
dcm2niix can also be installed using conda
as follows:
conda install -c conda-forge dcm2niix
To check if dcm2niix is installed correctly:
- Open a terminal (Command Prompt, Terminal, etc.)
- Type
dcm2niix -h
and press Enter - You should see the help message with usage instructions