-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnipypes.py
44 lines (41 loc) · 1.72 KB
/
nipypes.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
34
35
36
37
38
39
40
41
42
43
44
import os
import socket
from nipype.interfaces.matlab import MatlabCommand
if socket.gethostname() == 'malin':
os.environ['MATLABCMD'] = "/opt/matlab/R2015b/bin/matlab -nodesktop -nosplash"
MatlabCommand.set_default_paths('/opt/matlab/R2015b/toolbox/spm12')
MatlabCommand.set_default_matlab_cmd("/opt/matlab/R2015b/bin/matlab -nodesktop -nosplash")
TPM = '/opt/matlab/R2015b/toolbox/spm12/tpm/TPM.nii'
# os.environ['MATLABCMD'] = "/opt/matlab/R2012a/bin/matlab -nodesktop -nosplash"
# MatlabCommand.set_default_paths('/opt/matlab/R2012a/toolbox/spm12')
# MatlabCommand.set_default_matlab_cmd("/opt/matlab/R2012a/bin/matlab -nodesktop -nosplash")
elif socket.gethostname() == 'cala':
os.environ['MATLABCMD'] = "/opt/matlab/64bit/R2015a/bin/matlab -nodesktop -nosplash"
MatlabCommand.set_default_paths('/opt/matlab/64bit/R2015a/toolbox/spm12')
MatlabCommand.set_default_matlab_cmd("/opt/matlab/64bit/R2015a/bin/matlab -nodesktop -nosplash")
TPM = '/opt/matlab/64bit/R2015a/toolbox/spm12/tpm/TPM.nii'
def display_crash_files(crashfile, rerun=False):
from nipype.utils.filemanip import loadcrash
crash_data = loadcrash(crashfile)
node = crash_data['node']
tb = crash_data['traceback']
print("\n")
print("File: %s"%crashfile)
print("Node: %s"%node)
if node.base_dir:
print("Working directory: %s" % node.output_dir())
else:
print("Node crashed before execution")
print("\n")
print("Node inputs:")
print(node.inputs)
print("\n")
print("Traceback: ")
print(''.join(tb))
print("\n")
if rerun:
print("Rerunning node")
node.base_dir = None
node.config['crashdump_dir'] = '/tmp'
node.run()
print("\n")