Re: Selection brush tool usage

Posted by Herbie on
URL: http://imagej.273.s1.nabble.com/Selection-brush-tool-usage-tp5017711p5017712.html

Matt,

the answer to your first question is easy and again can be found here:
<https://imagej.nih.gov/ij/developer/macro/functions.html>
or more specifically here:
<https://imagej.nih.gov/ij/developer/macro/functions.html#selectionType>

"selectionType()
Returns the selection type, where 0=rectangle, 1=oval, 2=polygon,
3=freehand, 4=traced, 5=straight line, 6=segmented line, 7=freehand
line, 8=angle, 9=composite and 10=point. Returns -1 if there is no
selection. For an example, see the ShowImageInfo macro. "

With regard to the previous and continuing question I really should like
to know why you are so concentrated on overlays and the paintbrush tool.
Why not, in the first place use selections?

Best

Herbie

:::::::::::::::::::::::::::::::::::::::::::::
Am 07.12.16 um 16:22 schrieb PEARSON Matthew:

> Hi all,
>
> I'm trying to figure out the ways to query if a selection is say an
> oval, rectangle or composite in a macro?  I know i can do
> ROIManager>More>List to find out what Type each selection is but is
> the only way to extract this info through renaming the overlay
> elements table to "Results" then using getResultString on the Type
> column?  If it is a composite i will then split this selection so i
> can process each area separately.
>
> But perhaps there is an alternative for what i want to do.  I want to
> mark several selections on an image and add them to the manager using
> a tool that has a defined initial size but can be expanded freehand
> if necessary by left clicking and moving the mouse hence using the
> selection brush but the issue with it is it can produce composite or
> a single selection depending on if the user holds the shift key or
> not.  So if the user has pressed shift i need to know that the
> selection is a composite and then split into separate selections for
> processing.  If they have not held shift then the selection will be
> just one single marked area but the macro doesn't know which they've
> done unless i extract the overlay elements info.
>
> A paintbrush type tool which allows you to add multiple separate
> selections to the ROI manager would be useful if it doesn't somehow
> exist already?
>
> Thanks for the advice,
>
> Matt
>
>
> -- Matt Pearson Microscopy Facility MRC Human Genetics Unit Institute
> of Genetics and Molecular Medicine (IGMM) University of Edinburgh
> Crewe Road EH4 2XU
>
>
>
>
>
> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
> The 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