using Images
This file contains hidden or 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
# microjson - Minimal JSON parser/emitter for use in standalone scripts. | |
# No warranty. Free to use/modify as you see fit. Trades speed for compactness. | |
# Send ideas, bugs, simplifications to http://github.com/phensley | |
# Copyright (c) 2010 Patrick Hensley <[email protected]> | |
# std | |
import math | |
import StringIO | |
import types |
This file contains hidden or 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
# auto_detect.py | |
from ij import IJ | |
from ij.plugin import ImageCalculator | |
IJ.run("Close All") | |
IJ.run("Stack From List...", "open=/Users/hiroyuki/Desktop/images.txt") | |
IJ.run("Gaussian Blur...", "sigma=5 stack") | |
imp = IJ.getImage() | |
imp.setTitle("all") |
This file contains hidden or 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
# hiroutil.py | |
from ij import ImageStack, IJ | |
def load_stack(w,h,paths): | |
stk = ImageStack(w,h) | |
for path in paths: | |
ip = IJ.openImage(path).getProcessor() | |
stk.addSlice(ip) |
This file contains hidden or 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
import Data.List | |
import Data.Monoid | |
import Text.Printf | |
data Sgn = Posi | Neg deriving Eq | |
data FP = FP Int Int Sgn | FPInt Int | FPDouble Double | |
add :: Double -> FP -> FP | |
add v (FPDouble a) = FPDouble (a + v) |
This file contains hidden or 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
-- Generate NC files for PRODIA M45 | |
module Main where | |
import Prelude | |
import Math hiding (log) | |
import Data.Array | |
import Data.Monoid | |
-- import Data.List (foldl) |
This file contains hidden or 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 ij import IJ | |
from ij.measure import ResultsTable | |
from ij.plugin.filter import ParticleAnalyzer | |
import time | |
def analyze(path): | |
IJ.open(path) | |
IJ.run("16-bit"); | |
IJ.run("Auto Threshold", "method=Minimum"); |
This file contains hidden or 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 script runs on Fiji. | |
# Just drag and drop this file into a Fiji window. | |
from ij import IJ, ImageStack, ImagePlus | |
from ij.process import ImageProcessor | |
from ij.plugin import ImageCalculator, ZProjector | |
from ij.plugin.filter import GaussianBlur, Analyzer, ParticleAnalyzer | |
from ij.measure import Measurements | |
import sys |
This file contains hidden or 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 script runs on Fiji. | |
# Just drag and drop this file into a Fiji window. | |
# You can also use headless mode | |
# > /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --headless \ | |
# > find_cells-headless.fiji.py /path/to/movie.avi | |
from ij import IJ, ImageStack, ImagePlus | |
from ij.process import ImageProcessor, ImageConverter | |
from ij.plugin import ImageCalculator, AVI_Reader, ZProjector, HyperStackConverter | |
from ij.plugin.filter import GaussianBlur, Analyzer, ParticleAnalyzer |
This file contains hidden or 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
# Calculate trajectories using data from find_cells-headless.fiji.py | |
import csv | |
import sys | |
def norm_sq(a, b): | |
return (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 | |