Skip to content

Instantly share code, notes, and snippets.

View GenevieveBuckley's full-sized avatar

Genevieve Buckley GenevieveBuckley

  • Monash University
  • Melbourne
View GitHub Profile
@monkstone
monkstone / QuickHull3D.java
Created June 21, 2011 19:31
Updated quickhull 3D
/**
* Copyright John E. Lloyd, 2004. All rights reserved. Permission to use,
* copy, modify and redistribute is granted, provided that this copyright
* notice is retained and the author is given credit whenever appropriate.
*
* This software is distributed "as is", without any warranty, including
* any implied warranty of merchantability or fitness for a particular
* use. The author assumes no responsibility for, and shall not be liable
* for, any special, indirect, or consequential damages, or any damages
* whatsoever, arising out of or in connection with the use of this
@charlesreid1
charlesreid1 / imread
Created November 9, 2017 21:15
Results from using different imread() functions
In [1]: from skimage.io import imread as skimage_imread
In [2]: from matplotlib.pyplot import imread as plt_imread
In [3]: from scipy.ndimage import imread as scipy_imread
In [4]: skimage_imread('bulk_water_000.png')
Out[4]:
array([[[146, 125, 54, 255],
[146, 125, 54, 255],
import pandas as pd
import os
import re
from sklearn.decomposition import PCA
from microscopium import io
from microscopium.preprocess import montage_stream
from microscopium.preprocess import correct_multiimage_illumination
from microscopium.preprocess import find_background_illumination
@robintw
robintw / bokeh_utils.py
Last active January 21, 2019 07:07
Bokeh Utils
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
def scatter_with_hover(df, x, y,
fig=None, cols=None, name=None, marker='x',
fig_width=500, fig_height=500, **kwargs):
"""
Plots an interactive scatter plot of `x` vs `y` using bokeh, with automatic
tooltips showing columns from `df`.
@ChrisBeaumont
ChrisBeaumont / brain.py
Created May 29, 2014 15:32
MRI Glue demo
# -*- coding: utf-8 -*-
"""
This script loads a Brain Tumor DICOM dataset into Glue.
The data comes from http://www.osirix-viewer.com/datasets/DATA/BRAINIX.zip
To run this locally, download and unzip that file, and run this script
from the directory that you dowloaded the ZIP file to
This requires the dicom library, which you can install via
@trans
trans / better.ini
Created August 6, 2012 20:48
INI files with sub-hierarchies
[contact]
email.account = transfile@gmail.com
email.host = mail.gmail.com
email.login = true
@KristoforMaynard
KristoforMaynard / imayavi.py
Last active June 6, 2019 08:45
Mayavi tools for ipython notebooks
# -*- coding: utf-8 -*-
"""Make Mayavi plots inline to ipython notebooks
Imports mayavi and mlab and adds them to interpreter namespace. Loading
this extension also sets up inline matplotlib (aka `%matpotlib inline`)
and sets offscreen rendering on linux.
Note:
Offscreen rendering on OS X doesn't seem to work, but on linux,
inline plots don't work without offscreen rendering. "Don't work"
@yunwilliamyu
yunwilliamyu / process_wrapper.py
Created January 4, 2017 19:14
Redirect Python stderr/stdout for a block
import sys
import contextlib
@contextlib.contextmanager
def output_wrapper():
save_stdout = sys.stdout
save_stderr = sys.stderr
sys.stdout = open('stdout.log', 'a')
sys.stderr = open('stderr.log', 'a')
yield
sys.stdout = save_stdout
@martindurant
martindurant / bokeh_tricks.py
Created May 23, 2018 16:31
interactive image
import bokeh
from bokeh.io import output_notebook, push_notebook
output_notebook()
##
import numpy as np
from ipywidgets import interact, widgets
from bokeh.plotting import figure, show
@dela3499
dela3499 / bokeh_tooltips.py
Created May 18, 2017 21:17
Bokeh scatterplot with tooltips in the Jupyter notebook
from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.models import HoverTool
from bokeh.io import output_notebook
output_notebook()
source = ColumnDataSource(
data=dict(
x=[1, 2, 3, 4, 5],
y=[2, 5, 8, 2, 7],
desc=['A', 'b', 'C', 'd', 'E'],