Debian Codegraph @

dicompylercore/config.py

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # config.py
4 """Configuration for dicompyler-core."""
5 # Copyright (c) 2016-2018 Aditya Panchal
6 # This file is part of dicompyler-core, released under a BSD license.
7 # See the file license.txt included with this distribution, also
8 # available at https://github.com/dicompyler/dicompyler-core/
9
10 from six import PY2
11
12 mpl_available = True
13 pil_available = True
14 shapely_available = True
15 skimage_available = True
16 scipy_available = True
17
18 if PY2:
19 import imp
20 try:
21 imp.find_module('matplotlib')
22 except ImportError:
23 mpl_available = False
24
25 try:
26 imp.find_module('PIL')
27 except ImportError:
28 pil_available = False
29
30 try:
31 imp.find_module('shapely')
32 except ImportError:
33 shapely_available = False
34
35 try:
36 imp.find_module('skimage')
37 except ImportError:
38 skimage_available = False
39
40 try:
41 imp.find_module('scipy')
42 except ImportError:
43 scipy_available = False
44 else:
45 import importlib
46 mpl_available = importlib.util.find_spec("matplotlib") is not None
47 pil_available = importlib.util.find_spec('PIL') is not None
48 shapely_available = importlib.util.find_spec('shapely') is not None
49 skimage_available = importlib.util.find_spec('skimage') is not None
50 scipy_available = importlib.util.find_spec('scipy') is not None
51
52
53 # DICOM UID prefix
54 dicompyler_uid_prefix = '1.2.826.0.1.3680043.8.1070.'
55 dicompyler_uid_prefix_image = dicompyler_uid_prefix + '1.'
56 dicompyler_uid_prefix_rtstruct = dicompyler_uid_prefix + '2.'
57 dicompyler_uid_prefix_rtplan = dicompyler_uid_prefix + '3.'
58 dicompyler_uid_prefix_rtdose = dicompyler_uid_prefix + '4.'