Skip to content

Commit

Permalink
Merge pull request #66 from Unique-Usman/osipi_docker
Browse files Browse the repository at this point in the history
created the dockerise version of the TF2.4_IVIM-MRI_CodeCollection
  • Loading branch information
etpeterson authored Jun 7, 2024
2 parents b9c8474 + d44c6e7 commit 28b516b
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Ignore editor and system files
.vscode/
.git/
.gitignore
*.md

# Exclude development and test artifacts
__pycache__
conftest

# Docs
docs
doc

# Others

17 changes: 17 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.11-slim

WORKDIR /usr/src/app

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY ../requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY .. .

ENTRYPOINT ["python3", "-m", "WrapImage.nifti_wrapper"]
61 changes: 61 additions & 0 deletions Docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# TF2.4_IVIM-MRI_CodeCollection

This project is designed to run the `nifti_wrapper` script using a Docker container. Below are the steps to build and run the Docker image.

## Prerequisites

- Docker must be installed on your system.

## Directory Structure

```
~/TF2.4_IVIM-MRI_CodeCollection/
├── Docker/
│ └── Dockerfile
├── WrapImage/
│ └── nifti_wrapper.py
└── requirements.txt
```

## Options

Before running the Docker container, here are the available options for the `Docker image` script:

- `input_file`: Path to the input 4D NIfTI file.
- `bvec_file`: Path to the b-vector file.
- `bval_file`: Path to the b-value file.
- `--affine`: Affine matrix for NIfTI image (optional).
- `--algorithm`: Select the algorithm to use (default is "OJ_GU_seg").
- `algorithm_args`: Additional arguments for the algorithm (optional).

## Building the Docker Image

1. Open a terminal and navigate to the project directory:

```sh
cd ~/TF2.4_IVIM-MRI_CodeCollection
```

2. Build the Docker image using the `docker build` command:

```sh
sudo docker build -t tf2.4_ivim-mri_codecollection -f Docker/Dockerfile .
```

## Running the Docker Container

1. Once the image is built, you can run the Docker container using the `docker run` command. This command runs the Docker image with the specified input files:

```sh
sudo docker run -it --rm --name TF2.4_IVIM-MRI_CodeCollection \
-v ~/TF2.4_IVIM-MRI_CodeCollection:/usr/src/app \
-v ~/TF2.4_IVIM-MRI_CodeCollection:/usr/app/output \
tf2.4_ivim-mri_codecollection brain.nii.gz brain.bvec brain.bval
```

Replace `brain.nii.gz`, `brain.bvec`, and `brain.bval` with the actual file names you want to use.

---
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ numpy
scipy
torchio
torch
logging
joblib
dipy
matplotlib
Expand All @@ -13,4 +12,4 @@ pytest
tqdm
pandas
sphinx
sphinx_rtd_theme
sphinx_rtd_theme

0 comments on commit 28b516b

Please sign in to comment.