-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
31 lines (27 loc) · 2.37 KB
/
Copy pathmakefile
File metadata and controls
31 lines (27 loc) · 2.37 KB
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
SHELL := /bin/bash
LISTUID = $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 )
LISTDELTA = $(shell sed 1d dicom/wideformat.csv | cut -d, -f3 )
LISTPRE = $(shell sed 1d dicom/wideformat.csv | cut -d, -f13 )
LISTART = $(shell sed 1d dicom/wideformat.csv | cut -d, -f14 )
LISTVEN = $(shell sed 1d dicom/wideformat.csv | cut -d, -f15 )
LISTTRUTH = $(shell sed 1d dicom/wideformat.csv | cut -d, -f16 )
CONTRASTLIST = Pre Art Ven
raw: $(foreach idc,$(CONTRASTLIST),$(addprefix Processed/,$(addsuffix /$(idc).raw.nii.gz,$(LISTUID))))
truth: $(addprefix Processed/,$(addsuffix /Truth.raw.nii.gz,$(LISTUID)))
multiphase: $(addprefix Processed/,$(addsuffix /multiphase.nii.gz,$(LISTUID)))
viewraw: $(addprefix Processed/,$(addsuffix /viewraw,$(MRILIST)))
Processed/%/Pre.raw.nii.gz:
mkdir -p $(@D); dcm2niix -m y -f Pre.raw -v 1 -z y -t y -o $(@D) $(word $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 | grep -n $* |cut -f1 -d: ), $(LISTPRE))
Processed/%/Art.raw.nii.gz:
mkdir -p $(@D); dcm2niix -m y -f Art.raw -v 1 -z y -t y -o $(@D) $(word $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 | grep -n $* |cut -f1 -d: ), $(LISTART))
Processed/%/Ven.raw.nii.gz:
mkdir -p $(@D); dcm2niix -m y -f Ven.raw -v 1 -z y -t y -o $(@D) $(word $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 | grep -n $* |cut -f1 -d: ), $(LISTVEN))
#plastimatch convert --fixed $< --output-labelmap $@ --output-ss-img $(@D)/ss.nii.gz --output-ss-list $(@D)/ss.txt --output-dose-img $(@D)/dose.nii.gz --input $(word $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 | grep -n $* |cut -f1 -d: ), $(LISTTRUTH))
Processed/%/Truth.raw.nii.gz: Processed/%/Art.raw.nii.gz
mkdir -p $(@D)
plastimatch convert --output-labelmap $@ --output-ss-img $(@D)/ss.nii.gz --output-ss-list $(@D)/ss.txt --output-dose-img $(@D)/dose.nii.gz --input $(word $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 | grep -n $* |cut -f1 -d: ), $(LISTTRUTH))
if [ $(word $(shell sed 1d dicom/wideformat.csv | cut -d, -f2 | grep -n $* |cut -f1 -d: ), $(LISTDELTA)) == "High" ] ; then c3d -verbose $@ -replace 1 2 -o $@ ; fi
c3d -verbose -interpolation 0 $< $@ -reslice-identity -o $@ -binarize -o $(@D)/lesionmask.nii.gz
echo vglrun itksnap -g $< -s $@
Processed/%/multiphase.nii.gz: Processed/%/Pre.raw.nii.gz Processed/%/Art.raw.nii.gz Processed/%/Ven.raw.nii.gz
c3d -verbose $< -info $(word 2,$^) -info $(word 3,$^) -info -omc $@