-
Notifications
You must be signed in to change notification settings - Fork 39
/
Settings.py
90 lines (67 loc) · 2.63 KB
/
Settings.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
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
89
90
# -*- coding: utf-8 -*-
"""
Module to set *ClearMap's* internal parameter and paths to external programs.
Notes:
Edit the :func:`setup` routine to point to the ilastik and elastix paths
for specific hosts
See Also:
* :const:`IlastikPath`
* :const:`ElastixPath`
* :mod:`~ClearMap.Parameter`
"""
import os
import socket
IlastikPath = '/usr/local/ilastik-1.1.9-Linux';
"""str: Absolute path to the Ilastik 0.5 installation
Notes:
`Ilastik Webpage <http://ilastik.org/>`_
`Ilastik 0.5 Download <http://old.ilastik.org/>`_
"""
#path to eastix installation
ElastixPath = '/usr/local/elastix';
"""str: Absolue path to the elastix installation
Notes:
`Elastix Webpage <http://elastix.isi.uu.nl/>`_
"""
def setup():
"""Setup ClearMap for specific hosts
Notes:
Edit this routine to include special setttings for specific hosts
See Also:
:const:`IlastikPath`, :const:`ElastixPath`
"""
global IlastikPath, ElastixPath
hostname = socket.gethostname();
if hostname == 'kagalaska.nld': #Christophs Laptop
IlastikPath = '/home/ckirst/programs/ilastik-1.1.9-Linux';
ElastixPath = '/home/ckirst/programs/elastix/';
elif hostname == 'mtllab-Ubuntu': #MTL workstation
IlastikPath = '/usr/local/ilastik-1.1.9-Linux';
ElastixPath = '/usr/local/elastix';
## insert your hostname specific settings here ##
#elif hostname == 'your-host-name':
# IlastikPath = 'path-to-ilastik';
# ElastixPath = 'path-to-elastix';
##
# check existence:
if not ElastixPath is None:
if not os.path.exists(ElastixPath):
#raise RuntimeWarning('Settings: elastix path %s does not exists, cf. Settings.py or type help(Settings) for details.' % ElastixPath);
print 'Settings: elastix path %s does not exists, cf. Settings.py or type help(Settings) for details.' % ElastixPath;
ElastixPath = None;
if not IlastikPath is None:
if not os.path.exists(IlastikPath):
#raise RuntimeWarning('Settings: ilastik path %s does not exists, cf. Settings.py or type help(Settings) for details.' % IlastikPath);
print 'Settings: ilastik path %s does not exists, cf. Settings.py or type help(Settings) for details.' % IlastikPath;
IlastikPath = None;
setup();
def clearMapPath():
"""Returns root path to the ClearMap software
Returns:
str: root path to ClearMap
"""
fn = os.path.split(__file__)
fn = os.path.abspath(fn[0]);
return fn;
ClearMapPath = clearMapPath();
"""str: Absolute path to the ClearMap root folder"""