iBEAT-V2 / iBEAT-V2.0-Docker

iBEAT V2.0 Docker
7 stars 2 forks source link

Updating

Release notes for version 2.0.5

Release notes for version 2.0.0

Release notes for version 1.2.0

Improvement in Version 1.1.0

Introduction

This README illustrates how to install and run the Docker version of iBEAT V2.0 pipeline, which is an infant-dedicated structural imaging processing pipeline for infant brain MR images. More details of the pipeline can be referred to iBEAT V2.0 Cloud.

System requirement

Since this is a Linux based container, please install the container on a Linux system. The supported systems include but not limited to Ubuntu, Debian, CentOS and Red Hat.

The pipeline is developed based on the deep convolutional neural network techniques. A GPU is required to support the processing. During the running, around 3 GB GPU memory is required.

Installation

Install Docker

Please refer to the official installation guideline Install Docker on Linux. You can follow the below commands to install the Docker on the popular Ubuntu Linux system. If you have previously installed Docker on your computer, please skip this step.

sudo apt update
sudo apt install ca-certificates curl gnupg lsb-release
sudo apt mkdir -p /etc/share/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/share/keyrings/docker.gpg
sudo echo "deb [arch=$(dpkg --print-architechture) signed-by=/etc/share/keyrings/docker.png] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

Since the docker needs the sudo to run the general commands, to run without sudo, you need to add your user name ${USER} to the docker group, which can be done

sudo group add docker
sudo usermod -aG docker ${USER}

After running these commands, you may need to restart your computer to make the configuration take effect. One easy way to check whether you have successfully installed the Docker or not is to run the Docker using the command docker info, which dose not need sudo requirement if you have added your username to the docker group. Please refer to more details for potential issues on Docker.

Install Nvidia-docker

The Nvidia-docker is required since our pipeline needs GPU support. Please refer to the official installation guideline Install Nvidia-docker on Linux. If you have previously installed Nvidia-docker, please skip this step. The following commands can be used to install the Nvidia-docker on the popular Ubuntu Linux system.

sudo apt update
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-docker.gpg
distribution=$(. /etc/os-release; echo ${ID}${VERSION_ID})
curl -sL https://nvidia.github.io/nvidia-docker/libnvidia-container/${distribution}/libnvidia-container.list | sed 's#deb https://# deb [signed-by=/usr/share/keyrings/nvidia-docker.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt install -y nvidia-docker2

After the installation, please restart the Docker daemon to complete the installation after setting the default funtime:

sudo systemctl restart docker

Finally, you can check whether you have successfully installed the Nvidia-docker using the following command:

docker run --rm --gpus=all nvidia/cuda:9.0-base nvidia-smi

If succeeded, the output should be the GPU card information on your PC.

Download the pipeline

Run docker pull ibeatgroup/ibeat_v2:release_version_tag, where release_version_tag is the container tag. Currently, the latest container tag is release205, thus run docker pull ibeatgroup/ibeat_v2:release205 to download the pipeline.

After downloading, you can use docker images to see the container images you have downloaded.

Running the pipeline container

Get the free license

The container is totally free. Please first register on the iBEAT V2.0 Cloud to get a free license.

Run the pipeline

Before running the pipeline, please:

After that, you can run the pipeline with the following example code:

docker run --gpus=all --rm -it -v /your_data_folder:/InfantData --user $(id -u):$(id -g) ibeatgroup/ibeat_v2:release100 --t1 <t1_file_path> --t2 <t2_file_path> --age <age_in_month> --out_dir <result_dir> --sub_name <subject_id>

In the above example, you can regard docker run --gpus --rm -it -v /your_data_folder:/InfantData --user $(id -u):$(id -g) ibeatgroup/ibeat_v2:release100 as a simple linux command (despite it is long)

The important parameters are:

The user interventioned parameters are:

Note, these parameters are modified since version release 200.

nvidia-docker run --rm -it -v /your_data_folder:/InfantData --user $(id -u):$(id -g) ibeatgroup/ibeat_v2:release100 --t1 <t1_file> --age <t1_image_age> --out_dir <result_dir> --sub_name <subject_id>

The above command is a typical example of processing one subject with both T1w and T2w images. You can also only input a single T1w (or T2w) image if you only have one modality.

Batch processing

Since docker run --gpus=all --rm -it -v /your_data_folder:/InfantData --user $(id -u):$(id -g) ibeatgroup/ibeat_v2:release100 can be regarded as single command, you can also write a script to process the data in a batch by treating the pipeline command as a simple command in a for or while loop. The following is a simple example if you are using the bash script,

for t1_file in t1_file_pattern; do
    nvidia-docker run --rm -it -v /your_data_folder:/InfantData --user $(id -u):$(id -g) ibeatgroup/ibeat_v2:release100 --t1 <t1_file> --age <t1_image_age> --out_dir <result_dir> --sub_name <subject_id>
done

Output illustration

After the processing is finished, in the "mounted" folder your_data_folder, all the processing results will be generated. The following explains what the results are:

Frequently asked questions

Do I must have a GPU to run the pipeline?

Yes. In the current version, we do need GPU support to run the pipeline. In the future, we will also release the pipeline that only needs a CPU for computation.

Is the pipeline robust to the imaging parameters?

Yes. We have successfully processed 16,000+ infant brain images with various imaging protocols and scanners from 100+ institutions. Please see https://ibeat.wildapricot.org/Feedbacks.

Are there any differences between iBEAT V2.0 Docker and iBEAT V2.0 Cloud (http://www.ibeat.cloud)?

Yes. The iBEAT V2.0 Cloud (http://www.ibeat.cloud) is timely updated with our latest developments, while the Docker version could be slightly delayed in updating. For optimal performance, iBEAT V2.0 Cloud is highly recommended.

How to Cite?

Please cite the following papers if you use the results provided by the iBEAT V2.0 pipeline:

Contacts

The iBEAT V2.0 software is developed by the University of North Carolina at Chapel Hill:

For questions/bugs/feedback, please contact:

Zhengwang Wu, Ph.D., zhwwu@med.unc.edu\ Li Wang, Ph.D., li_wang@med.unc.edu\ Gang Li, Ph.D., gang_li@med.unc.edu\ Department of Radiology and Biomedical Research Imaging Center\ The University of North Carolina at Chapel Hill