Skip to content

Commit 28b516b

Browse files
authored
Merge pull request #66 from Unique-Usman/osipi_docker
created the dockerise version of the TF2.4_IVIM-MRI_CodeCollection
2 parents b9c8474 + d44c6e7 commit 28b516b

File tree

4 files changed

+95
-2
lines changed

4 files changed

+95
-2
lines changed

Docker/.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ignore editor and system files
2+
.vscode/
3+
.git/
4+
.gitignore
5+
*.md
6+
7+
# Exclude development and test artifacts
8+
__pycache__
9+
conftest
10+
11+
# Docs
12+
docs
13+
doc
14+
15+
# Others
16+

Docker/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /usr/src/app
4+
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
build-essential \
7+
libssl-dev \
8+
&& apt-get clean \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
COPY ../requirements.txt ./
12+
13+
RUN pip install --no-cache-dir -r requirements.txt
14+
15+
COPY .. .
16+
17+
ENTRYPOINT ["python3", "-m", "WrapImage.nifti_wrapper"]

Docker/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# TF2.4_IVIM-MRI_CodeCollection
2+
3+
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.
4+
5+
## Prerequisites
6+
7+
- Docker must be installed on your system.
8+
9+
## Directory Structure
10+
11+
```
12+
~/TF2.4_IVIM-MRI_CodeCollection/
13+
14+
├── Docker/
15+
│ └── Dockerfile
16+
17+
├── WrapImage/
18+
│ └── nifti_wrapper.py
19+
20+
└── requirements.txt
21+
```
22+
23+
## Options
24+
25+
Before running the Docker container, here are the available options for the `Docker image` script:
26+
27+
- `input_file`: Path to the input 4D NIfTI file.
28+
- `bvec_file`: Path to the b-vector file.
29+
- `bval_file`: Path to the b-value file.
30+
- `--affine`: Affine matrix for NIfTI image (optional).
31+
- `--algorithm`: Select the algorithm to use (default is "OJ_GU_seg").
32+
- `algorithm_args`: Additional arguments for the algorithm (optional).
33+
34+
## Building the Docker Image
35+
36+
1. Open a terminal and navigate to the project directory:
37+
38+
```sh
39+
cd ~/TF2.4_IVIM-MRI_CodeCollection
40+
```
41+
42+
2. Build the Docker image using the `docker build` command:
43+
44+
```sh
45+
sudo docker build -t tf2.4_ivim-mri_codecollection -f Docker/Dockerfile .
46+
```
47+
48+
## Running the Docker Container
49+
50+
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:
51+
52+
```sh
53+
sudo docker run -it --rm --name TF2.4_IVIM-MRI_CodeCollection \
54+
-v ~/TF2.4_IVIM-MRI_CodeCollection:/usr/src/app \
55+
-v ~/TF2.4_IVIM-MRI_CodeCollection:/usr/app/output \
56+
tf2.4_ivim-mri_codecollection brain.nii.gz brain.bvec brain.bval
57+
```
58+
59+
Replace `brain.nii.gz`, `brain.bvec`, and `brain.bval` with the actual file names you want to use.
60+
61+
---

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ numpy
22
scipy
33
torchio
44
torch
5-
logging
65
joblib
76
dipy
87
matplotlib
@@ -13,4 +12,4 @@ pytest
1312
tqdm
1413
pandas
1514
sphinx
16-
sphinx_rtd_theme
15+
sphinx_rtd_theme

0 commit comments

Comments
 (0)