forked from gacevedobolton/myVTKPythonLibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitImage.py
30 lines (24 loc) · 1.13 KB
/
initImage.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
#!/usr/bin/python
#coding=utf8
########################################################################
### ###
### Created by Martin Genet, 2012-2016 ###
### ###
### University of California at San Francisco (UCSF), USA ###
### Swiss Federal Institute of Technology (ETH), Zurich, Switzerland ###
### École Polytechnique, Palaiseau, France ###
### ###
########################################################################
import myVTKPythonLibrary as myVTK
########################################################################
def initImage(
image=None,
image_filename=None,
verbose=1):
assert ((image is not None) or (image_filename is not None)), "Need an image or an image_filename. Aborting."
if image is None:
return myVTK.readImage(
filename=image_filename,
verbose=verbose)
else:
return image