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_file
str
orNone
, optional Output file path.
- figurePlotly figure instance or
- Attributes:
- figurePlotly figure instance
Plotly figure. Use this attribute to access the underlying plotly figure for further customization and use plotly functionality.
- output_file
str
Output file path.
- show(renderer='browser')[source]¶
Show the figure.
- Parameters:
- renderer
str
, default=’browser’ Plotly renderer to be used.
- renderer
- savefig(output_file=None)[source]¶
Save the figure to file.
- Parameters:
- output_file
str
orNone
, optional Path to output file.
- output_file
- add_contours(roi_map, levels=None, labels=None, lines=None, elevation=0.1, hemi='left')[source]¶
Draw boundaries around roi.
- Parameters:
- roi_map
str
ornumpy.ndarray
orlist
ofnumpy.ndarray
orSurfaceImage
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.- levels
list
ofint
, orNone
, 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. IfNone
, all regions in roi_map are used.- labels
list
ofstr
orNone
, default=None A
list
of labels for the individual regions of interest. ProvideNone
as list entry to skip showing the label of that region. IfNone
, no labels are used.- lines
list
ofdict
giving the properties of the contours, orNone
, 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.- elevations
float
, 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.
- roi_map
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