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
// creates a stack, duplicating the source image | |
// after an idea by Mathieu Fallet | |
x=getNumber("no of Slices", 10); | |
run("Select All"); | |
run("Copy"); | |
for(i=1;i<x;i++){ | |
run("Add Slice"); | |
run("Paste"); | |
} |
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("Blobs (25K)"); | |
run("Smooth"); | |
run("Mean...", "radius=2"); | |
setAutoThreshold("Intermodes"); | |
run("Analyze Particles...", "exclude clear add"); |
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
resetThreshold(); | |
run("Remove Overlay"); | |
n = roiManager("count"); | |
Dialog.create("Choix"); | |
Dialog.addChoice("paramètre", newArray("Area","Mean","Circ."),""); | |
Dialog.show(); | |
param = Dialog.getChoice(); | |
m=moy(param); | |
for (i=0;i<n;i++) { | |
roiManager("select",i); |
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
dir = File.directory; | |
data = dir+ File.nameWithoutExtension+".txt"; | |
if (File.exists(data)) { | |
data=File.openAsString(data); | |
setMetadata("Info", data); | |
List.setList(data); | |
size=split(List.get('$CM_FULL_SIZE')); | |
makeRectangle(0,0,size[0],size[1]); | |
run("Crop"); | |
pixels = List.get('$$SM_MICRON_BAR'); |
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
// fixes the display range of lsm files with pixelDepth>8 | |
macro "fix display range [f]" { | |
Stack.getDimensions(width, height, channels, slices, frames); | |
for (c=0;c<channels;c++){ | |
Stack.setChannel(c+1); | |
getStatistics(area, mean, min, max, std, histogram); | |
setMinAndMax(min, max); | |
} | |
} |
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
// 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
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); |
OlderNewer