-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: all test example
DOCKER_NAME := npac/$(shell jq -r .name manifest.json):$(shell jq -r .version manifest.json)
all: .gear-run.txt
.docker: Dockerfile manifest.json $(wildcard Program/*)
docker build -t $(DOCKER_NAME) ./
date > $@
.gear: .docker
# source /home/foranw/src/fw-beta-cli/.venv/bin/activate
fw-beta gear build .
date > $@
config.json: .gear input/phantom_dicom/trunc.zip
fw-beta gear config --new
fw-beta gear config --input phantom_dicom=$(PWD)/input/phantom_dicom/trunc.zip
.gear-run.txt: config.json input/phantom_dicom/trunc.zip
fw-beta gear run | tee $@
install: .gear-run.txt
fw-beta gear upload
input/QA_PRISMA3QA_20240809_180204_160000/: | input/
curl -L "https://github.com/NPACore/fw-mrrcqa/releases/download/1.0.20240822_pre-alpa/QA_PRISMA3QA_20240809_180204_160000.zip" > input/QA_PRISMA3QA_20240809_180204_160000.zip
cd input && unzip QA_PRISMA3QA_20240809_180204_160000.zip
example: outputs/stats.json
outputs/stats.json: $(wildcard Program/*m) input/trunc/
Program/QC.m input/trunc
# copy only 4 over for quick testing
input/trunc/: input/QA_PRISMA3QA_20240809_180204_160000/
mkdir $@
find input/QA_PRISMA3QA_20240809_180204_160000/EP2D_BOLD_P2_S2_5MIN_0003/ -type f -iname '*IMA' |head -n 5|xargs cp -t $@
input/phantom_dicom/trunc.zip: input/trunc/
mkdir -p $(dir $@)
cd input/trunc/ && zip $(PWD)/$@ -r ./
test: Program/readshimvalues.m Program/find_all_dicoms.m input/trunc/
cd Program/ && octave --eval "test readshimvalues; test find_all_dicoms;" #|& tee ../$@
test-docker: .docker
docker run -v $(PWD)/input:/flywheel/input:ro --rm --entrypoint "octave" $(DOCKER_NAME) --eval "cd /flywheel/v0/; test readshimvalues"
%/:
mkdir -p $@