Posted by
CARL Philippe (LBP) on
URL: http://imagej.273.s1.nabble.com/Translate-command-in-ROI-Manager-tp5022823p5022827.html
Hi Fabrice,
How are you doing?
Happy New Year 2020!!!
For beginners your copied macro may be quite problematic to use since it will only work in the case a picture is open together with the roiManager containing at least an element.
On top of this it will throw and error since the parameters dx and dy used within the two Dialog.addNumber lines are undefined.
Thus prior to your copied code, you need to add something like:
dx = dy = 0;
Have a nice week-end.
My best regards,
Philippe
----- Mail original -----
De: "Fabrice Senger" <
[hidden email]>
À: "imagej"
Envoyé: Vendredi 10 Janvier 2020 16:32:24
Objet: Re: Translate command in ROI Manager
I have found that macro wich might be useful :
Dialog.create("Move Selections");
Dialog.addNumber("X Displacement:", dx);
Dialog.addNumber("Y Displacement:", dy);
Dialog.show();
dx = Dialog.getNumber();
dy = Dialog.getNumber();;
n = roiManager("count");
if (n==0)
exit("The ROI Manager is empty");
for (i=0; i<n; i++) {
roiManager('select', i);
getSelectionBounds(x, y, w, h);
setSelectionLocation(x+dx, y+dy);
roiManager('Add');
}
All the best,
Fabrice.
Le jeu. 9 janv. 2020 à 19:56, Cammer, Michael <
[hidden email]>
a écrit :
> We have a question regarding the Translate command within the ROI Manager.
>
> Our goal is to select a single or group of ROIs in the manager and move
> them. Is this what the translate command does?
>
> We have tried selecting one ROI and translating it, but 1.) nothing
> happens and 2.) we don't see a macro command generated in the Recorder
> window.
>
> Is this a bug with the command or are we using it incorrectly? Any help
> appreciated.
>
> We are using ImageJ 1.52t23, Java 1.8, Win10
>
> Thank you!
>
> Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
> NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY
> 10016
> Office: 646-501-0567 Cell: 914-309-3270
[hidden email]
> <mailto:
[hidden email]>
>
http://nyulmc.org/micros http://microscopynotes.com/> Acknowledgement in your publications and presentations of work performed
> in the Microscopy Core plays a vital role in securing support and the
> funding necessary to maintain and operate this valuable research resource.
> For publications that were made possible by work performed in the core,
> please use the acknowledgement statement "We thank the NYU Langone
> Microscopy Core for experimental and technical support" and include
> required grant numbers as listed here
>
http://microscopynotes.com/ilabnyu/acknowledgements2017.pdf> Please also consider staff for co-authorship if they played a key role in
> the study.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html