Skip to content

Instantly share code, notes, and snippets.

@jeesay
Created September 12, 2011 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeesay/1211097 to your computer and use it in GitHub Desktop.
Save jeesay/1211097 to your computer and use it in GitHub Desktop.
square_wave.ijm
// Square Wave for ImageJ
// Jean-Christophe Taveau
// http://crazybiocomputing.blogspot.com
f=4; // default frequency
w=256;
h=256;
Dialog.create("Square Wave");
Dialog.addNumber("Frequency",f);
Dialog.show();
f=Dialog.getNumber();
// M A I N
newImage("Square Wave", "32-bit Black", w, h, 1);
run("Macro...", "code=[v=sin((x+1)/w*"+f+"*2*PI) / abs(sin((x+1)/w*"+f+"*2*PI))]");
exit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment