本文整理汇总了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()