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
// This macro converts a 26x26 8-bit image to a tool macro icon | |
// string. Ideally, the image should have no more than 16 colors. | |
// Includes seven examples that, with the exception of the | |
// "Lena Tool", were created by converting website favicons | |
// (http://en.wikipedia.org/wiki/Favicon). | |
// v1.0 : 4 April 2006 | |
// v1.1 : 17 January 2021 : works with 26x26px images. | |
macro "Convert 26x26 Image to Tool Icon..." { | |
requires("1.35r"); |
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
// this example uses the Toolbar.setIcon(toolName,icon) method | |
// This example action tool uses the Toolbar.setIcon() method, | |
// added in v1.53h, to dynamically update its icon. | |
// uses extended hex icon coordinates | |
var icons = newArray( "Ca30N44V00nn","C037N44F00nn"); | |
var colors = newArray( "Cf00","C0f0","C00f","Cf0f"); | |
var xs = newArray(4); | |
var ys = newArray(4); | |
var xbs = newArray(4); |
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
// Providing an image and polyline, macro illustrates | |
// (creates a stack with animation) | |
// "Straighten" ROI function of ImageJ | |
// 2021.01.15 Eugene Katrukha / katpyxa at gmail dot com | |
if (nImages<1) | |
{ | |
exit("This macro needs an input image. Open something"); | |
} | |
if(selectionType()!=6) |
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
id=getImageID; | |
Stack.getDimensions(width, height, channels, slices, frames); | |
for(i=1; i<=slices; i++) { | |
selectImage(id); | |
Stack.setSlice(i) | |
run("Duplicate...", "duplicate slices=&i-&i"); | |
run("Set Label...", "label=Hue"); | |
run("RGB Color",""); | |
run("Set Label...", "label="); | |
} |
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
// This macro creates an animation by interpolating ROI coordinates | |
// and drawing each step and fading and blurring the image. | |
// The active ROI is hidden if batch mode is true. | |
run("Fresh Start"); | |
newImage("2021", "8-bit black", 256, 256, 1); | |
run("Fire"); | |
setBatchMode(true); // hide ROIs on active image, requires 1.53h21 |
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
// colours of 2021 | |
call("ij.gui.ImageWindow.centerNextImage"); | |
newImage("2020 LUTs demo", "8-bit black", 512, 256, 1); | |
r=10; | |
setForegroundColor(255,255,255); | |
luts = getList("LUTs"); | |
lut=0; | |
makeLine(78,90,97,61,134,63,149,91,76,174,66,157,139,180,170,160); | |
run("Fit Spline"); |
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
// suggested by @noodlyscientist Liat Adler | |
// this script nicely organizes windows for screen recording | |
// save this script in the plugins folder | |
IJ.run("Fresh Start",""); | |
IJ.getInstance().setLocation(0,0); | |
IJ.run("Macro",""); | |
b=GUI.getScreenBounds() | |
x=b.width/2; y=b.height/2; | |
f=WindowManager.getFrame("Macro.ijm") |
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("Blobs (25K)"); | |
selectWindow('blobs.gif');setLocation(0, 100); | |
setThreshold(192, 255); | |
makeRectangle(56, 132, 68, 61); | |
run("To Selection"); | |
doWand(80, 175); | |
run("Set Measurements...", "area redirect=None decimal=3"); | |
run("Measure"); | |
print(Table.get('Area',Table.size-1),'Measure, no options'); | |
run("Set Measurements...", "area limit redirect=None decimal=3"); |
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
// cutepeaks exports ab1 files as tab delimited csv | |
// this macro replaces tabs with commas | |
// reopens peaks file | |
// and builds a nucleotide plot | |
// v 1.0 : 20201109 | |
// 1.1 : 20201207 handles csv files with different columns ordering | |
s=File.openAsString(""); | |
name = File.name; | |
s=s.replace('\t',','); |
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
// this is what it takes to make a red/geen image | |
// colorblind friendly | |
run("Make Composite"); | |
setSlice(1); | |
run("Magenta"); | |
setSlice(2); | |
run("Green"); | |
// optional: remove blue channel completely | |
// (some jpgs have residual blue channel which decrease contrast) |