Created
August 9, 2013 04:04
-
-
Save thewtex/6191109 to your computer and use it in GitHub Desktop.
View tubes with TubeTK/PyQtGraph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import tubetk | |
from tubetk.numpy import tubes_from_file | |
from tubetk.pyqtgraph import tubes_as_circles | |
import pyqtgraph as pg | |
import pyqtgraph.opengl as gl | |
if len(sys.argv) < 2: | |
print('Usage: view-tubes.py <tubes.tre>') | |
sys.exit(1) | |
tubes_filepath = sys.argv[1] | |
app = pg.mkQApp() | |
view = gl.GLViewWidget() | |
axis = gl.GLAxisItem() | |
view.addItem(axis) | |
tubes = tubes_from_file(tubes_filepath) | |
circles = tubes_as_circles(tubes) | |
circles_mesh = gl.GLMeshItem(meshdata=circles, smooth=False) | |
view.addItem(circles_mesh) | |
view.show() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment