diff --git a/Docker/.dockerignore b/Docker/.dockerignore new file mode 100644 index 0000000..31bf074 --- /dev/null +++ b/Docker/.dockerignore @@ -0,0 +1,16 @@ +# Ignore editor and system files +.vscode/ +.git/ +.gitignore +*.md + +# Exclude development and test artifacts +__pycache__ +conftest + +# Docs +docs +doc + +# Others + diff --git a/Docker/Dockerfile b/Docker/Dockerfile new file mode 100644 index 0000000..a5537f9 --- /dev/null +++ b/Docker/Dockerfile @@ -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"] diff --git a/Docker/README.md b/Docker/README.md new file mode 100644 index 0000000..5d77553 --- /dev/null +++ b/Docker/README.md @@ -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. + +--- diff --git a/requirements.txt b/requirements.txt index 18d4f2e..0d0e85b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,6 @@ numpy scipy torchio torch -logging joblib dipy matplotlib @@ -13,4 +12,4 @@ pytest tqdm pandas sphinx -sphinx_rtd_theme \ No newline at end of file +sphinx_rtd_theme