Skip to content

Instantly share code, notes, and snippets.

View rexissimus's full-sized avatar
💭
I may be slow to respond.

Tommy Ellqvist rexissimus

💭
I may be slow to respond.
  • Inify LAboratories AB
  • Sweden
View GitHub Profile
@rexissimus
rexissimus / patches.py
Created July 20, 2016 14:40
New patch example
patches = {
'UpdateAlgorithm':
"""
is_aborted = [False]
if hasattr($self, '_callback') and $self._callback is not None:
cbId = None
def ProgressEvent(obj, event):
try:
$self._callback(obj.GetProgress())
except Exception, e:
@rexissimus
rexissimus / new_patching.py
Created July 27, 2016 14:19
New patching script
import vtk
import vistrails.core.scripting.api as api
org_vistrails_vistrails_url = api.Package('org.vistrails.vistrails.url')
import locale
import os
from vistrails.packages.vtk import tf_widget
# MODULE 381 org.vistrails.vistrails.vtk:vtkVolumeRayCastCompositeFunction
vtk_volume_ray_cast_composite_function = vtk.vtkVolumeRayCastCompositeFunction()
vtk_volume_ray_cast_composite_function.vtkInstance = vtk_volume_ray_cast_composite_function
@rexissimus
rexissimus / vtk_example.py
Created August 10, 2016 14:51
Example of turning a vtk example into a script
import vtk
# MODULE 61 org.vistrails.vistrails.vtk:vtkCellArray
vtk_cell_array = vtk.vtkCellArray()
vtk_cell_array.vtkInstance = vtk_cell_array
vtk_cell_array.InsertNextCell(12)
vtk_cell_array.InsertCellPoint(0)
vtk_cell_array.InsertCellPoint(1)
vtk_cell_array.InsertCellPoint(2)
vtk_cell_array.InsertCellPoint(3)
@rexissimus
rexissimus / bokeh-export.py
Created August 18, 2016 20:43
Export bokeh and numpy as script
import bokeh.plotting
import importlib
import vistrails
org_vistrails_vistrails_bokeh = vistrails.load_package('org.vistrails.vistrails.bokeh')
# MODULE 20 org.vistrails.vistrails.bokeh:plotting|circle
# FUNCTION x_list x_list
x_list = [3, 4, 5]
# FUNCTION y_list y_list
y_list = [4, 5, 6]