Skip to content

Instantly share code, notes, and snippets.

Tommy Ellqvist rexissimus

  • NYU Polytechnic School of Engineering
  • Sweden
Block or report user

Report or block rexissimus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rexissimus
rexissimus / bokeh-export.py
Created Aug 18, 2016
Export bokeh and numpy as script
View bokeh-export.py
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]
@rexissimus
rexissimus / vtk_example.py
Created Aug 10, 2016
Example of turning a vtk example into a script
View vtk_example.py
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 / new_patching.py
Created Jul 27, 2016
New patching script
View new_patching.py
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 / patches.py
Created Jul 20, 2016
New patch example
View patches.py
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:
View api_example2.py
import vistrails.core.api as API
org_vistrails_vistrails_url = API.load_package('org.vistrails.vistrails.url')
from vistrails.packages.vtk.vtk_wrapper import vvtk
import vtk
# MODULE 364 org.vistrails.vistrails.url:DownloadFile
# FUNCTION url url
url = 'http://www.vistrails.org/download/download.php?type=DATA&id=head.120.vtk'
# DEFAULT insecure insecure
insecure = False
View hybrid_script.py
import vistrails.core.api as API
from vistrails.core.modules.basic_modules import create_constant
from vistrails.core.modules.vistrails_module import ModuleConnector
org_vistrails_vistrails_url = API.load_package('org.vistrails.vistrails.url')
from vistrails.packages.vtk.vtk_wrapper import vvtk
import vtk
# MODULE 364 org.vistrails.vistrails.url:DownloadFile
# FUNCTION url url
url = 'http://www.vistrails.org/download/download.php?type=DATA&id=head.120.vtk'
@rexissimus
rexissimus / api_example.py
Created Jul 6, 2016
api scripting example
View api_example.py
import vistrails.core.api as API
from vistrails.core.modules.basic_modules import create_constant
org_vistrails_vistrails_vtk = API.load_package('org.vistrails.vistrails.vtk')
org_vistrails_vistrails_vtk_2 = API.load_package('org.vistrails.vistrails.vtk')
import requests
org_vistrails_vistrails_vtk_3 = API.load_package('org.vistrails.vistrails.vtk')
org_vistrails_vistrails_vtk_4 = API.load_package('org.vistrails.vistrails.vtk')
import vtk
org_vistrails_vistrails_vtk_5 = API.load_package('org.vistrails.vistrails.vtk')
from vistrails.core.modules.vistrails_module import ModuleConnector
@rexissimus
rexissimus / combined_rendering.py
Created Jun 29, 2016
Terminator Combined Rendering as python script
View combined_rendering.py
# Prelude
from vistrails.packages.vtk.vtk_wrapper import vvtk
# Prelude
import requests
# Prelude
from vistrails.packages.vtk.vtk_wrapper import vvtk
# Prelude
View Building Python 3 with PyQt5, QWebEngine, QScintilla, VTK on Windows 64bit
Building Python 3 with PyQt5, QWebEngine, QScintilla, VTK on Windows 64bit
Install Visual C++ 2013 (I failed to get MingW working with PyQt5)
Install the vs2013 version of Qt5
Install Python 3.4 64bit
Get sip (4.17), PyQt5 (5.5.1), and QScintilla sources
Add path to qmake to PATH
View VisTrails Python 3 PyQt5
Porting to Python 3
-------------------
2to3 transforms most py2 strings to py3 strings with unicode support
use bytes in module hasher
use encode=unicode in elementtree.serialize
New ordering logic
Porting to PytQt5
-----------------
You can’t perform that action at this time.