visbrain.objects.CrossSecObj¶
- class visbrain.objects.CrossSecObj(name, vol=None, hdr=None, coords=None, contrast=0.0, interpolation='nearest', text_size=13.0, text_color='white', text_bold=True, transform=None, parent=None, verbose=None, preload=True, **kw)[source][source]¶
Create a Cross-sections object.
- Parameters:
- namestring
Name of the ROI object. If name is ‘brodmann’, ‘aal’ or ‘talairach’ a predefined ROI object is used and vol, index and label are ignored.
- volarray_like | None
The volume to use for the cross-section. Sould be an array with three dimensions.
- coordstuple | None
The MNI coordinates of the point where the cut is performed. Must be a tuple of three floats for (x, y, z).
- contrastfloat | 0.
The contrast of the background image 0. <= contrast <= 1.
- interpolationstring | ‘nearest’
Interpolation method for the image. See vispy.scene.visuals.Image for availables interpolation methods. Use ‘nearest’ for no interpolation.
- text_sizefloat | 13.
Text size to use.
- text_colorstring/tuple | ‘white’
Text color.
- text_boldbool | True
Use bold text.
- transformVisPy.visuals.transforms | None
VisPy transformation to set to the parent node.
- parentVisPy.parent | None
ROI object parent.
- verbosestring
Verbosity level.
Notes
List of supported shortcuts :
s : save the figure
+, - : Increase / decrease contrast.
x, X : Move along the x-axis.
y, Y : Move along the y-axis
z, Z : Move along the z-axis
c : Display / hide the cross.
Examples
>>> import numpy as np >>> from visbrain.objects import CrossSecObj >>> r = CrossSecObj('brodmann', coords=(10., -10., 20.)) >>> r.preview(axis=True)
Methods
__init__
(name[, vol, hdr, coords, contrast, ...])Init.
animate
([step, interval, iterations])Animate the object.
copy
()Get a copy of the object.
cut_coords
([coords])Cut at a specific MNI coordinate.
Tree description.
highlight_sources
(xyz[, radius, color])Highlight a number of sources.
list
([file])Get the list of installed volumes.
localize_source
(coords)Cut at a specific MNI coordinate and display the cross.
pos_to_slice
(pos[, axis, hdr])Return the slice from position.
preview
([bgcolor, axis, xyz, show, obj, ...])Previsualize the result.
record_animation
(name[, n_pic, bgcolor])Record an animated object and save as a *.gif file.
remove
()Remove the volume template.
render
()Render the canvas.
save
([tmpfile])Save the volume template.
screenshot
(saveas[, print_size, dpi, unit, ...])Take a screeshot of the scene.
set_activation
(data[, xyz, translucent, ...])Set any type of additional data (activation, stat...).
set_shortcuts_to_canvas
(canvas)Set shortcuts to a VisbrainCanvas.
slice_to_pos
(sl[, axis, hdr])Return the position from slice in the volume space.
to_dict
()Return a dictionary of all colorbar args.
to_kwargs
([addisminmax])Return a dictionary for input arguments.
update
()Fonction to run when an update is needed.
update_from_dict
(kwargs)Update attributes from a dictionary.