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
import sys | |
import Tkinter as tk | |
from tkFileDialog import askopenfilename, asksaveasfilename | |
class App(tk.Tk): | |
""" | |
A simple demo of the basic Tkinter widgets. This can be used as a skeleton for a simple GUI applications. |
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
import wx | |
APP_EXIT = 1 | |
FILE_SAVE = 2 | |
FILE_OPEN = 3 | |
SHOW_HELP = 4 | |
SHOW_ABOUT = 5 | |
class Example(wx.Frame): |
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
import time | |
import itertools | |
import platform | |
import subprocess | |
from functools import partial | |
from scipy import optimize, ndimage | |
from scipy.integrate import simps | |
from scipy.interpolate import splev, splprep | |
import numpy as np | |
from PIL import Image |
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
def volshow(vol, sl_dim=0, mask=None, **kwargs): | |
# FIXME: doesn't work when sl_dim=-1 | |
""" | |
This function displays slices into a 3-dimensional numpy array. Optionally, the user can | |
pass a binary mask of the same size to be displayed on top of the volume. This is intended | |
to be a 3D equivalent of pyplot.imshow. | |
Usage: | |
the up and down arrows flip through the slices | |
'd' toggles the slice dimension (eg, axial->sagittal->coronal) |
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
from collections import OrderedDict | |
import numpy as np | |
import matplotlib | |
matplotlib.use('TkAgg') | |
import warnings; | |
with warnings.catch_warnings(): | |
warnings.simplefilter("ignore"); | |
import matplotlib.pyplot as plt | |
from skimage.transform import rescale |
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
def hist_match(im, ref_im): | |
if np.squeeze(im).ndim == 2: | |
im = np.expand_dims(im, axis=2) | |
ref_im = np.expand_dims(ref_im, axis=2) | |
out_im = np.empty_like(im) | |
for chan_num in range(im.shape[2]): | |
chan, ref_chan = im[...,chan_num], ref_im[...,chan_num] | |
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
#!/bin/bash | |
LOG_FOLDER=~/MineAnnotationsBackup/logs | |
BACKUP_FOLDER=~/MineAnnotationsBackup | |
# script from here: http://www.howtogeek.com/175008/the-non-beginners-guide-to-syncing-data-with-rsync/ | |
#copy old time.txt to time2.txt | |
yes | cp $LOG_FOLDER/time.txt $LOG_FOLDER/time2.txt |
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
source /opt/ros/indigo/setup.bash | |
source /home/brian/robotics_code/ROS/workspace/devel/setup.bash | |
export ROS_IP=`ifconfig|grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"|tail -n 3|head -n 1` | |
export ROS_MASTER_URI=http://$ROS_IP:11311/ | |
echo "ROS is now ready to run, with ROS_MASTER set to $ROS_MASTER_URI." |
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
import matplotlib.pyplot as plt | |
import inspect | |
from ipywidgets import * | |
from IPython.display import display | |
%matplotlib inline | |
plt.rcParams['image.cmap'] = 'gray' | |
plt.rcParams['image.interpolation'] = 'none' | |
# http://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html |
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
import numpy as np | |
from collections import OrderedDict | |
# im_fn = 'images/copperopolis_quarry_google_17_cropped.tif' | |
# im = plt.imread(im_fn) | |
def tile_image(im, tile_size, overlap=0): | |
""" | |
Partition a large image into equally-sized overlapping tiles. |
OlderNewer