Created
March 14, 2021 18:32
-
-
Save mutterer/7901a5444920e4da568adeafb58338f1 to your computer and use it in GitHub Desktop.
An ImageJ tool macro to move several ROIs
This file contains hidden or 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
macro "MultiRoiMove Tool - C00cT0f16M" { | |
if (RoiManager.selected<2) exit(); | |
indexes=split(call("ij.plugin.frame.RoiManager.getIndexesAsString")); | |
roiManager("Combine"); | |
getCursorLoc(x, y, z, modifiers); | |
Roi.getBounds(x0, y0, width, height); | |
while(modifiers&16>0) { | |
getCursorLoc(x1, y1, z, modifiers); | |
Roi.move(x0+x1-x, y0+y1-y); | |
} | |
roiManager("select", indexes); | |
roiManager("translate", x1-x, y1-y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment