本文整理汇总了Python中fos.Window.add_scene方法的典型用法代码示例。如果您正苦于以下问题:Python Window.add_scene方法的具体用法?Python Window.add_scene怎么用?Python Window.add_scene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fos.Window
的用法示例。
在下文中一共展示了Window.add_scene方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Init
# 需要导入模块: from fos import Window [as 别名]
# 或者: from fos.Window import add_scene [as 别名]
if __name__ == '__main__':
import nibabel as nib
dname = '/usr/share/fsl/data/standard/'
fname = dname + 'FMRIB58_FA_1mm.nii.gz'
fname = '/home/eg309/Data/trento_processed/subj_01/MPRAGE_32/rawbet.nii.gz'
img=nib.load(fname)
data = img.get_data()
data = np.interp(data, [data.min(), data.max()], [0, 255])
from fos import Init, Run
Init()
window = Window(caption="[F]OS", bgcolor=(0.4, 0.4, 0.9))
scene = Scene(activate_aabb=False)
guil = Guillotine('VolumeSlicer', data)
scene.add_actor(guil)
window.add_scene(scene)
window.refocus_camera()
#window = Window()
window.show()
#print get_ipython()
Run()
示例2: Line
# 需要导入模块: from fos import Window [as 别名]
# 或者: from fos.Window import add_scene [as 别名]
"""
streamlines = Line('fornix',tracks,colors,line_width=2)
from fos import Window, Scene
from fos.actor.axes import Axes
from fos.actor.text import Text3D
title='Bundle Picker'
w = Window(caption = title,
width = 1200,
height = 800,
bgcolor = (0.,0.,0.2) )
scene = Scene( scenename = 'Main',
extent_min = np.array([-5.0, -5, -5]),
extent_max = np.array([5, 5 ,5]))
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 )
tex = Text3D( "Text3D", vert, "Reg", 10, 2, ptr)
scene.add_actor(ax)
scene.add_actor(tex)
scene.add_actor(streamlines)
#w.screenshot( 'red.png' )
w.add_scene(scene)
w.refocus_camera()