The purpose of this project is to rescue and modernize an old pipeline by creating a robust and versatile Docker container. The container is built upon a foundation of Ubuntu 20.04, MINC ToolBox 1.9, and the Volgenmodel-Nipype pipeline. With this repository, you can breathe new life into pipelines that may no longer have access to their original software environment.
- The Docker container provided in this repository ensures a smooth and reliable execution environment.
- You can:
- Manually build the container using the included
Dockerfile. - Download a prebuilt container directly from Docker Hub (ideal when the original software is no longer available).
- Manually build the container using the included
This repository introduces compatibility with the more widely used NIfTI (.nii) file format. For users working with these files:
- Input NIfTI files are automatically converted to MINC (.mnc) format.
- After processing, the resulting templates are converted back to NIfTI, ensuring full interoperability.
A standout feature of this repository is its ability to run the pipeline in a full-permutation mode. This means:
- Any combination of base files can be used to generate templates.
- For instance, if you provide files
00,01, and02, the pipeline will:- Create templates for combinations such as
00-01,01-02,00-02, and00-01-02. - Note: The order of the files does not matter in these permutations.
- Create templates for combinations such as
The container is designed to start a Jupyter Notebook server, allowing an intuitive and interactive environment for managing the pipeline:
- Simply open your browser and navigate to
localhost:8888to access the server. - The main code for creating templates, performing file conversions, and generating permutations is located in the
create_template_from_mnc.ipynbfile. - There's nothing else to install—everything you need is preinstalled in the Docker container.
The pipeline includes source code to:
- Convert NIfTI files to MINC format.
- Perform pre-processing like N4 bias field correction, auto-crop and zero-padding (as a simple way to guarantee centring of the brains on the images with sufficiently large margins for registration; see also Figure 3 in http://dx.doi.org/10.1016/j.ymeth.2015.01.005)
- Build all possible permutations of input base files.
- Calculate templates using the Volgenmodel-Nipype pipeline.
- Convert the output templates back to the NIfTI format for broader compatibility.
To manually build the Docker container, use the following command in the root directory of the repository:
docker build -t volgenmodel-pipeline .Alternatively, you can download the prebuilt container from Docker Hub and start it directly:
docker pull <dockerhub-username>/volgenmodel-pipeline:latest
docker run -it <dockerhub-username>/volgenmodel-pipeline- Check out the volume mount defined in the "docker-compose.yml" option mounts the
/datafolder from your local repository into the container. This ensures that all processing steps and outputs are saved outside the container, making them easily accessible and persistent.
- Once the container is running, a Jupyter Notebook server will be available at
localhost:8888. - Use this interface to execute the notebook file
create_template_from_mnc.ipynb. This file provides the code to:- Convert NIfTI files to MINC format.
- Perform full permutations of input files.
- Generate templates with the Volgenmodel-Nipype pipeline.
- Convert the resulting templates back to the NIfTI format.
- File Format: Source files must be in NIfTI (.nii) format.
- File Location: Place all source files in the directory
/data/masked_brainsbefore running the pipeline.
- You can customize the number of CPUs used during processing with the
ncpusparameter. However, be cautious:- Excessive CPU allocation may overload your system, potentially causing it to crash.
- A safe and recommended estimate is to set
ncpusto the number of physical cores on your machine. For example, if your computer has 8 cores, setncpus=8for optimal performance.
This project is a lifeline for researchers and users who want to:
- Maintain compatibility with legacy pipelines.
- Transition to modern file formats.
- Harness the power of Docker for a consistent and portable environment.
Feel free to clone the repository, explore the code, and contribute to its growth. Your feedback and collaboration are always welcome! 🚀
////////////////////////////////////////////////////////////////////////////// Original README from Andrew Janke OG Readme