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
newImage("Untitled", "8-bit ramp", 512, 256, 1); | |
setFont("SansSerif", 58, " antialiased"); | |
setColor("yellow"); | |
Overlay.drawString("Hello World!", 91, 250, 30.0); | |
Overlay.show(); |
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
/* | |
* Simple script that takes a selection and computes the curvature radius for the whole perimeter of the shape. | |
* | |
* By Olivier Burri, | |
* BioImaging and Optics Platform, BIOP | |
* Ecole Polytechnique Fédérale de Lausanne (EPFL) | |
* Last update: May 2017 | |
* | |
* | |
*/ |
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
import ij.*; | |
import ij.gui.*; | |
import ij.plugin.*; | |
// requires ImageJ 1.53d8 or later | |
public class My_DialogWithDirChooser implements PlugIn { | |
String dir; | |
public void run(String arg) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
List.setList( getMetadata( "Info" ) ); | |
desc = List.get( "ImageDescription" ); | |
if( desc.indexOf( "AMT" )< 0 ) { | |
print( "Not an AMT image file" ); | |
exit( ); | |
} | |
unit = List.get( "Unit" ); | |
cal = List.get( "XpixCal" ); | |
cal = parseFloat( cal.replace( ',', '.' ) ); | |
setVoxelSize( 1 / cal, 1 / cal, 1, unit ); |
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 cmd = newMenu( "LUT Utils Menu Tool", | |
newArray( "LUT from RGB Points", "LUT from ROI", "Store LUT in Prefs", "Restore LUT from Prefs" ) ); | |
macro "LUT Utils Menu Tool - C037T0b12LT6b10uTbb10T" { | |
cmd = getArgument( ); | |
if ( cmd == "Store LUT in Prefs" ) { | |
getLut( reds, greens, blues ); | |
r = reds [ 0 ]; | |
g = greens [ 0 ]; | |
b = blues [ 0 ]; | |
for ( i = 1; i < reds.length; 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
<?xml version="1.0"?> | |
<!DOCTYPE MODE SYSTEM "xmode.dtd"> | |
<MODE> | |
<PROPS> | |
<PROPERTY NAME="commentStart" VALUE="/*" /> | |
<PROPERTY NAME="commentEnd" VALUE="*/" /> | |
<PROPERTY NAME="lineComment" VALUE="//" /> |
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
// reproduce tape text effect seen here: https://twitter.com/Ulrike_Boehm/status/1274720476548476929 | |
lines = newArray("@ahklemm rocks","and yes, ImageJ macros are", "so satisfying"); | |
tape = newArray("#ffdd5d","8ba4ff","#ffb9d1"); | |
letters = "#ffffff"; | |
shadow = "#444444"; | |
run("Blobs"); | |
run("Remove Overlay"); | |
setFont("American Typewriter", 12, " antialiased"); |
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
// inspired by https://twitter.com/junkiyoshi/status/1273210733375795200 | |
// sketch compares two ImageJ LUTs side by side | |
// LUTs files obtained using ImageJ>Image>Color>Show LUT...>List... | |
int s=5; | |
Table greenfire, fire; | |
void setup() { | |
size(640, 240); | |
greenfire = loadTable("greenfireblue.csv", "header"); | |
fire = loadTable("fire.csv", "header"); |
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 just those 3 lines to reset update preferences | |
call( 'ij.Prefs.set', 'update.freq', 1 ); | |
call( 'ij.Prefs.set', 'update.mode', "stable release" ); | |
call( 'ij.Prefs.set', 'update.last', 0 ); | |
*/ | |
lastUpdate = parseInt( call( 'ij.Prefs.get', 'update.last', 0 ) ); | |
updateFreq = parseInt( call( 'ij.Prefs.get', 'update.freq', 1 ) ); | |
updateMode = call( 'ij.Prefs.get', 'update.mode', "stable release" ); |