Skip to content

Instantly share code, notes, and snippets.

@philipbjorge
philipbjorge / JACoP_Auto_.py
Created May 23, 2012 02:34
JACoP Fiji Colocalization Automation
from ij import IJ
from ij import WindowManager as wm
from ij import ImagePlus
import time
def open_file_dialogue(window_title="", path_restriction=None):
"""
Opens a file dialogue and returns the path to the chosen file.
Returns None on an invalid file or dialogue cancellation (prints to log).
window_title will appear in the file dialogue window title.
@philipbjorge
philipbjorge / coloc.md
Created May 25, 2012 17:36
Colocalization Methods

#Pearson's Coefficient Range between -1 and 1. -1 is a negative correlation and +1 is a positive correlation.

Scatter plots and PCs point to colocalization especially where it is complete (Fig. 5A and B); however, they rarely discriminate differences between partial colocalization or exclusion, especially if images contain noise.

Overlap Coefficient

Mander's removes mean fluorescent intensity from Pearson's, which gives a new value between 0 and 1.0, where 1.0 is 100% colocalization.

@philipbjorge
philipbjorge / notepad_cleaner.au3
Created June 2, 2012 23:39
Notepad Instance Cleanup
; Stupid simple autoit script for cleaning up "orphaned" notepad instances
; I end up with dozens of notepad instances after a day of coding and it's a pain to close all these manually
; as I do want to keep some of them.
; Public Domain
; Philip Bjorge
; June 2, 2012
Local $windows=WinList()
For $i = 1 To $windows[0][0]
If StringInStr($windows[$i][0], "Notepad", 0) Then
@philipbjorge
philipbjorge / zoomified_lab_procedures.md
Created June 6, 2012 19:15
Zoomified Lab Procedures

Zoomify Procedures

Imaging Computer

  1. Navigate to the "C:\Images\Moths" directory.
  2. Click and run the export_as_tiff.bat file. This will take a minute, but it will move any new tiffs to the "C:\Images\Moths\Final Moths Tiff" directory.
  3. Open the program ZoomifyConvertor.exe in "C:\Images\Moths"
  4. Navigate to the "C:\Images\Moths\Final Moths Tiff" and sort these by date, noticing which images are new.
  5. Highlight the new images to be zoomified and drag them onto your already opened Zoomify window. This will create a set of folders (named after the tiffs) in the "C:\Images\Moths\Final Moths Tiff" directory.
  6. When Zoomify is finished, select all these new zoomified folders and copy them onto a flash drive.
  7. Then move these folders from "C:\Images\Moths\Final Moths Tiff" into "C:\Images\Moths\Final Moths Zoomified" (We want to keep things organized on the filesystem).
#!/usr/bin/env python
import sys
import math
from random import shuffle
import numpy as np
loop_iters = 0
"""
NOTE: I'm pretty sure we're using the word bogo without knowing what it means...
@philipbjorge
philipbjorge / main.rb
Last active December 11, 2015 08:09
oops-rb example
[1, 2, 3].collec {|i| i*2}
# => [2, 4, 6]
"hello world".capitalzie
# => Hello world
@philipbjorge
philipbjorge / main.rb
Created January 19, 2013 08:46
smackit-rb
class Counter
attr_accessor :data
def initialize(initial)
@data = initial
end
end
expected = [0, 1, 2, 0, 5]
actual = []
@philipbjorge
philipbjorge / main.py
Created January 19, 2013 23:05 — forked from MorganBorman/main.py
VAOs in PyOpenGL
import OpenGL.GL as GL
import OpenGL.GL.shaders
import ctypes
import pygame
import numpy
vertex_shader = """
#version 330
in vec4 position;
@philipbjorge
philipbjorge / goatee.py
Created January 26, 2013 04:03
goatee - Minimal sickbeard replacement using nzbx.co for data Requires the following python modules: guessit fileDownloader.py
__author__ = 'philipbjorge'
import sys, urllib, json, argparse, urllib2
from os import remove
from os.path import abspath, isdir, join, exists, getsize
from guessit import guess_episode_info
from collections import defaultdict
from sys import stderr
import fileDownloader
DEBUG = True
@philipbjorge
philipbjorge / condo_internet.js
Last active December 14, 2015 06:39
Condo Internet tsv - run on http://www.condointernet.net/buildings/ to generate output for batchgeo.com View the map at http://batchgeo.com/map/5669d2610fc85db932a4519b92a294a6
console.log("apartment\taddress");
$.each($(".buildings li"), function(i, v) {
var apartmentName = $(v).children("h2").text();
var apartmentAddress = $(v).find("strong").text();
console.log(apartmentName + "\t" + apartmentAddress);
});