-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
88 lines (71 loc) · 3.33 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
default: help
.PHONY: help build data niftis tfrecs
.PHONY: expert-qc community-qc
.PHONY: deep-learning-figures bundle-profiles inference
.PHONY: dl-train dl-predict dl-site-generalization dl-integrated-gradients
# Show this help message
help:
@cat $(MAKEFILE_LIST) | docker run --rm -i xanders/make-help
all: build data expert-qc community-qc deep-learning-figures bundle-profiles
# Build all of the necessary docker images
build:
@echo "Building all of the necessary docker images"
@docker inspect hbn-pod2/base:conda-tex > /dev/null 2>&1 && echo "Base image already exists" || docker buildx build --platform=linux/amd64 -t hbn-pod2/base:conda-tex -f docker/base/Dockerfile docker/base
@docker compose build
# Download data from OSF
data: build
@echo "Downloading data from OSF"
@docker compose run osf-download
@echo "This download excluded the NIfTI files and TFRecords, which are large and can be time consuming to download."
@echo "To download those files, use the make niftis and make tfrecs commands, respectively."
# Download nifti files from OSF
niftis: build
@echo "Downloading NIfTI files from FCP-INDI"
@docker compose run nifti-download
# Download tfrecs files from OSF
tfrecs: build
@echo "Downloading tfrecs from FCP-INDI"
@docker compose run tfrec-download
# Analyze expert ratings and generate derived figures
expert-qc: build
@echo "Analyzing expert ratings and generating derived figures"
@docker compose run expert-qc
# Analyze community ratings and generate derived figures
community-qc: build
@echo "Analyzing community ratings and generating derived figures"
@docker compose run community-qc
# Plot figures for the deep learning QC pipeline
deep-learning-figures: build
@echo "Plotting figures for the deep learning QC pipeline"
@docker compose run dl-figures
# Plot bundle profiles binned by QC score
bundle-profiles: build
@echo "Plotting bundle profiles binned by QC score"
@docker compose run bundle-profiles
# Demonstrate the effect of QC on inference using an age prediction example
inference: build
@echo "Demonstrating the effect of QC on inference using an age prediction example"
@docker compose run inference
# Train site generalization models and compute performance metrics
site-generalization: build
@echo "Training site generalization models and computing performance metrics"
@docker compose run site-generalization
##
## Commands for launching deep learning model training on GCP. For these commands to work, you must have a GCP account and set up your GCP environment variables in a .env file in this directory. A template is provided in .env.template. For further details see README_GCP.md.
##
# Train the deep learning model on GCP
dl-train: build
@echo "Launching deep learning model training on GCP"
@docker compose run dl-train-gcp b0_tensorfa_dwiqc
# Predict QC ratings using the trained models on GCP
dl-predict: build
@echo "Launching deep learning model prediction on GCP"
@docker compose run dl-predict-gcp b0_tensorfa_dwiqc
# Train site generalization models on GCP
dl-site-generalization: build
@echo "Launching site generalization model training on GCP"
@docker compose run dl-site-generalization-gcp
# Generate attribution maps using integrated gradients on GCP
dl-integrated-gradients: build
@echo "Launching integrated gradients on GCP"
@docker compose run dl-integrated-gradients-gcp site_gen