Skip to content

Instantly share code, notes, and snippets.

@thewtex
thewtex / TubeTK Tube NumPy Array and Property Histograms.ipynb
Created July 4, 2013 05:20
TubeTK Tube NumPy Array and Property Histograms IPython Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewtex
thewtex / CMakeCacheToTryRun.py
Created July 5, 2013 04:54
When cross compiling with CMake, the CMake introspection process may involve "try_run" calls where an executable in run on the target system to learn some information about the target system. Since we are cross compiling, attempting to run the executable on the host is not possible or informative. As a result, the initial CMake configuration on …
#!/usr/bin/env python
"""When cross compiling with CMake, the CMake introspection process may involve
"try_run" calls where an executable in run on the target system to learn some
information about the target system. Since we are cross compiling, attempting
to run the executable on the host is not possible or informative.
As a result, the initial CMake configuration on the host system will fail, but
it will create a file called TryRunResults.cmake that contains entries that
must result from the target system. These entries can be found by running a
@thewtex
thewtex / TubeTK__Intra-operative_Ultrasound_Registration.ipynb
Last active December 19, 2015 16:39
TubeTK/Intra-operative Ultrasound Registration‎
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thewtex
thewtex / view-polydata.py
Last active December 20, 2015 18:58
View VTK PolyData
#!/usr/bin/env python
"""Render VTK Polydata and view or save PNG or save WebGL.
When an output PNG or WebGL file is not specified, an interactive windows is
displayed. To get the camera position from the interactive window, press the
"c" key.
"""
import argparse
@thewtex
thewtex / view-tubes.py
Created August 9, 2013 04:04
View tubes with TubeTK/PyQtGraph
#!/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
#!/usr/bin/env python
"""
simple example script for running and testing notebooks.
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
import os,sys,time
@thewtex
thewtex / CMakeLists.txt
Created September 24, 2013 21:50
Test JsonCpp project.
cmake_minimum_required( VERSION 2.8 )
project( uses-jsoncpp )
find_package( jsoncpp REQUIRED )
include_directories( ${jsoncpp_INCLUDE_DIRS} )
add_executable( uses-jsoncpp main.cpp )
target_link_libraries( uses-jsoncpp ${jsoncpp_LIBRARIES} )
@thewtex
thewtex / vtk-unstructuredgrid-to-stl.py
Created January 5, 2014 01:28
Convert a .vtk UnstructuredGrid file to .stl file.
#!/usr/bin/env python
"""Convert UnstructuredGrid in .vtk files to STL files."""
import sys
import vtk
if len(sys.argv) < 2 or sys.argv[1] == '-h' or sys.argv[1] == '--help':
print('Usage: vtk-unstructuredgrid-to-stl.py <input.vtk> <output.stl>')
sys.exit(1)
@thewtex
thewtex / AffineTtransformParameterOrder.cxx
Created January 30, 2014 16:15
Affine Transform Parameter Order
#include "itkAffineTransform.h"
#include "itkTransformFileWriter.h"
int main( int argc, char * argv[] )
{
if( argc < 2 )
{
std::cerr << "Usage: "
<< argv[0]
<< " outputTransform"
cmake \
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_EXAMPLES:BOOL=OFF \
-DITKGroup_Core:BOOL=OFF \
-DModule_ITKCommon:BOOL=ON \
-DCMAKE_SIZEOF_UNSIGNED_SHORT=2   \
-DCMAKE_TOOLCHAIN_FILE=/home/ibanez/src/emscripten/cmake/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles"  ~/src/ITK