Skip to content

Commit

Permalink
Merge pull request #4 from Medical-Image-Analysis-Laboratory/dev-hk
Browse files Browse the repository at this point in the history
Integration of automatic DL-based brain extraction
  • Loading branch information
sebastientourbier authored Oct 20, 2020
2 parents 69c920d + 98cb9a4 commit 74bb016
Show file tree
Hide file tree
Showing 34 changed files with 2,717 additions and 826 deletions.
89 changes: 81 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: 2
version: 2.1

orbs:
coverage-reporter: codacy/coverage-reporter@11.0.1

jobs:

Expand Down Expand Up @@ -117,7 +120,12 @@ jobs:
docker images
fi
- run:
name: Run super-resolution pipelines on sample testing dataset
name: Create the data/test folder
no_output_timeout: 1h
command: |
mkdir -p /tmp/src/mialsuperresolutiontoolkit/data/test
- run:
name: Test-01 - Run super-resolution pipelines on sample testing dataset with manual masks
no_output_timeout: 6h
command: |
# Get version, update files.
Expand All @@ -128,24 +136,60 @@ jobs:
ls -la /tmp/src/mialsuperresolutiontoolkit/data/derivatives
#Execute BIDS App
docker run -it --rm \
docker run -it --rm --entrypoint /app/run_srr_coverage.sh \
-v /tmp/src/mialsuperresolutiontoolkit/data:/bids_dir \
-v /tmp/src/mialsuperresolutiontoolkit/data/derivatives:/output_dir \
sebastientourbier/mialsuperresolutiontoolkit-bidsapp \
/bids_dir /output_dir participant --participant_label 01 \
--param_file /bids_dir/code/participants_params.json
--param_file /bids_dir/code/participants_params.json \
--manual
# Rename log
mv /tmp/src/mialsuperresolutiontoolkit/data/code/log.txt /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_log.txt
# Rename partial coverage
mv /tmp/src/mialsuperresolutiontoolkit/data/code/coverage.xml /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml
# - save_cache:
# key: ds-sample-derivatives-{{ .Branch }}-{{ epoch }}
# paths:
# - /tmp/data/ds-sample/derivatives
- run:
name: Checking outputs of MIALSRTK BIDS App run
name: Test-01 - Checking outputs of MIALSRTK BIDS App run
command: |
# Get all files in derivatives except the _*.json interface hash generated by nipype (find) / remove the full path of the derivatives (sed) / sort the files and write it to a text file
sudo find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -path */figures -prune -o -not -name "_*.json" -type f -print | sed s+/tmp/src/mialsuperresolutiontoolkit/data/derivatives/++ | sort > /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_outputs.out
diff /home/circleci/src/mialsuperresolutiontoolkit/.circleci/test-01_outputs.txt /tmp/src/mialsuperresolutiontoolkit/data/test/test-01_outputs.out
exit $?
- run:
name: Test-02 - Run super-resolution pipelines on sample testing dataset with automatic brain extraction
no_output_timeout: 6h
command: |
# Get version, update files.
#THISVERSION=v$( python /home/circleci/src/mialsuperresolutiontoolkit/get_version.py )
#echo "THISVERSION : ${THISVERSION}"
ls -la /tmp/src/mialsuperresolutiontoolkit/data
ls -la /tmp/src/mialsuperresolutiontoolkit/data/code
ls -la /tmp/src/mialsuperresolutiontoolkit/data/derivatives
#Execute BIDS App
docker run -it --rm --entrypoint /app/run_srr_coverage.sh \
-v /tmp/src/mialsuperresolutiontoolkit/data:/bids_dir \
-v /tmp/src/mialsuperresolutiontoolkit/data/derivatives:/output_dir \
sebastientourbier/mialsuperresolutiontoolkit-bidsapp \
/bids_dir /output_dir participant --participant_label 01 \
--param_file /bids_dir/code/participants_params.json
# Rename log
mv /tmp/src/mialsuperresolutiontoolkit/data/code/log.txt /tmp/src/mialsuperresolutiontoolkit/data/test/test-02_log.txt
# Rename partial coverage
mv /tmp/src/mialsuperresolutiontoolkit/data/code/coverage.xml /tmp/src/mialsuperresolutiontoolkit/data/test/test-02_coverage.xml
- run:
name: Test-02 - Checking outputs of MIALSRTK BIDS App run
command: |
mkdir -p /tmp/src/mialsuperresolutiontoolkit/data/test
# Get all files in derivatives except the _*.json interface hash generated by nipype (find) / remove the full path of the derivatives (sed) / sort the files and write it to a text file
sudo find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -path */figures -prune -o -not -name "_*.json" -type f -print | sed s+/tmp/src/mialsuperresolutiontoolkit/data/derivatives/++ | sort > /tmp/src/mialsuperresolutiontoolkit/data/test/outputs.out
diff /home/circleci/src/mialsuperresolutiontoolkit/.circleci/test_outputs.txt /tmp/src/mialsuperresolutiontoolkit/data/test/outputs.out
sudo find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -path */figures -prune -o -not -name "_*.json" -type f -print | sed s+/tmp/src/mialsuperresolutiontoolkit/data/derivatives/++ | sort > /tmp/src/mialsuperresolutiontoolkit/data/test/test-02_outputs.out
diff /home/circleci/src/mialsuperresolutiontoolkit/.circleci/test-02_outputs.txt /tmp/src/mialsuperresolutiontoolkit/data/test/test-02_outputs.out
exit $?
- run:
name: Clean working directory
Expand All @@ -154,12 +198,31 @@ jobs:
sudo chown $(id -un):$(id -gn) -R /tmp/src/mialsuperresolutiontoolkit/data
find /tmp/src/mialsuperresolutiontoolkit/data/derivatives -not -name "*.svg" -not -name "*.html" -not -name "*.rst" \
-not -name "*.mat" -not -name "*.gpickle" -not -name "*.lta" -not -name "*.json" -not -name "*.txt" -not -name "*.pklz" -type f -delete
- persist_to_workspace:
root: /tmp
paths:
- src/mialsuperresolutiontoolkit/data/test
- store_artifacts:
path: /tmp/src/mialsuperresolutiontoolkit/data/code
- store_artifacts:
path: /tmp/src/mialsuperresolutiontoolkit/data/test
- store_artifacts:
path: /tmp/src/mialsuperresolutiontoolkit/data/derivatives

codacy-coverage-report:
docker:
- image: 'circleci/openjdk:8-jdk'

working_directory: /tmp/src/mialsuperresolutiontoolkit/data/test

steps:
- attach_workspace:
at: /tmp
- coverage-reporter/send_report:
# With parcellation tests
# coverage-reports: '/tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml'
coverage-reports: '/tmp/src/mialsuperresolutiontoolkit/data/test/test-01_coverage.xml,/tmp/src/mialsuperresolutiontoolkit/data/test/test-02_coverage.xml'
project-token: ${CODACY_PROJECT_TOKEN}
# build_docs:
# machine:
# # Ubuntu 16.04, docker 18.09.3, docker-compose 1.23.1
Expand Down Expand Up @@ -311,6 +374,16 @@ workflows:
tags:
only: /.*/

- codacy-coverage-report:
requires:
- test
filters:
branches:
ignore:
- /docs?\/.*/
tags:
only: /.*/

- deploy_docker_release:
requires:
- build
Expand Down
Loading

0 comments on commit 74bb016

Please sign in to comment.