Пример #1
0
def timer_callback(_obj, _event):
    global current_Timepoint, Timepoint, c
    cnt = next(counter)
    maxcnt = 1000
    Logic_check = (current_Timepoint == Timepoint)
    current_Timepoint = Timepoint
    tb.message = "Time Point : " + str(Timepoint)+ " hrs"
    scene.add(tb)
    #scene.camera_info()
    if (Logic_check == False):
        window.rm_all(scene)
        scene.add(Sphere_Actor_List[Timepoint])
        current_Timepoint = Timepoint
        showm.scene.add(line_slider)
        print('Slider Changed')
    scene.add(tb)
    x_label = actor.text_3d(text='x axis (micron)',position=(-100,-900,550),font_size=50,justification='left')
    scene.add(x_label)
    y_label = actor.text_3d(text='y axis (micron)',position=(-900,0,550),font_size=50,justification='left')
    scene.add(y_label)
    z_label = actor.text_3d(text='z axis (micron)',position=(600,-900,0),font_size=50,justification='left')
    scene.add(z_label)
    scene.add(c)
    if cnt == maxcnt:
        showm.exit()
    showm.render()
Пример #2
0
def test_deprecated():
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always", DeprecationWarning)
        scene = window.Renderer()
        npt.assert_equal(scene.size(), (0, 0))
        npt.assert_equal(len(w), 1)
        npt.assert_(issubclass(w[-1].category, DeprecationWarning))

    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always", DeprecationWarning)
        scene = window.renderer(background=(0.0, 1.0, 0.0))
        npt.assert_equal(scene.size(), (0, 0))
        npt.assert_equal(len(w), 1)
        npt.assert_(issubclass(w[-1].category, DeprecationWarning))

    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always", DeprecationWarning)
        scene = window.ren()
        npt.assert_equal(scene.size(), (0, 0))
        npt.assert_equal(len(w), 2)
        npt.assert_(issubclass(w[-1].category, DeprecationWarning))

    scene = window.Scene()
    with warnings.catch_warnings(record=True) as l_warn:
        warnings.simplefilter("always", DeprecationWarning)
        obj = actor.axes(scale=(1, 1, 1))
        window.add(scene, obj)
        arr = window.snapshot(scene)
        report = window.analyze_snapshot(arr)
        npt.assert_equal(report.objects, 3)
        window.rm(scene, obj)
        arr = window.snapshot(scene)
        report = window.analyze_snapshot(arr)
        npt.assert_equal(report.objects, 0)
        window.add(scene, obj)
        window.rm_all(scene)
        arr = window.snapshot(scene)
        report = window.analyze_snapshot(arr)
        npt.assert_equal(report.objects, 0)
        window.add(scene, obj)
        window.clear(scene)
        report = window.analyze_renderer(scene)
        npt.assert_equal(report.actors, 0)
        deprecated_warns = [
            w for w in l_warn if issubclass(w.category, DeprecationWarning)
        ]
        npt.assert_equal(len(deprecated_warns), 7)
        npt.assert_(issubclass(l_warn[-1].category, DeprecationWarning))
Пример #3
0
def my_visu(sf, sphere, rot=True, norm=True, scale=True, title="Modeling"):
    ren = window.renderer(background=window.colors.white)

    sf_actor = actor.odf_slicer(sf,
                                sphere=sphere,
                                colormap='jet',
                                scale=0.4,
                                norm=norm,
                                radial_scale=scale)
    if rot:
        sf_actor.RotateX(90)
    ren.add(sf_actor)
    window.show(ren, title=title, size=WINDOW_SIZE)

    ren.rm(sf_actor)
    window.rm_all(ren)