How to use the fury.window.show function in fury

To help you get started, we’ve selected a few fury examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fury-gl / fury / docs / experimental / viz_shader_texture.py View on Github external
)

mapper.SetFragmentShaderCode(
    """
    //VTK::System::Dec  // always start with this line
    //VTK::Output::Dec  // always have this line in your FS
    in vec3 TexCoords;
    uniform samplerCube texture_0;
    
    void main() {
        gl_FragData[0] = texture(texture_0, TexCoords);
    }
    """
)

window.show(scene)
github fury-gl / fury / test_sdfbranchmulti.py View on Github external
from fury import actor, window
import numpy as np

scene = window.Scene()
scene.background((1.0, 0.8, 0.8))
centers = np.array([[0, 0, 0]])
sdfactor = actor.multi_sdf(centers=centers, scale=6)
scene.add(sdfactor)

scene.add(actor.axes())
window.show(scene, size=(1920, 1080))
github fury-gl / fury / docs / experimental / viz_sdf.py View on Github external
}
    else{
    	fragOutput0 = vec4(0, 0, 0, 0.3);
    }



	""",
	False
)



scene.add(box_actor)
scene.add(actor.axes())
window.show(scene, size=(1920, 1200))
github fury-gl / fury / docs / experimental / viz_shader_perlin_noise_2.py View on Github external
noisyColor[i] = lowerValue;
        } else {
            if(noisyColor[i] < upperValue) {
                noisyColor[i] = upperValue;
            } else {
                noisyColor[i] = 1.;
            }
        }
    }
    fragOutput0.rgb = opacity * vec3(ambientColor + noisyColor * diffuse + specular);
    fragOutput0.a = opacity;
    """,
    False
)

window.show(scene)
github fury-gl / fury / docs / experimental / viz_shader_perlin_noise.py View on Github external
} else {
            if(noisyColor[i] < upperValue) {
                noisyColor[i] = upperValue;
            } else {
                noisyColor[i] = 1.;
            }
        }
    }
    fragOutput0.rgb = opacity * 
        vec3(ambientColor + noisyColor * diffuse + specular);
    fragOutput0.a = opacity;
    """,
    False
)

window.show(scene)
github scilus / scilpy / scripts / scil_visualize_seeds.py View on Github external
parser.error('Tractogram does not contain seeds')
    seeds = tractogram.data_per_streamline['seeds']

    # Make display objects
    streamlines_actor = actor.line(streamlines)
    points = actor.dots(seeds, color=(1., 1., 1.))

    # Add display objects to canvas
    r = window.Renderer()
    r.add(streamlines_actor)
    r.add(points)

    # Show and record if needed
    if args.save is not None:
        window.record(r, out_path=args.save, size=(1000, 1000))
    window.show(r)
github fury-gl / fury / docs / experimental / viz_canvas.py View on Github external
billboard_actor = actor.billboard(centers,
                                      colors=colors.astype(np.uint8),
                                      scale=scale,
                                      fs_dec=fs_dec,
                                      fs_impl=fake_sphere)
    scene.add(billboard_actor)
    scene.add(actor.axes())
    scene.camera_info()
    matrix = scene.camera().GetViewTransformMatrix()
    mat = np.zeros((4, 4))
    for i in range(4):
        for j in range(4):
            mat[i, j] = matrix.GetElement(i, j)
    print(mat)
    print(np.dot(-mat[:3, 3], mat[:3, :3]))  # camera position
    window.show(scene)
github scilus / scilpy / scilpy / viz / sampling_scheme.py View on Github external
for i, shell in enumerate(ms):
        if same_color:
            i = 0
        ren = window.Renderer()
        ren.SetBackground(1, 1, 1)
        if use_sphere:
            sphere_actor = actor.odf_slicer(odfs, affine, sphere=sphere,
                                            colormap='winter', scale=1.0,
                                            opacity=opacity)
            ren.add(sphere_actor)
        pts_actor = actor.point(shell, vtkcolors[i], point_radius=rad)
        ren.add(pts_actor)
        if plot_sym_vecs:
            pts_actor = actor.point(-shell, vtkcolors[i], point_radius=rad)
            ren.add(pts_actor)
        window.show(ren)

        if ofile:
            window.snapshot(ren, fname=ofile + '_shell_' + str(i) + '.png',
                            size=ores)