visbrain.objects.RoiObj¶
- class visbrain.objects.RoiObj(name, vol=None, labels=None, index=None, hdr=None, system='mni', transform=None, parent=None, verbose=None, preload=True, _scale=1.0, **kw)[source][source]¶
Create a Region Of Interest (ROI) object.
Main functionalities
Display a mesh of selected ROIs
Localize sources
Supported ROI
Brodmann Areas
Talairach atlas
Automated Anatomical Labeling (AAL)
MIST, including levels 7, 12, 20, 36, 64, 122 and ROI [1]
- 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. MIST [1] is also supported. To specify a resolution use mist_%s with %s in [‘7’, ‘12’, ‘20’, ‘36’, ‘64’, ‘122’, ‘ROI’] (e.g ‘mist_7’, mist_ROI)
- volarray_like | None
ROI volume. Sould be an array with three dimensions.
- labelsarray_like | None
Array of labels. A structured array can be used (i.e label=np.zeros(n_sources, dtype=[(‘brodmann’, int), (‘aal’, object)])).
- indexarray_like | None
Array of index that make the correspondance between the volume values and labels. The length of index must be the same as label.
- hdrarray_like | None
Array of transform source’s coordinates into the volume space. Must be a (4, 4) array.
- system{‘mni’, ‘tal’}
The system of the volume. Can either be MNI (‘mni’) or Talairach (‘tal’).
- transformVisPy.visuals.transforms | None
VisPy transformation to set to the parent node.
- parentVisPy.parent | None
ROI object parent.
- verbosestring
Verbosity level.
- kwdict | {}
Optional arguments are used to control the colorbar (See
ColorbarObj
).
Notes
List of supported shortcuts :
s : save the figure
<delete> : reset camera
References
Examples
>>> import numpy as np >>> from visbrain.objects import RoiObj >>> r = RoiObj('brodmann') >>> r.select_roi(select=[4, 6, 38], unique_color=True, smooth=7) >>> r.preview(axis=True)
Methods
__init__
(name[, vol, labels, index, hdr, ...])Init.
animate
([step, interval, iterations])Animate the object.
copy
()Get a copy of the object.
Tree description.
get_centroids
(select)Get the (x, y, z) coordinates of the center of a ROI.
get_labels
([save_to_path])Get the labels associated with the loaded ROI.
list
([file])Get the list of installed volumes.
localize_sources
(xyz[, source_name, ...])Localize source's using this ROI object.
pos_to_slice
(pos[, axis, hdr])Return the slice from position.
preview
([bgcolor, axis, xyz, show, obj, ...])Previsualize the result.
project_sources
(s_obj[, project, radius, ...])Project source's activity or repartition onto ROI.
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.
reset
()Reset the RoiObject.
save
([tmpfile])Save the volume template.
screenshot
(saveas[, print_size, dpi, unit, ...])Take a screeshot of the scene.
select_roi
([select, unique_color, ...])Select several Region Of Interest (ROI).
set_data
(name[, vol, labels, index, hdr, system])Load an roi object.
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.
where_is
(patterns[, df, union, columns, ...])Find a list of string patterns in a DataFrame.
Examples using visbrain.objects.RoiObj
¶

Region Of Interest object (RoiObj) : complete tutorial