Skip to content

Instantly share code, notes, and snippets.

@bodokaiser
Created November 19, 2016 20:47
Show Gist options
  • Save bodokaiser/55f7f6f74ebba5c69aa2215193c7b981 to your computer and use it in GitHub Desktop.
Save bodokaiser/55f7f6f74ebba5c69aa2215193c7b981 to your computer and use it in GitHub Desktop.
Directory iteration
PATH := /opt/minc-itk4/bin:$(PATH)
#patients := $(foreach p, $(wildcard data/*), $(p:data/%=%))
#patients := $(foreach p, $(wildcard data/*), $(dir $(p)))
patients := $(shell find data -depth 1 -type d | sed -e "s/data\///g")
process:
@for p in $(patients); do \
mincconvert -2 \
data/$$p/$$p/$$p_mr_tal.mnc data/02_mr.mnc; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment