當前位置: 首頁>>代碼示例>>Python>>正文


Python EMApp.show方法代碼示例

本文整理匯總了Python中emapplication.EMApp.show方法的典型用法代碼示例。如果您正苦於以下問題:Python EMApp.show方法的具體用法?Python EMApp.show怎麽用?Python EMApp.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在emapplication.EMApp的用法示例。


在下文中一共展示了EMApp.show方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from emapplication import EMApp [as 別名]
# 或者: from emapplication.EMApp import show [as 別名]
def main():
	progname = os.path.basename(sys.argv[0])
	usage = """prog  <projection file>  <particles file>
	
Compare different similarity metrics for a given particle stack. Note that all particles and projections are
read into memory. Do not use it on large sets of particles !!!
"""

	parser = EMArgumentParser(usage=usage,version=EMANVERSION)
	parser.add_argument("--ppid", type=int, help="Set the PID of the parent process, used for cross platform PPID",default=-1)

	(options, args) = parser.parse_args()
	
	if len(args)<2 :
		print "Error, please specify projection file and particles file"
		sys.exit(1)
	
	logid=E2init(sys.argv,options.ppid)
	
	em_app = EMApp()
	window = EM3DGLWidget() #TODO: see if this should be a subclass of EMSymViewerWidget instead
	explorer = EMCmpExplorer(window)
	window.set_model(explorer)
	explorer.set_data(args[0],args[1])

	em_app.show()
	em_app.execute()
	
	E2end(logid)
開發者ID:cpsemmens,項目名稱:eman2,代碼行數:31,代碼來源:e2cmpxplor.py

示例2: main

# 需要導入模塊: from emapplication import EMApp [as 別名]
# 或者: from emapplication.EMApp import show [as 別名]
def main():
	progname = os.path.basename(sys.argv[0])
	usage = progname + """ [options]
	A tool for displaying EMAN2 command history
	"""
	
	parser = EMArgumentParser(usage=usage)
	parser.add_argument("--gui", "-g",default=False, action="store_true",help="Open history in an interface with a sortable table.")
	parser.add_argument("--all", "-a",default=False, action="store_true",help="Show for all directories.")
	parser.add_argument("--ppid", type=int, help="Set the PID of the parent process, used for cross platform PPID",default=-1)
	parser.add_argument("--verbose", "-v", dest="verbose", action="store", metavar="n", type=int, default=0, help="verbose level [0-9], higner number means higher level of verboseness")
	
	(options, args) = parser.parse_args()
	
	if options.gui:
		from emapplication import EMApp
		app = EMApp()
		hist = HistoryForm(app,os.getcwd())
		app.show()
		app.execute()
		
	else: print_to_std_out(options.all)
開發者ID:cpsemmens,項目名稱:eman2,代碼行數:24,代碼來源:e2history.py

示例3: main

# 需要導入模塊: from emapplication import EMApp [as 別名]
# 或者: from emapplication.EMApp import show [as 別名]
def main():
	progname = os.path.basename(sys.argv[0])
	usage = """prog  <simmx file> <projection file>  <particles file>

	This program allows you to look at per-particle classification based on a pre-computed similarity
	matrix. If a particle seems to be mis-classified, you can use this program to help figure out
	why. It will display a single asymmetric triangle on the unit sphere, with cylinders representing
	the similarity value for the selected particle vs. each possible reference projection. Use the
	normal middle-click on the asymmetric unit viewer for more options.
"""

	parser = EMArgumentParser(usage=usage,version=EMANVERSION)

	parser.add_argument("--ppid", type=int, help="Set the PID of the parent process, used for cross platform PPID",default=-1)
	parser.add_argument("--verbose", "-v", dest="verbose", action="store", metavar="n", type=int, default=0, help="verbose level [0-9], higner number means higher level of verboseness")

	(options, args) = parser.parse_args()



	logid=E2init(sys.argv,options.ppid)

	em_app = EMApp()

	window = EMSymViewerWidget()
	explorer = EMSimmxExplorer(window)
	window.model = explorer

	if len(args) > 0: explorer.set_simmx_file(args[0])
	if len(args) > 1: explorer.set_projection_file(args[1])
	if len(args) > 2: explorer.set_particle_file(args[2])

	em_app.show()
	em_app.execute()

	E2end(logid)
開發者ID:cpsemmens,項目名稱:eman2,代碼行數:38,代碼來源:e2simmxxplor.py

示例4: perspective_clicked

# 需要導入模塊: from emapplication import EMApp [as 別名]
# 或者: from emapplication.EMApp import show [as 別名]
	
	def perspective_clicked(self):
		self.target().set_perspective(True)
		
	def ortho_clicked(self):
		self.target().set_perspective(False)


class EMImage3DModule(EMImage3DWidget):
	def __init__(self, parent=None, image=None,application=None,winid=None):
		import warnings	
		warnings.warn("convert EMImage3DModule to EMImage3DWidget", DeprecationWarning)
		EMImage3DWidget.__init__(self, parent, image, application, winid)
	
if __name__ == '__main__':
	from emapplication import EMApp
	import sys
	em_app = EMApp()
	window = EMImage3DWidget(application=em_app)

	if len(sys.argv)==1 : 
		data = []
		#for i in range(0,200):
		e = test_image_3d(1,size=(64,64,64))
		window.set_data(e)
	else :
		a=EMData(sys.argv[1])
		window.set_data(a,sys.argv[1])
	em_app.show()
	em_app.execute()
開發者ID:CVL-dev,項目名稱:StructuralBiology,代碼行數:32,代碼來源:emimage3d.py

示例5: on_threshold_slider

# 需要導入模塊: from emapplication import EMApp [as 別名]
# 或者: from emapplication.EMApp import show [as 別名]
			if ( i == current_color):
				self.cbb.setCurrentIndex(a)
			a += 1

	def on_threshold_slider(self,val):
		self.target().set_threshold(val)
		self.bright.setValue(-val,True)
		
	def set_thresholds(self,low,high,val):
		self.thr.setRange(low,high)
		self.thr.setValue(val, True)
		self.bright.setValue(-val,True)
	
	def set_sample(self,low,high,val):
		self.smp.setRange(int(low),int(high))
		self.smp.setValue(val, True)
		
	def set_hist(self,hist,minden,maxden):
		self.hist.set_data(hist,minden,maxden)

if __name__ == '__main__':
	from emglobjects import EM3DGLWidget
	from emapplication import EMApp
	app = EMApp()
	window = EM3DGLWidget()
	iso_model = EMIsosurfaceModel(window, test_image_3d(1,size=(64,64,64)))
	window.set_model(iso_model)
	window.updateGL()
	
	app.show()
	app.execute()
開發者ID:cpsemmens,項目名稱:eman2,代碼行數:33,代碼來源:emimage3diso.py


注:本文中的emapplication.EMApp.show方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。