Skip to content

Commit

Permalink
Merge pull request #8 from UCL-ARC/km/add-new-script
Browse files Browse the repository at this point in the history
Add dockerfiles and latest analysis script
  • Loading branch information
K-Meech authored Aug 29, 2024
2 parents 689ca2b + 23be8a8 commit ec719a5
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker_log.txt
code/
data/
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: v1.5.5
hooks:
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand All @@ -19,7 +20,9 @@ repos:
hooks:
- id: hadolint
args:
- --failure-threshold=warning
- --ignore=DL3008
- --ignore=DL3007
- repo: https://github.com/crate-ci/typos
rev: v1.24.1
hooks:
Expand All @@ -39,5 +42,7 @@ repos:
hooks:
- id: shellcheck
args:
- --severity=warning
- --external-sources
- --shell=bash
- --exclude=SC2207
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM cvriend/pgs:latest
WORKDIR /

# Need fslinstaller.py
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
bc \
dc \
tree \
parallel \
zip && \
rm -rf /var/lib/apt/lists/*

RUN wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py && python fslinstaller.py -d /usr/local/fsl/ -V 6.0.7.13

RUN echo '\n # FSL Setup \nFSLDIR=/usr/local/fsl \nPATH=${FSLDIR}/share/fsl/bin:${PATH} \nexport FSLDIR PATH \n. ${FSLDIR}/etc/fslconf/fsl.sh' >> /root/.bashrc

COPY analysis_script.sh .

RUN mkdir /data
RUN mkdir /code

RUN chmod +x analysis_script.sh

CMD ["/analysis_script.sh"]

ENTRYPOINT []
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# Enigma-PD-WML

Segment White Mater Lesions (WML) in T1-weighted and FLAIR MR images using FSL and U-Net
Segment White Mater Lesions (WML) in T1-weighted and FLAIR MRI images using FSL and U-Net

## Build and run the docker container

- Clone this repository

```bash
git clone https://github.com/UCL-ARC/Enigma-PD-WML.git
```

- Build the docker image

```bash
cd Enigma-PD-WML
docker build -f Dockerfile -t fsl_test .
```

- Create `code` and `data` directories inside the `Enigma-PD-WML` directory

- Create a `subjects.txt` file at `Enigma-PD-WML/data/subjects.txt`.
This file should contain subject identifiers (one per line).

- For each subject id:
- Create a directory at `Enigma-PD-WML/data/subject-id` (replacing 'subject-id' with the relevant id from
your `subjects.txt` file)

- Create a sub-directory inside the 'subject-id' directory called `niftis`.

- Inside `niftis` place the subject's T1 MRI scan and FLAIR MRI scan. Both these files should be in nifti format
(ending `.nii.gz`) and contain either `T1` or `FLAIR` in their name respectively.

- Your final file structure should look like below (for two example subject ids):

```bash
Enigma-PD-WML
├───code
└───data
├───subject-1
│ └───niftis
│ ├───T1.nii.gz
│ └───FLAIR.nii.gz
├───subject-2
│ └───niftis
│ ├───T1.nii.gz
│ └───FLAIR.nii.gz
└───subjects.txt
```

- Run the docker container. Make sure you are in the `Enigma-PD-WML` directory when you run this command.

```bash
./docker_runscript.sh
```
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-words]
# Don't correct -thr option
thr = "thr"
Loading

0 comments on commit ec719a5

Please sign in to comment.