brainspace.vtk_interface.wrappers.data_object.BSCompositeDataSet¶
-
class
brainspace.vtk_interface.wrappers.data_object.
BSCompositeDataSet
(vtkobject=None, **kwargs)[source]¶ Wrapper for vtkCompositeDataSet.
-
__init__
(vtkobject=None, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
GetAttributes
(type)Returns the attributes specified by the type as a CompositeDataSetAttributes instance. GetCellData
()Returns the cell data as a DataSetAttributes instance. GetFieldData
()Returns the field data as a DataSetAttributes instance. GetNumberOfCells
()Returns the total number of cells of all datasets in the composite dataset. GetNumberOfElements
(assoc)Returns the total number of cells or points depending on the value of assoc which can be ArrayAssociation.POINT or ArrayAssociation.CELL. GetNumberOfPoints
()Returns the total number of points of all datasets in the composite dataset. GetPointData
()Returns the point data as a DataSetAttributes instance. GetPoints
()Returns the points as a VTKCompositeDataArray instance. __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
CellData
This property returns the cell data of a dataset. FieldData
This property returns the field data of a dataset. PointData
This property returns the point data of the dataset. Points
This property returns the points of the dataset. field_keys
Returns keys of field data. n_field_data
Returns number of entries in field data. vtk_map
Dictionary of vtk setter and getter methods. -
CellData
¶ This property returns the cell data of a dataset.
-
FieldData
¶ This property returns the field data of a dataset.
-
GetAttributes
(type)¶ Returns the attributes specified by the type as a CompositeDataSetAttributes instance.
-
GetCellData
()¶ Returns the cell data as a DataSetAttributes instance.
-
GetFieldData
()¶ Returns the field data as a DataSetAttributes instance.
-
GetNumberOfCells
()¶ Returns the total number of cells of all datasets in the composite dataset. Note that this traverses the whole composite dataset every time and should not be called repeatedly for large composite datasets.
-
GetNumberOfElements
(assoc)¶ Returns the total number of cells or points depending on the value of assoc which can be ArrayAssociation.POINT or ArrayAssociation.CELL.
-
GetNumberOfPoints
()¶ Returns the total number of points of all datasets in the composite dataset. Note that this traverses the whole composite dataset every time and should not be called repeatedly for large composite datasets.
-
GetPointData
()¶ Returns the point data as a DataSetAttributes instance.
-
GetPoints
()¶ Returns the points as a VTKCompositeDataArray instance.
-
PointData
¶ This property returns the point data of the dataset.
-
Points
¶ This property returns the points of the dataset.
-
field_keys
¶ Returns keys of field data.
Type: list of str
-
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'
-