Posted by
PEARSON Matthew on
URL: http://imagej.273.s1.nabble.com/Selection-brush-tool-usage-tp5017711p5017789.html
Hi Michael,
That's great! Works like a dream.
Thanks again,
Matt
--
Matt Pearson
Microscopy Facility
MRC Human Genetics Unit
Institute of Genetics and Molecular Medicine (IGMM)
University of Edinburgh
Crewe Road
EH4 2XU
On 15 Dec 2016, at 13:33, Michael Schmid <
[hidden email]<mailto:
[hidden email]>>
wrote:
Hi Matt,
you can have your macro create a file with a short macro and install that macro from the file:
str = 'macro "Add Overlay [o]" {\n'
str = str + 'run("Add Selection...");\n';
str = str + 'run("Select None");\n}';
path=getDirectory("imagej")+"/macros/addOverlay.ijm";
File.saveString(str, path);
run("Install...", "install=["+path+"]");
Note that I am using single quotes to create the string; the ImageJ macro language accepts both single and double quotes. Using single quotes, there is no problem of having to escape the double quotes that occur in the String.
Michael
________________________________________________________________
On 2016-12-15 13:19, PEARSON Matthew wrote:
Hi Michael,
Sorry for the delay in replying to you, i have the imagej posts
filtering into a separate folder in my email client but sometimes
they go straight to my main inbox instead and i don't seem to be able
to keep track of both locations at the same time! I had one from
Wayne hiding there too and have apologised to him.
You raised some good points here so glad i found your email in the
end! The key aspect for me is this: So you can create a selection,
press 'b' and then deselect all (shift-A). I wasn't expecting to have
to press shift-A to allow the selection brush to paint a new
selection elsewhere. What i have been doing is adding a selection
but ensuring that it is not just a single click but i click and hold
and paint an area larger than the width of the selection brush
itself, then when i press b the selection brush isn't in repair mode
and i can paint a new selection elsewhere. But i like your
suggestion of making a shortcut key to add the overlay and select
none. Is there anyway to make this work without having to install
this mini macro or adding to the startup macros, i.e. initialise it
within my analysis macro somehow? The only reason i ask is because
anyone using my macro would possibly do it on their own computer so
they would have to make sure they had the shortcut macro setup before
running.
I'm guessing the macro would look something like below: macro "Add
Overlay [o]" { run("Add Selection…"); run("Select None"); }
Thanks,
Matt
-- Matt Pearson Microscopy Facility MRC Human Genetics Unit Institute
of Genetics and Molecular Medicine (IGMM) University of Edinburgh
Crewe Road EH4 2XU
On 8 Dec 2016, at 18:10, Michael Schmid
<
[hidden email]<mailto:
[hidden email]><mailto:
[hidden email]>> wrote:
Hi Matt,
according to my understanding, the selection brush is mainly meant as
a 'repair selection' brush. If there is no selection, it creates
one. If there is a selection: If you start brushing outside the
current selection, it is in 'remove from selection' mode, and you can
use it to remove a few pixels from the margin of the selection
(because the selection was a bit too large). If you start inside the
current selection, it adds to the selection, e.g. if you want to
extend the borders a bit. You can force the behavior with the SHIFT
(add) and ALT (subtract) modifier keys. I am not aware of a
possibility to have the selection brush delete the old selection and
create a new one.
So you can create a selection, press 'b' and then deselect all
(shift-A). Then add a new brush point. For convenience, you could
have the 'add to overlay' and 'deselect' in a macro with a shortcut.
Alternatively, use the Overlay brush.
Michael
_______________________________________________________________________________
On 2016-12-08 10:15, PEARSON Matthew wrote: Hi all, I think i have
cracked my problem with the selection brush and in fact realise i'd
asked a similar question a couple of years ago but then didn't pursue
the idea. I can now get the selection brush to create selections
around the image but the work flow for doing this seems a little
strange. These are the steps that work for me: 1.) Left click on the
image to create a circular selection with the selection brush 2.)
Left click again anywhere on the image but not on the circular
selection 3.) Press the b key (adds the first selection to the
overlay i believe) 4.) I can now left click and add another circular
selection on the image 5.) Repeat above for all selections then 5.)
Image>Overlay>To ROI Manager (adds all the overlays as separate
roi's) I'm not sure why i have to do step 2.) before i press b. Its
not a big deal but would be good if you could just left click on the
next area, perhaps there is good reason for this. Thanks, Matt
-- ImageJ mailing list:
http://imagej.nih.gov/ij/list.html-- ImageJ mailing list:
http://imagej.nih.gov/ij/list.htmlThe University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
-- ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html