Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.plotting.displays.PlotlySurfaceFigure

class nilearn.plotting.displays.PlotlySurfaceFigure(figure=None, output_file=None)[source]

Implementation of a surface figure obtained with plotly engine.

Parameters:
figurePlotly figure instance or None, optional

Plotly figure instance to be used.

output_filestr or None, optional

Output file path.

Attributes:
figurePlotly figure instance

Plotly figure. Use this attribute to access the underlying plotly figure for further customization and use plotly functionality.

output_filestr

Output file path.

__init__(figure=None, output_file=None)[source]
show(renderer='browser')[source]

Show the figure.

Parameters:
rendererstr, default=’browser’

Plotly renderer to be used.

savefig(output_file=None)[source]

Save the figure to file.

Parameters:
output_filestr or None, optional

Path to output file.

add_contours(roi_map, levels=None, labels=None, lines=None, elevation=0.1, hemi='left')[source]

Draw boundaries around roi.

Parameters:
roi_mapstr or numpy.ndarray or list of numpy.ndarray or SurfaceImage

ROI map to be displayed on the surface mesh, can be a file (valid formats are .gii, .mgz, .nii, .nii.gz, or FreeSurfer specific files such as .annot or .label), or a Numpy array with a value for each vertex of the surf_mesh. The value at each vertex is one inside the ROI and zero outside the ROI, or an int giving the label number for atlases.

levelslist of int, or None, default=None

A list of indices of the regions that are to be outlined. Every index needs to correspond to one index in roi_map. If None, all regions in roi_map are used.

labelslist of str or None, default=None

A list of labels for the individual regions of interest. Provide None as list entry to skip showing the label of that region. If None, no labels are used.

lineslist of dict giving the properties of the contours, or None, default=None

For valid keys, see plotly.graph_objects.Scatter3d.line. If length 1, the properties defined in that element will be used to draw all requested contours.

elevationsfloat, default=0.1

Controls how high above the face each boundary should be placed. 0.0 implies directly on boundary, and higher values are farther above the face. This is useful for avoiding overlap of surface and boundary.

Warning

Warns when a vertex is isolated; it will not be included in the roi contour.

Notes

Regions are traced by connecting the centroids of non-isolated faces (triangles).

Examples using nilearn.plotting.displays.PlotlySurfaceFigure

Making a surface plot of a 3D statistical map

Making a surface plot of a 3D statistical map