This file contains 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
// Fix funny LUT for LSM or CZI files opened with Bioformats | |
// parses the file metadata to work around a bioformat bug | |
// that assigns wrong channel colors. | |
var r,g,b; | |
title = getTitle(); | |
id=getImageID; | |
Stack.getDimensions(width, height, channels, slices, frames); | |
This file contains 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
run("Fresh Start"); | |
run("Options...", "iterations=1 count=1 black"); | |
run("Boats"); | |
setBatchMode(true); | |
run("Duplicate...","title="+getTitle); | |
makeOval(100,100,300,300); | |
w=getWidth;h=getHeight; | |
roiManager("add"); | |
newImage("temp", "8-bit black", w, h, 1); | |
size = 10; |
This file contains 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
// On windows, permanently delete files: | |
// * of a certain type | |
// * older than a certain year | |
// * that do not have one of a set of keywords | |
type="lsm"; | |
keepFrom = 2014; | |
words= newArray("config","setting"); | |
dir = getDirectory("Choose a Directory "); |
This file contains 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
sourcedir=getDirectory("select source directory with lsm files"); | |
destdir=getDirectory("select or create destination directory"); | |
list = getFileList(sourcedir); | |
Dialog.create("New LSM Batch color converter options"); | |
Dialog.addChoice("Export format ", newArray("Tiff", "Jpeg")); | |
Dialog.addCheckbox("Output merged channels image(s) ", true); | |
Dialog.addCheckbox("Process all time points ", false); | |
Dialog.addCheckbox("Process all slices ", false); | |
Dialog.addCheckbox("Convert to 8-bit ", false); |
This file contains 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
run("RGB Stack"); // convert RGB image in a stack | |
run("32-bit"); // make it 32 bit for computations | |
run("Multiply...", "value=-1 stack"); // invert values for r,g,b | |
setSlice(2); // go to the green channel | |
run("Multiply...", "value=-2 slice"); // -g*-2 = +2g | |
run("Z Project...", "start=1 stop=3 projection=[Sum Slices]"); // sum all channels result= -r + 2g -b | |
setAutoThreshold("Intermodes dark"); // auto thresholding now works |
This file contains 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
// grab the Viridis (option-d) colormap from Berkeley Institute for Data Science GitHub repo | |
// and parse it to an ImageJ LUT | |
// Viridis colormap presented @ SciPy 2015 by Nathaniel Smith and Stéfan van der Walt | |
s=File.openUrlAsString("https://raw.githubusercontent.com/BIDS/colormap/master/option_d.py"); | |
s=substring(s,indexOf(s,"[[")+1,indexOf(s,"]]")+1); | |
s=replace(s,'\n\n','\n'); | |
s=replace(s,' ',''); | |
s=split(s,'\n'); | |
length = s.length; | |
reds = newArray(length); |
This file contains 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
var xp = newArray(); | |
var yp = newArray(); | |
macro "tick marks Tool - C00cT0f16T" { | |
if (roiManager('count')<1) exit("add at least one ROI the the roiManager"); | |
roiManager("Show All"); | |
getCursorLoc(x, y, z, flags); | |
roiManager('select',0); | |
run("Interpolate", "interval=1 adjust"); | |
getSelectionCoordinates(xp, yp); |
This file contains 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
/* | |
* Making a pretty fluorogram | |
* Olivier Burri, BioImaging & Optics Platform, EPFL | |
*/ | |
run("Fluorescent Cells (400K)"); | |
image = getTitle(); | |
run("Split Channels"); |
This file contains 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
// written at the request of S.Mingle. | |
// https://gist.github.com/mutterer/8fc04d0bdcc72a56072c | |
var baselineIndex=0; | |
macro "Help Action Tool - C00cT0f18?" { | |
help = setup(); | |
} | |
macro "Define BaseLine Action Tool - C00cT0f18BTaf18l" { |
This file contains 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
macro "MultiFreehand Tool - C00cT0f18M" { | |
xs = newArray(1); | |
ys = newArray(1); | |
getCursorLoc(x, y, z, flags); | |
xs[0]=x; ys[0]=y; | |
lastx=x;lasty=y; | |
leftclick=16; | |
while (flags&leftclick>0) { | |
getCursorLoc(x, y, z, flags); | |
if ((x!=lastx)||(y!=lasty)) { |