Skip to content

Instantly share code, notes, and snippets.

@craigmccauley
Created September 11, 2019 18:19
Show Gist options
  • Save craigmccauley/6ea54875b975e71cef0717e65c18d60c to your computer and use it in GitHub Desktop.
Save craigmccauley/6ea54875b975e71cef0717e65c18d60c to your computer and use it in GitHub Desktop.
ImageJ 40 by 40 box
//make rectange 40 by 40 in center of image
//get dimensions of image
var imageWidth, imageHeight, channels, slices, frames;
getDimensions(imageWidth, imageHeight, channels, slices, frames);
//set rectange vars
var rectangleWidth = 40;
var rectangleHeight = 40;
var rectangleX = (imageWidth - rectangleWidth)/ 2;
var rectangleY = (imageHeight - rectangleHeight)/2;
makeRectangle(rectangleX, rectangleY, rectangleWidth, rectangleHeight);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment