Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
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)
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))
}
else{
fragOutput0 = vec4(0, 0, 0, 0.3);
}
""",
False
)
scene.add(box_actor)
scene.add(actor.axes())
window.show(scene, size=(1920, 1200))
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)
} 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)
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)
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)
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)