Skip to content

Instantly share code, notes, and snippets.

View thouis's full-sized avatar

Thouis (Ray) Jones thouis

  • Broad Institute
  • Cambridge, MA, USA
View GitHub Profile
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@thouis
thouis / Hackathon.md
Last active August 29, 2015 13:57
Issues to bring up at Hackathon

Some things we'd like to see discussed at the hackathon:

  1. Modularity
  • Can the alignment pipeline be separated into independent steps with a well-defined format for the intermediate results? This would help in parallelization on the cluster, as well as easy experimentation with new approaches. It also would help separate control parameters into groups based on which step they control.
  1. 1D and 2D constraints
  • Currently, filtering correspondences removes all of those except corner-like matches. Is it possible to classify correspondences into smooth/linear/corner? 1D correspondences can be used to constrain the solution to a subspace, and might result in improved results and solution times in some cases.
  1. Cracks
  • Some of our data has (long, linear) cracks from the microtoming process. We can detect them automatically. It would be useful to be able to eliminate cracked regions from correspondence finding, and to be able to do some mesh surgery on the structural mesh during the solving pr
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thouis
thouis / filterbank.py
Created July 23, 2012 11:39 — forked from amueller/filterbank.py
Filterbank responses for low level vision
##########################################################################
# Maximum Response filterbank from
# http://www.robots.ox.ac.uk/~vgg/research/texclass/filters.html
# based on several edge and bar filters.
# Adapted to Python by Andreas Mueller amueller@ais.uni-bonn.de
# Share and enjoy
#
import numpy as np
import matplotlib.pyplot as plt
@thouis
thouis / script.py
Created January 19, 2012 15:28 — forked from bennihepp/script.py
Example script for CellProfiler RunScript module
import cpscript
from scipy import ndimage
labels = cpscript.Cells.segmented
background_labels = np.array(labels == 0, dtype=int)
dt_labels = ndimage.distance_transform_edt(background_labels)
imVSVG_pixels = cpscript.imVSVG.pixel_data
imVSVG_dt_pixels = imVSVG_pixels * dt_labels
@thouis
thouis / build-cpdev-v1.sh
Created November 6, 2011 19:04
CellProfiler Mac Development Builder script
#!/bin/sh
# TODO: check for virtualenv
# TODO: verify python is universal 32+64 bit
virtualenv -p /Library/Frameworks/Python.framework/Versions/2.7/bin/python --no-site-packages ${1}/cpdev
. ${1}/cpdev/bin/activate
pip install -U pip # to get git+https
@thouis
thouis / gist:1056421
Created June 30, 2011 15:04
initial rewrite of recalculate_groups
def recalculate_group(self, workspace, indexes):
'''Recalculate all measurements once post_group has run
workspace - the workspace being operated on
indexes - the indexes of the group's image sets' measurements
'''
m = workspace.measurements
object_name = self.object_name.value
assert isinstance(m, cpmeas.Measurements)
parent_object_numbers = m.get_all_measurements(
@thouis
thouis / flypy.el
Created June 30, 2011 12:53
my flypy.el
;;; from http://richardriley.net/projects/emacs/dotprogramming#sec-1.5
(when (load "flymake" t)
(defun flymake-pycheckers-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "/Users/tjones/elisp/pycheckers.sh" (list local-file)))))
@thouis
thouis / median_by_gene.py
Created June 11, 2011 20:53
median of medians sorted by gene, sorted by gene
import xlrd
import sys
import numpy as np
book = xlrd.open_workbook(sys.argv[1])
sheet = book.sheet_by_name('Normalization 1')
headers = [c.value for c in sheet.row(0)]
# find columns
colidx = dict([(name, headers.index(name)) for name in ['Gene', 'rep1', 'rep2', 'rep3']])
@thouis
thouis / measurements.py
Created June 7, 2011 21:47
start rewrite of measurements.py
"""Measurements.py - storage for image and object measurements
CellProfiler is distributed under the GNU General Public License.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2011 Broad Institute
All rights reserved.
Please see the AUTHORS file for credits.