Skip to content

Instantly share code, notes, and snippets.

@miura
miura / 3DprocessorLocalMax.js
Created January 23, 2012 13:15
Example of getting local maxima
importClass(Packages.ij3d.image3d.IntImage3D);
imp=IJ.getImage();
ima=new IntImage3D(imp.getStack());
r=3;
ima2=ima.createLocalMaximaImage(r,r,r, true);
plus=new ImagePlus("localmaxima",ima2.getStack());
plus.show();
@miura
miura / java3d_environmentChecker.js
Created January 23, 2012 13:30
Check the Java3D environment
importClass(Packages.javax.media.j3d.VirtualUniverse);
vu = new VirtualUniverse();
if (vu == null)
System.out.println("failed getting VirtualUniverse");
vuMap = vu.getProperties();
System.out.println("Java3D version: " + vuMap.get("j3d.version"));
System.out.println("Java3D vender: " + vuMap.get("j3d.vender"));
System.out.println("Java3D remderer: " + vuMap.get("j3d.renderer"))
@miura
miura / gist:1687913
Created January 27, 2012 09:17
batch conversion with ffmpeg
#!/bin/sh
for f in *.flv;
do
echo "Processing $f"
ffmpeg -i "$f" -target ntsc-dvd "${f%.flv}.mpg"
done
@miura
miura / shiftX.ijm
Created September 7, 2012 10:13
kymograph drift corrector
// Shifts x position of signals in kymograph
// in respect to the drifts of egg edge position.
// Kota Miura + Masa Mori
//
// duplicate image (for getting the edge shift)
// gaussian blurr (sigma = 1)
//threshould
// registration in x direction
orgID = getImageID();
@miura
miura / tuboReg_macro.ijm
Created September 11, 2012 22:45
Code fragments for registering two images
//20120911
// Kota Miura
// Code fragments for registering two images
// & printing out shift in positions.
// refer to
// http://bigwww.epfl.ch/thevenaz/turboreg/turboRegMacro.txt
// for more examples.
//using opened image opened and refering their title.
@miura
miura / TurboRegMacro.ijm
Created September 13, 2012 14:31
Using TurboReg from ImageJ macro, to output shifts.
var npos = 0; // this variable is better be global.
macro "CCS_APP" {
ipos = 1; // imaged position currently processed and "number of the file"
// npos = 0; // number of total imaged positions
ch = 0; // channel, standardmäßig auf 0!
frame = 0;
slice = 0;
noofcells = 4; // needs to be loaded from segmenting algorithm.
@miura
miura / TurboRegMacro.ijm
Created September 17, 2012 11:45 — forked from schiklen/TurboRegMacro.ijm
Using TurboReg from ImageJ macro, to output shifts.
var npos = 0; // this variable is better be global.
var directapply = 0; // "boolean" user input direct application of driftcorrect
var crop = 0; // "boolean" user input crop to ROI
var splitch = 0; // "boolean" user input splitting of channels
var targetstack = 1 // ImageID of the stack that is to be processed
var dir;
var cropxmax = 0;
var cropymax = 0;
var minout = 0;
var maxout = 0;
@miura
miura / Marimekko.R
Created October 10, 2012 21:32 — forked from dsparks/Marimekko.R
Simplest marimekko/mosaic plot
# Simplest possible marimekko/mosaic plot
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("vcd", "ggplot2", "RColorBrewer")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
theme_set(theme_gray(base_size = 7))
# All you need to start with is individual count data, and a grouping variable
@miura
miura / gist:3872805
Created October 11, 2012 14:33 — forked from rendicahya/gist:3872597
ImageJ Problem
File file = new File(path);
if (file.exists()) {
ImagePlus image = IJ.openImage(file.getAbsolutePath());
System.out.println(image.getTitle());
ImagePlus[] split = ChannelSplitter.split(image);
if (split != null) {
System.out.println("SPLIT OK");
} else {
@miura
miura / final.ijm
Created October 18, 2012 11:06
EMBO Hight-Throughput Microscopy Course, p11 final.ijm
// This part taken from "for loop macro"
orgName = getTitle();
run("Split Channels");
c1 = "C1-" + orgName;
c2 = "C2-" + orgName;
//newly added
selectWindow(c1);
c1ID = getImageID();
selectWindow(c2);