-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrainingDataT1AHCC.py
executable file
·33 lines (25 loc) · 1.06 KB
/
trainingDataT1AHCC.py
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
from pnlpipe_software import downloadGithubRepo, downloadGithubArchive, getCommitInfo, getSoftDir, checkExists, TemporaryDirectory
from plumbum import local
from plumbum.cmd import cmake, make
import logging
DEFAULT_HASH = '8141805'
def make(commit= DEFAULT_HASH):
"""Downloads t1 training set. Has masks, amygdala-hippocampus (left/right), and cingulate (left/right). Makes '<dest>/trainingDataT1AHCC'"""
installTraining('trainingDataT1AHCC', commit)
def get_path(hash= DEFAULT_HASH):
return local.path(getSoftDir() / 'trainingDataT1AHCC-' + hash)
def installTraining(repo, commit):
dest = getSoftDir()
if commit == 'master':
logging.error(
'installing master not implemented yet for training repos, specify github hash')
import sys
sys.exit(1)
out = local.path(dest / repo + '-' + commit)
if checkExists(out):
return
archive = downloadGithubArchive('pnlbwh/' + repo, commit)
archive.move(out)
with local.cwd(out):
from plumbum.cmd import bash
bash('./mktrainingcsv.sh', '.')