Skip to content

Instantly share code, notes, and snippets.

@mutterer
Last active May 5, 2019 20:41
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 mutterer/7ecd19ff60c4db3b1c32cd2568986dcd to your computer and use it in GitHub Desktop.
Save mutterer/7ecd19ff60c4db3b1c32cd2568986dcd to your computer and use it in GitHub Desktop.
An ImageJ macro for movie annotation, that overlays customisable reticles at each multipoint point, one per slice
Overlay.remove;
n = roiManager('count');
for (i=0; i<n; i++) {
roiManager('select', i);
getSelectionCoordinates(x,y);
addCross(9,12,1,'green');
}
Overlay.show;
run ("Select None");
exit();
// id: inner diameter
// od: outer diameter
// w: line width
// col: color
function addCross(id,od,w,col) {
addTick(0,0,id,od,w,col);
addTick(0,0,-1*id,-1*od,w,col);
addTick(id,od,0,0,w,col);
addTick(-1*id,-1*od,0,0,w,col);
}
function addTick(x0,x1,y0,y1,w,col) {
makeLine(x[0]+x0,y[0]+y0,x[0]+x1,y[0]+y1);
run("Add Selection...", "stroke=&col width=&w");
Overlay.setPosition(i+1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment