Skip to content

Instantly share code, notes, and snippets.

View benjaminirving's full-sized avatar

Benjamin Irving benjaminirving

View GitHub Profile
" My vimrc
" A work in progress
syntax enable " enable syntax
set background=dark " dark background
set mouse=a " enable mouse interaction
" Set tab to be four spaces
set tabstop=4
@benjaminirving
benjaminirving / osirix_roi_to_numpy_vol.py
Last active December 19, 2020 13:11
A function to import an Osirix roi into python as a binary numpy array
"""
Import an Osirix xml roi as a binary numpy array
Requires libraries:
nibabel
numpy
scikit-image
xml
Benjamin Irving
@benjaminirving
benjaminirving / Example.py
Created December 10, 2015 16:59 — forked from LegoStormtroopr/Example.py
'FingerTabs' - Horizontal Text, Horizontal Tabs in PyQt This [trivial fingertab gist](https://gist.github.com/LegoStormtroopr/5075267) is released as Public Domain, but boy would it beswell if you could credit me, or tweet me [@LegoStormtoopr](http://www.twitter.com/legostormtroopr) to say thanks!
from PyQt4 import QtGui, QtCore
from FingerTabs import FingerTabWidget
import sys
app = QtGui.QApplication(sys.argv)
tabs = QtGui.QTabWidget()
tabs.setTabBar(FingerTabBarWidget(width=100,height=25))
digits = ['Thumb','Pointer','Rude','Ring','Pinky']
for i,d in enumerate(digits):
"""
A simple example pyside app that demonstrates dragging and dropping
of files onto a GUI.
- This app allows dragging and dropping of an image file
that this then displayed in the GUI
- Alternatively an image can be loaded using the button
- This app includes a workaround for using pyside for dragging and dropping
@benjaminirving
benjaminirving / README.md
Last active June 18, 2023 09:38
Python to c++ interface example files. Used to demonstrate how to pass multidimensional numpy arrays to c++ vectors and back (see http://www.birving.com/blog/2014/05/13/passing-numpy-arrays-between-python-and/)

Python <-> c++ interface example for multidimensional arrays