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
# update install packages | |
yum update -y | |
# install build tools | |
yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
# install python 2.7 and change default python symlink | |
yum install python27-devel -y | |
rm /usr/bin/python | |
ln -s /usr/bin/python2.7 /usr/bin/python |
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
Dialog.create("Process interleaved ratiometric movie"); | |
Dialog.addString("Experiment name:", "expt"); | |
Dialog.addNumber("Background", 1600) | |
Dialog.show() | |
expt_name = Dialog.getString(); | |
background = Dialog.getNumber(); | |
expt_dir = getDirectory("Choose a save directory"); | |
id = getImageID(); |
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
#!/usr/bin/env python | |
import argparse, os | |
from libtiff import TIFF | |
import moviepy.editor as mpy | |
import numpy as np | |
from skimage.color import gray2rgb | |
if __name__ == '__main__': | |
ap = argparse.ArgumentParser() | |
ap.add_argument('input_stack', help="Path to a tiff stack file") |
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
""" | |
This demonstration assumes you have already installed Pymba and followed the installation instructions there: | |
https://github.com/morefigs/pymba | |
MoviePy is used to save the frames to a video file for later viewing, while the frame's mean intensity is | |
printed in real time. MoviePy can be installed from pip nicely. | |
""" | |
import pymba | |
from moviepy.video.io.ffmpeg_writer import FFMPEG_VideoWriter as VidWriter | |
from skimage.color import gray2rgb |
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 serial import Serial | |
from time import sleep | |
class DG4(object): | |
"""Control a Sutter Lambda DG-4 over serial interface""" | |
SWITCH_TO_SERIAL = 238 # switch the DG4 to serial mode, DG4 hangs until it receives the next serial command | |
FREEZE_DISPLAY = 218 | |
TURN_DISPLAY_ON = 219 | |
OPEN_SHUTTER = 170 | |
ND_ADJ_MARKER = 171 # DATANUM = 171 MARKER BETWEEN 235 OR 236 IN N.D. ADJUST |
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 timeshuffle_bootstrap(dview, statistic, data, axis=-1, n_boot=1000): | |
"""Perform bootstrap resampling to assess the significance of a statistic by reshuffling in time. | |
Args: | |
dview: IPython client (i.e. dview = IPython.parallel.Client()[:]) for parallelization. | |
statistic: Function that takes the dataset and computes some statistic (or array of statistics). | |
data: Data from which the statistic is computed. | |
axis: Axis in the data the shuffle along (usually time). | |
""" | |
T = data.shape[axis] |
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 os.path import join as pjoin | |
from os.path import isdir | |
from os import listdir | |
from argparse import ArgumentParser | |
from neo.io import TdtIO, NeoHdf5IO | |
from progressbar import ProgressBar | |
if __name__ == '__main__': | |
parser = ArgumentParser(description="Convert a Tucker-Davis Technologies (TDT) to Neo's HDF5 format.") |
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
sudo -i | |
apt-get update | |
apt-get upgrade -y | |
apt-get install htop git | |
apt-get install python-dev pkg-config build-essential libfreetype6-dev libpng-dev libatlas-base-dev | |
wget "https://bootstrap.pypa.io/get-pip.py" | python | |
rm "get-pip.py" | |
pip install numpy scipy matplotlib seaborn scikit-image jupyter ipyparallel ipywidgets libtiff s4cmd |
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
*.ipynb filter=stripoutput |
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
#!/usr/bin/env bash | |
FILEPATH=$@ | |
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch $FILEPATH" --prune-empty --tag-name-filter cat -- --all |
OlderNewer