brainspace.vtk_interface.wrappers.actor.BSScalarBarActor

class brainspace.vtk_interface.wrappers.actor.BSScalarBarActor(vtkobject=None, **kwargs)[source]

Wrapper for vtkScalarBarActor.

Unresolved requests are forwarded to its 2D property.

__init__(vtkobject=None, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

GetProperty() Get property.
SetAnnotationTextProperty([obj]) Set annotation text property.
SetBackgroundProperty([obj]) Set background property.
SetFrameProperty([obj]) Set frame property.
SetLabelTextProperty([obj]) Set label text property.
SetTitleTextProperty([obj]) Set title text property.
__init__([vtkobject]) Initialize self.
getVTK(*args, **kwargs) Invoke get methods on the vtk object.
setVTK(*args, **kwargs) Invoke set methods on the vtk object.

Attributes

vtk_map Dictionary of vtk setter and getter methods.
GetProperty()

Get property.

Wraps the GetProperty method of vtkActor2D to return a wrapped property.

Returns:prop (BSProperty2D) – Actor’s property.
SetAnnotationTextProperty(obj=None, **kwargs)[source]

Set annotation text property.

Wraps the SetAnnotationTextProperty method of vtkScalarBarActor to accept a vtkTextProperty or BSTextProperty.

Parameters:
  • obj (vtkTextProperty or BSTextProperty, optional) – Annotation text property. If None, the property is created. Default is None.
  • kwargs (optional keyword arguments) – Arguments are use to set the property.
SetBackgroundProperty(obj=None, **kwargs)[source]

Set background property.

Wraps the SetBackgroundProperty method of vtkScalarBarActor to accept a vtkProperty2D or BSProperty2D.

Parameters:
  • obj (vtkProperty2D or BSProperty2D, optional) – Background property. If None, the property is created. Default is None.
  • kwargs (optional keyword arguments) – Arguments are use to set the property.
SetFrameProperty(obj=None, **kwargs)[source]

Set frame property.

Wraps the SetFrameProperty method of vtkScalarBarActor to accept a vtkProperty2D or BSProperty2D.

Parameters:
  • obj (vtkProperty2D or BSProperty2D, optional) – Frame property. If None, the property is created. Default is None.
  • kwargs (optional keyword arguments) – Arguments are use to set the property.
SetLabelTextProperty(obj=None, **kwargs)[source]

Set label text property.

Wraps the SetLabelTextProperty method of vtkScalarBarActor to accept a vtkTextProperty or BSTextProperty.

Parameters:
  • obj (vtkTextProperty or BSTextProperty, optional) – Label text property. If None, the property is created. Default is None.
  • kwargs (optional keyword arguments) – Arguments are use to set the property.
SetTitleTextProperty(obj=None, **kwargs)[source]

Set title text property.

Wraps the SetTitleTextProperty method of vtkScalarBarActor to accept a vtkTextProperty or BSTextProperty.

Parameters:
  • obj (vtkTextProperty or BSTextProperty, optional) – Title text property. If None, the property is created. Default is None.
  • kwargs (optional keyword arguments) – Arguments are use to set the property.
getVTK(*args, **kwargs)

Invoke get methods on the vtk object.

Parameters:
  • args (list of str) – Method that require no arguments.
  • kwargs (list of keyword-value arguments) – key-word arguments can be use for methods that require arguments. When several arguments are required, use a tuple. Methods that require no arguments can also be used here using None as the argument.
Returns:

results (dict) – Dictionary of results where the keys are the method names and the values the results.

Examples

>>> import vtk
>>> from brainspace.vtk_interface.wrappers import BSVTKObjectWrapper
>>> m1 = BSVTKObjectWrapper(vtk.vtkPolyDataMapper())
>>> m1.getVTK('arrayId', colorModeAsString=None)
{'arrayId': -1, 'colorModeAsString': 'Default'}
>>> m1.getVTK('colorModeAsString', arrayId=None)
{'colorModeAsString': 'Default', 'arrayId': -1}
>>> m1.getVTK(numberOfInputConnections=0)
{'numberOfInputConnections': 0}
setVTK(*args, **kwargs)

Invoke set methods on the vtk object.

Parameters:
  • args (list of str) – Setter methods that require no arguments.
  • kwargs (list of keyword-value arguments) – key-word arguments can be use for methods that require arguments. When several arguments are required, use a tuple. Methods that require no arguments can also be used here using None as the argument.
Returns:

self (BSVTKObjectWrapper object) – Return self.

Examples

>>> import vtk
>>> from brainspace.vtk_interface.wrappers import BSVTKObjectWrapper
>>> m1 = BSVTKObjectWrapper(vtk.vtkPolyDataMapper())
>>> m1.setVTK(arrayId=3, colorMode='mapScalars')
<brainspace.vtk_interface.base.BSVTKObjectWrapper at 0x7f38a4ace320>
>>> m1.arrayId
3
>>> m1.colorModeAsString
'MapScalars'
vtk_map

Dictionary of vtk setter and getter methods.

Type:dict