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
/** | |
* 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 |
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
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], |
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 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 |
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 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`. |
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
# -*- 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 |
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
[contact] | |
email.account = transfile@gmail.com | |
email.host = mail.gmail.com | |
email.login = true |
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
# -*- 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" |
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 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 |
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 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 |
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 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'], |
OlderNewer