-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
53 lines (40 loc) · 1.48 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
50
51
52
53
.PHONY: all clean
.SUFFIXES:
.ONESHELL:
all: txt/validate.txt txt/input-diff.txt
.ONESHELL:
examples/dicom/6/: examples/
cd examples
wget https://github.com/user-attachments/files/15515915/gre_phantom_dcm_nii.zip
unzip gre_phantom_dcm_nii.zip
cd dicom/
mkdir {5,6}
mv TESTBR.MR.DEV-SCHIRDA_041119_BRAINO.0005.* 5
mv TESTBR.MR.DEV-SCHIRDA_041119_BRAINO.0006.* 6
.venv/bin/activate:
./setup_env.bash
dcm-rehead/: examples/dicom/6/ | .venv/bin/activate
source .venv/bin/activate && \
dicom-rewrite-pname -o $@/5 -n fmap_acq-dwi examples/dicom/5/*
dicom-rewrite-pname -o $@/6 -n fmap_acq-dwi examples/dicom/6/*
bids/: dcm-rehead/
./01_dcm-bids.sh $</*/
txt/validate.txt: bids/
# NB. last directory shouldn't exist? see readme issues
bids-validator --verbose --no-color bids/dev/schirda/041119_BRAINO/testbr/ |tee $@
#### diffing checking name changes
txt/input-orig.txt: | txt/
# dcmdirtab from lncdtools: https://github.com/lncd/lncdtools
dcmdirtab -d 'examples/dicom/*' > $@
txt/input-reproin.txt: dcm-rehead/ $(wildcard dcm-rehead/*)
dcmdirtab -d 'dcm-rehead/*' > $@
txt/input-diff.txt: txt/input-orig.txt txt/input-reproin.txt
bash -c "diff -W 30 -wby <(cut -f 2-3 txt/input-orig.txt|sort -n) <(cut -f 2-3 txt/input-reproin.txt|sort -n) || :" > $@
txt/input-diff2.txt: txt/input-orig.txt txt/input-reproin.txt
Rscript seqdiff.R > $@
txt/output-filelist.txt: bids/
find bids/ -iname '*nii.gz' -or -iname '*json' > $@
%/:
mkdir -p $@
clean:
rm -rf bids/ dcm-rehead/ txt/input-*.txt