Example #1
0
def test_ui_image_container_2d(interactive=False):
    image_test = ui.ImageContainer2D(img_path=read_viz_icons(
        fname='home3.png'))

    image_test.center = (300, 300)
    npt.assert_equal(image_test.size, (100, 100))

    image_test.scale((2, 2))
    npt.assert_equal(image_test.size, (200, 200))

    current_size = (600, 600)
    show_manager = window.ShowManager(size=current_size, title="FURY Button")
    show_manager.scene.add(image_test)
    if interactive:
        show_manager.start()
Example #2
0
ring = ui.Disk2D(outer_radius=50, inner_radius=45, center=(500, 300),
                 color=(0, 1, 1))

###############################################################################
# Image
# =====
#
# Now let's display an image. First we need to fetch some icons that are
# included in DIPY.

fetch_viz_icons()

###############################################################################
# Now we can create an image container.

img = ui.ImageContainer2D(img_path=read_viz_icons(fname='home3.png'),
                          position=(450, 350))

###############################################################################
# Panel with buttons and text
# ===========================
#
# Let's create some buttons and text and put them in a panel. First we'll
# make the panel.

panel = ui.Panel2D(size=(300, 150), color=(1, 1, 1), align="right")
panel.center = (500, 400)

###############################################################################
# Then we'll make two text labels and place them on the panel.
# Note that we specifiy the position with integer numbers of pixels.