MCPcopy Create free account
hub / github.com/Image-Py/imagepy / check

Method check

imagepy/core/engine/simple.py:69–103  ·  view source on GitHub ↗
(self, ips)

Source from the content-addressed store, hash-verified

67 if callback!=None:callback()
68
69 def check(self, ips):
70 note = self.note
71 if ips == None:
72 IPy.alert('No image opened!')
73 return False
74 if 'req_roi' in note and ips.roi == None:
75 IPy.alert('No Roi found!')
76 return False
77 if not 'all' in note:
78 if ips.get_imgtype()=='rgb' and not 'rgb' in note:
79 IPy.alert('Do not surport rgb image')
80 return False
81 elif ips.get_imgtype()=='8-bit' and not '8-bit' in note:
82 IPy.alert('Do not surport 8-bit image')
83 return False
84 elif ips.get_imgtype()=='16-bit' and not '16-bit' in note:
85 IPy.alert('Do not surport 16-bit uint image')
86 return False
87 elif ips.get_imgtype()=='32-int' and not 'int' in note:
88 IPy.alert('Do not surport 32-bit int uint image')
89 return False
90 elif 'float' in ips.get_imgtype() and not 'float' in note:
91 IPy.alert('Do not surport float image')
92 return False
93 if sum([i in note for i in ('stack','stack2d','stack3d')])>0:
94 if ips.get_nslices()==1:
95 IPy.alert('Stack required!')
96 return False
97 elif 'stack2d' in note and ips.is3d:
98 IPy.alert('Stack2d required!')
99 return False
100 elif 'stack3d' in note and not ips.is3d:
101 IPy.alert('Stack3d required!')
102 return False
103 return True
104
105 def start(self, para=None, callback=None):
106 #print self.title, para

Callers 1

startMethod · 0.95

Calls 2

get_imgtypeMethod · 0.80
get_nslicesMethod · 0.80

Tested by

no test coverage detected