本文整理匯總了Python中fos.Window.add_region方法的典型用法代碼示例。如果您正苦於以下問題:Python Window.add_region方法的具體用法?Python Window.add_region怎麽用?Python Window.add_region使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fos.Window
的用法示例。
在下文中一共展示了Window.add_region方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Texture3D
# 需要導入模塊: from fos import Window [as 別名]
# 或者: from fos.Window import add_region [as 別名]
#volume = data
tex = Texture3D('Buzz', volume, affine)
w, h, d = volume.shape[:-1]
depindex = 100
dep = (0.5 + depindex) / np.float(d)
texcoords = np.array([ [dep, 0, 0],
[dep, 0, 1],
[dep, 1, 1],
[dep, 1, 0] ])
vertcoords = np.array( [ [-w/2., -h/2., 0.],
[-w/2., h/2., 0.],
[w/2., h/2., 0.],
[w/2, -h/2., 0] ])
tex.update_quad(texcoords, vertcoords)
ax = Axes(name="3 axes", linewidth=2.0)
vert = np.array([[2.0,3.0,0.0]], dtype = np.float32)
ptr = np.array([[.2,.2,.2]], dtype = np.float32)
text = Text3D("Text3D", vert, "Reg", 20, 6, ptr)
region.add_actor(tex)
#region.add_actor(ax)
region.add_actor(text)
window.add_region(region)
window.refocus_camera()
示例2: Slicer
# 需要導入模塊: from fos import Window [as 別名]
# 或者: from fos.Window import add_region [as 別名]
vol_shape=(182, 218, 182),tracks_alpha=1)
#add a interactive slicing/masking tool
#sl = Slicer(affine,data)
#add one way communication between tl and sl
#tl.slicer=sl
title = 'Bundle Picking'
w = Window(caption = title,
width = 1200,
height = 800,
bgcolor = (0.,0.,0.2) )
region = Region( regionname = 'Main',
extent_min = np.array([-5.0, -5, -5]),
extent_max = np.array([5, 5 ,5]))
ax = Axes(name = "3 axes", scale= 10, linewidth=2.0)
vert = np.array( [[2.0,3.0,0.0]], dtype = np.float32 )
ptr = np.array( [[.2,.2,.2]], dtype = np.float32 )
tex = Text3D( "Text3D", vert, "(0,0,0)", 10*2.5, 10*.5, ptr)
#region.add_actor(ax)
#region.add_actor(tex)
region.add_actor(tl)
#region.add_actor(streamlines)
#w.screenshot( 'red.png' )
w.add_region(region)
w.refocus_camera()