Skip to content

Instantly share code, notes, and snippets.

# Example of Fiji script for calculating a radial profile.
from ij import IJ
from ij.process import ImageStatistics as IS
from ij.gui import Roi, OvalRoi
import csv
options = IS.MEAN | IS.MEDIAN | IS.MIN_MAX | IS.AREA
# Example of Fiji script for taking statistics of every stack in a stack file.
# Statistics of 3 ROIs are taken for every stack.
from ij import IJ
from ij.process import ImageStatistics as IS
# import os
options = IS.MEAN | IS.MEDIAN | IS.MIN_MAX | IS.AREA
path cx cy r num_bin
/Volumes/Macintosh HD/GrovesLabData/20131106/03 FC3/04 cells_10/img_000000014_488_000.tif 243 243 120 20
/Volumes/Macintosh HD/GrovesLabData/20131106/03 FC3/04 cells_10/img_000000014_488_001.tif 300 231 100 20
/Volumes/Macintosh HD/GrovesLabData/20131106/03 FC3/04 cells_10/img_000000014_488_002.tif 398 645 160 20
@hirokai
hirokai / titration_plot.py
Created February 25, 2014 05:59
Matplotlib subplots example
import csv
from pylab import *
names = ['40nm_1_0_b',
'40nm_1_1_b',
'40nm_1_5_b',
'40nm_1_10_b',
'40nm_1_20_b',
'40nm_1_50_b',
'40nm_1_100_b',
@hirokai
hirokai / test-input.csv
Created February 25, 2014 22:41
Test input of CSV
Number Area BX BY Width Height Major Minor Angle Major/minor
68 6927 1533 1077 101 103 94.31 93.52 13.41 1.008447391
82 8806 1088 1372 108 115 106.62 105.16 56.63 1.013883606
10 6557 1352 46 95 95 92.14 90.6 133.78 1.016997792
48 8825 1496 722 111 116 107.11 104.9 113.78 1.021067684
65 8461 1173 1046 109 107 104.97 102.63 62.97 1.022800351
24 7265 1430 237 105 97 97.47 94.9 10.55 1.027081138
30 8758 1214 325 111 115 107.23 103.99 147.46 1.031156842
42 9653 1485 565 114 115 112.72 109.03 128.94 1.033843896
52 8054 1414 798 106 110 102.97 99.59 74.08 1.033939151
@hirokai
hirokai / delaunay.py
Created March 10, 2014 04:55
Nanodot spacing analysis by Delaunay triangulation
def getVal(table, i):
x = table.getValue('X', i)
y = table.getValue('Y', i)
return (x, y)
# Stub
def delaunay(coords):
return None
@hirokai
hirokai / nanodots.py
Created March 15, 2014 20:55
Nanodot spacing analysis
import httplib, urllib, marshal
from math import floor
def getVal(table, i):
x = table.getValue('X', i)
y = table.getValue('Y', i)
return [x, y]
def draw_triangles(imp, triangles):
ip = imp.getProcessor()
@hirokai
hirokai / delaunay-server.hs
Created March 15, 2014 22:26
Delaunay triangulation as a web service
{-# LANGUAGE OverloadedStrings #-}
-- Used packages: delaunay, scotty, aeson
import Graphics.Triangulation.Delaunay
import Data.Vector.V2
import Data.Aeson
import Data.ByteString (ByteString)
import Data.Text.Lazy.Encoding (encodeUtf8)
import Data.Text.Lazy (Text)