Skip to content

Commit d44c6e7

Browse files
committed
Make the python to use version 3.11 docker version, created a dedicated directory for the Dockerfile and also added a README file to explain the build and run process
1 parent 8d5bc53 commit d44c6e7

File tree

3 files changed

+64
-3
lines changed

3 files changed

+64
-3
lines changed
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim
1+
FROM python:3.11-slim
22

33
WORKDIR /usr/src/app
44

@@ -8,10 +8,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
88
&& apt-get clean \
99
&& rm -rf /var/lib/apt/lists/*
1010

11-
COPY requirements.txt ./
11+
COPY ../requirements.txt ./
1212

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

15-
COPY . .
15+
COPY .. .
1616

1717
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+
---

0 commit comments

Comments
 (0)