Skip to content

Instantly share code, notes, and snippets.

@hirokai
hirokai / list_to_column.rb
Created January 10, 2015 00:30
Convert list of numbers to 0/1 column.
# Used in combination with yes/no checker (http://hirokai.github.io/yesnochecker/)
list = [
[0,[90]],
[100,[22,25,38,39,40,43,45,46,52,53,54,55,56,59,62,68,69,70,71,72,73,74,75,76,77,79,80,81,85,86,87,89,90,93,94,95,96,97,98,99,100]],
[200,[1,2,3,4,5,6,7,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,42,44,45,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,67,69,70,71,72,73,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,93,95,96,97,98,100]],
[300,[4,6,10,11,12,13,15,17,18,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,58,59,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]],
[400,[1,3,4,5,6,9,10,11,12,13,15,16,17,18,19,25,26,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]]
]
@hirokai
hirokai / subtract average.ijm
Created January 16, 2015 19:20
Subtracting average of slices
run("Stack From List...", "open=/Users/hiroyuki/Desktop/bf.txt");
run("Z Project...", "projection=[Average Intensity]");
run("Calculator Plus", "i1=bf.txt i2=AVG_bf.txt operation=[Subtract: i2 = (i1-i2) x k1 + k2] k1=1 k2=0 create");
@hirokai
hirokai / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hirokai
hirokai / 20150103 FC1 488 nm image list.txt
Created January 19, 2015 06:14
20150103 FC1 488 nm image list
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_000_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_001_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_002_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_003_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_004_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_005_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fixed on PLL-PEG pattern/02 FC2/01 tirf_4ch_144pos_1/1-Pos_006_000/img_000000000_488multi_000.tif
/Volumes/Hiro Groves Lab/20150103 T cells fi
@hirokai
hirokai / 20150121 FC1 ROIs.txt
Last active August 29, 2015 14:13
20150121 FC1 ROIs
Area_um Mean Stdev Mode Min Max XM_um YM_um BX BY Width Height BX_um BY_um Width_um Height_um Slice Frame name don't use Mean-Mode
1 4128.06 857.12 55.6 854 594 1119 87.64 122.01 215 350 250 250 55.26 89.95 64.25 64.25 2 1-Pos_000_001
2 4128.06 970.18 70.68 957 751 1293 178.73 202.11 567 661 250 250 145.72 169.88 64.25 64.25 2 1-Pos_000_001
3 4128.06 893.37 61.95 894 635 1389 136.22 149.6 404 458 250 250 103.83 117.71 64.25 64.25 3 1-Pos_000_002
4 4128.06 916.1 61.7 904 676 1294 150.72 228.68 459 765 250 250 117.96 196.61 64.25 64.25 6 1-Pos_000_005
5 4128.06 915.16 66.52 892 563 1268 162.86 151.37 507 463 250 250 130.3 118.99 64.25 64.25 7 1-Pos_000_006
6 4128.06 865.06 52.89 852 622 1277 178.91 38.13 571 23 250 250 146.75 5.91 64.25 64.25 7 1-Pos_000_006
7 4128.06 834.14 54.18 841 482 1176 51.71 109.69 76 302 250 250 19.53 77.61 64.25 64.25 7 1-Pos_000_006
8 4128.06 872.76 65.11 865 428 1613 130.63 102.43 383 273 250 250 98.43 70.16 64.25 64.25 8 1-Pos_000_007
9 4128.06 893.05 65.73 892 558
@hirokai
hirokai / 20150121 FC1 568nm images.txt
Created January 23, 2015 01:22
20150121 FC1 568nm images
/Volumes/MacintoshHD/Google Drive/Groves/Scope 7/20150121 T cells fixed on PLL-PEG two color staining of LAT and pLAT/01 FC1 negative control/tirf4ch_144pos_1/1-Pos_000_000/img_000000000_561multi_000.tif
/Volumes/MacintoshHD/Google Drive/Groves/Scope 7/20150121 T cells fixed on PLL-PEG two color staining of LAT and pLAT/01 FC1 negative control/tirf4ch_144pos_1/1-Pos_000_001/img_000000000_561multi_000.tif
/Volumes/MacintoshHD/Google Drive/Groves/Scope 7/20150121 T cells fixed on PLL-PEG two color staining of LAT and pLAT/01 FC1 negative control/tirf4ch_144pos_1/1-Pos_000_002/img_000000000_561multi_000.tif
/Volumes/MacintoshHD/Google Drive/Groves/Scope 7/20150121 T cells fixed on PLL-PEG two color staining of LAT and pLAT/01 FC1 negative control/tirf4ch_144pos_1/1-Pos_000_003/img_000000000_561multi_000.tif
/Volumes/MacintoshHD/Google Drive/Groves/Scope 7/20150121 T cells fixed on PLL-PEG two color staining of LAT and pLAT/01 FC1 negative control/tirf4ch_144pos_1/1-Pos_000_004/img_000000000_561multi_000.tif
/Vol
@hirokai
hirokai / combine_stats.rb
Created January 23, 2015 23:03
Combining stats from ImagePipeline
#!/usr/bin/env ruby
$chs = ["488nm", "561nm", "647nm"]
def readall
res = {}
for ch in $chs
res[ch] = {}
for i in 1..6
file = "./stats/FC#{i}_#{ch}.csv"
@hirokai
hirokai / make_pos.rb
Last active August 29, 2015 14:14
MicroManager grid positions
#!/usr/bin/env ruby
require 'json'
include Math
# User parameters
# a: origin (in um)
# b: the 2nd point to define an axis
# Two axes will be (1) b-a and (2) 90 deg clockwise rotation of b-a.
# len: grid interval
@hirokai
hirokai / mk_list.rb
Last active August 29, 2015 14:15
Make a json of list of images of MicroManager
#!/usr/bin/env ruby
#
require 'rubygems'
require 'json'
require 'find'
require 'csv'
def parent(f)
@hirokai
hirokai / linescan.fiji.py
Last active August 29, 2015 14:15
Line scan
# Fiji Jython macro
# Dependencies
# (1) Microjson: https://github.com/phensley/microjson
# Copy is here: https://gist.github.com/hirokai/2fc4353cf6b28e5d2aac
# (2) hiroutil.py: https://gist.github.com/hirokai/77779cdade6d33d0702b
from ij import IJ
from ij.gui import Line, ProfilePlot
import csv