plotly_tools.
make_brainsurf
(surfname, orientation=True, orientation_lines=True, orientation_labels=True, orientation_lw=2, orientation_lcolor='black', orientation_fsize=18, orientation_fcolor='black', shiny_srf=True, surf_opac=1.0, surf_color='Gainsboro', view=None)[source]¶Create Plotly graph objects to render brain surfaces
Parameters: | surfname : string
orientation : bool
orientation_lines : bool
orientation_labels : bool
orientation_lw : float
orientation_lcolor : string
orientation_fsize : int
orientation_fcolor : string
shiny_srf : bool
surf_opac : float
surf_color : str
view : str
|
---|---|
Returns: | ply_dict : dict
|
See also
Plotly
D3.js
Notes
None
Examples
The following command returns a dictionary of Plotly objects to render the BrainMesh_Ch2withCerebellum brain as fully opaque glossy surface and sets up the initial camera view point in axial position
>>> pyt_dict = pyt.make_brainsurf('BrainMesh_Ch2withCerebellum', view='Axial')
The generated objects can be subsequently used to create a HTML file for rendering the surface in a web-browser based on embedded JavaScript code that employs D3.js functionality
>>> import plotly.offline as po
>>> import plotly.graph_objs as go
>>> layout = go.Layout(scene=pyt_dict['scene'])
>>> fig = go.Figure(data=[pyt_dict['brain'],
pyt_dict['orientation_labels'],
pyt_dict['orientation_lines']],
layout=layout)
>>> po.plot(fig, filename='brain.html')