Automatic Generation of ROIs Based on Binary Mask

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic Generation of ROIs Based on Binary Mask

MikeChelen
Hello,
We are using an algorithm to segment an image by creation of a binary mask.
What we would like to do is have a way that ImageJ can load this mask, and
make a set of ROI's based on it. While selecting individual white areas with
the wand tool and adding them as ROI's works, we would like to do this
automatically. Can anyone suggest a good way to do this? It seems pretty
straightforward but I haven't been able to figure out a way to do it without
requiring some user input/selection. If there are any plugins that could do
this, or suggestions on how to make a macro that would, any suggestions
would be appreciated.
Thanks,
Michael Chelen
Reply | Threaded
Open this post in threaded view
|

Re: Automatic Generation of ROIs Based on Binary Mask

Michael Elbaum
could you "Analyze Particles" on the mask and then apply the ROIs to
your images?
Michael



>>> [hidden email] 08/31/05 4:37 PM >>>
Hello,
We are using an algorithm to segment an image by creation of a binary
mask.
What we would like to do is have a way that ImageJ can load this mask,
and
make a set of ROI's based on it. While selecting individual white areas
with
the wand tool and adding them as ROI's works, we would like to do this
automatically. Can anyone suggest a good way to do this? It seems pretty

straightforward but I haven't been able to figure out a way to do it
without
requiring some user input/selection. If there are any plugins that could
do
this, or suggestions on how to make a macro that would, any suggestions
would be appreciated.
Thanks,
Michael Chelen
Reply | Threaded
Open this post in threaded view
|

Re: Automatic Generation of ROIs Based on Binary Mask

MikeChelen
Hello,
Does the analyze particles command create ROIs? It will accurately pick up
the segmentation, but I don't see how to save ROIs from its analysis.
Thanks,
Michael

 On 8/31/05, Michael Elbaum <[hidden email]> wrote:

>
> could you "Analyze Particles" on the mask and then apply the ROIs to
> your images?
> Michael
>
>
>
> >>> [hidden email] 08/31/05 4:37 PM >>>
> Hello,
> We are using an algorithm to segment an image by creation of a binary
> mask.
> What we would like to do is have a way that ImageJ can load this mask,
> and
> make a set of ROI's based on it. While selecting individual white areas
> with
> the wand tool and adding them as ROI's works, we would like to do this
> automatically. Can anyone suggest a good way to do this? It seems pretty
>
> straightforward but I haven't been able to figure out a way to do it
> without
> requiring some user input/selection. If there are any plugins that could
> do
> this, or suggestions on how to make a macro that would, any suggestions
> would be appreciated.
> Thanks,
> Michael Chelen
>
Reply | Threaded
Open this post in threaded view
|

Re: Automatic Generation of ROIs Based on Binary Mask

Kurt De Vos
In reply to this post by Michael Elbaum
if you have the x,y position of the particles you could use the wand tool

//snip
Wand w = new Wand(ip);
 w.autoOutline(X, Y, minThres, 255);
 if (w.npoints>0) { // we have an roi from the wand...
       Roi roi = new PolygonRoi(w.xpoints, w.ypoints, w.npoints,
Roi.TRACED_ROI);
       img.setRoi(roi);
}
//snip

kurt

Michael Elbaum wrote:

>could you "Analyze Particles" on the mask and then apply the ROIs to
>your images?
>Michael
>
>
>
>  
>
>>>>[hidden email] 08/31/05 4:37 PM >>>
>>>>        
>>>>
>Hello,
>We are using an algorithm to segment an image by creation of a binary
>mask.
>What we would like to do is have a way that ImageJ can load this mask,
>and
>make a set of ROI's based on it. While selecting individual white areas
>with
>the wand tool and adding them as ROI's works, we would like to do this
>automatically. Can anyone suggest a good way to do this? It seems pretty
>
>straightforward but I haven't been able to figure out a way to do it
>without
>requiring some user input/selection. If there are any plugins that could
>do
>this, or suggestions on how to make a macro that would, any suggestions
>would be appreciated.
>Thanks,
>Michael Chelen
>  
>

--
*--*--*--*--*--*--*--*--*--*--*
University of Sheffield
Academic Neurology Unit
Division of Genomic Medicine
E Floor, Medical School
Beech Hill Road
Sheffield
S10 2RX
United Kingdom

Tel: ++44 (0) 114 271 2473
Fax: ++44 (0) 114 226 1201
Email: [hidden email]
*--*--*--*--*--*--*--*--*--*--*
Reply | Threaded
Open this post in threaded view
|

Re: Automatic Generation of ROIs Based on Binary Mask

MikeChelen
In reply to this post by Michael Elbaum
Well it turns out there's a macro that does exactly what I want,
"RoiManagerAddParticles". I would have used the analyze particle tool, in
conjunction with the wand tool as was also suggested, but for me this seems
to work perfectly. Thanks everyone for the suggestions!
-Michael

 On 8/31/05, Michael Elbaum <[hidden email]> wrote:

>
> could you "Analyze Particles" on the mask and then apply the ROIs to
> your images?
> Michael
>
>
>
> >>> [hidden email] 08/31/05 4:37 PM >>>
> Hello,
> We are using an algorithm to segment an image by creation of a binary
> mask.
> What we would like to do is have a way that ImageJ can load this mask,
> and
> make a set of ROI's based on it. While selecting individual white areas
> with
> the wand tool and adding them as ROI's works, we would like to do this
> automatically. Can anyone suggest a good way to do this? It seems pretty
>
> straightforward but I haven't been able to figure out a way to do it
> without
> requiring some user input/selection. If there are any plugins that could
> do
> this, or suggestions on how to make a macro that would, any suggestions
> would be appreciated.
> Thanks,
> Michael Chelen
>
Reply | Threaded
Open this post in threaded view
|

zoom with scroll bars

Jon Harman
Hi,

Does there exist an imageJ plugin that gives a zoom with scrollbars for
panning?  On some machines I have problems with the panning
functionality of the current zoom, plus it is a pain to use.  Is there a
problem with AWT scrollbar functionality?  Maybe just some buttons would
work.

Jon
Reply | Threaded
Open this post in threaded view
|

Re: zoom with scroll bars

Wayne Rasband
> Does there exist an imageJ plugin that gives a zoom with
> scrollbars for panning?  On some machines I have problems
> with the panning functionality of the current zoom, plus it
> is a pain to use.  Is there a problem with AWT scrollbar
> functionality?  Maybe just some buttons would work.

You can pan a zoomed image by holding down the space bar and dragging
with the mouse.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: zoom with scroll bars

Jon Harman
When visiting a friend I installed ImageJ on his computer and laptop.  
For some reason the space bar panning only worked sporatically.  I don't
have access anymore to his computers so can't reproduce the problem, but
was frustrated at the time.  The little hand wouldn't consistently
appear when I pressed space.  The images were big, from an 8MP digital
camera and the computers were slow.   When really zoomed in there was no
way to tell where in the image you were.  Scroll bars show that to you.

Jon



 Wayne Rasband wrote:

>> Does there exist an imageJ plugin that gives a zoom with
>> scrollbars for panning?  On some machines I have problems
>> with the panning functionality of the current zoom, plus it
>> is a pain to use.  Is there a problem with AWT scrollbar
>> functionality?  Maybe just some buttons would work.
>
>
> You can pan a zoomed image by holding down the space bar and dragging
> with the mouse.
>
> -wayne
>
Reply | Threaded
Open this post in threaded view
|

Re: zoom with scroll bars

Adrian Daerr
In reply to this post by Wayne Rasband
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2005-09-01, Wayne Rasband wrote:
> You can pan a zoomed image by holding down the space bar and dragging
> with the mouse.

Nice feature, just discoverd it. However there seems to be a small bug
when panning while defining a ROI (e.g. rectangular). Here is what I see
with version 1.38r:
- - zoom into an image sufficiently to see only a fraction of it (and the
"zoom locator" appears in the top left corner).
- - start defining a rectangular ROI
- - press space-bar and move the mouse: sometimes the portion of the image
shown in the window jumps here already (so that the lower-right corner
of the rectangle ROI doesn't coincide with the mouse cursor any more).
- - in any case, if you pan, release the space bar, change the ROI and
press the space bar again, the window will jump back more or less to the
vicinity of the upper left corner of the ROI.

In particular, it seems impossible to define a ROI that extends more
than twice the zoomed portion of the image away from the starting point
(i.e. when you are defining a ROI like rectangle, circle or line, you
cannot pan more than one screenfull away from the starting point). The
problem doesn't appear when the mouse-button can be released before
panning (e.g. polyline selections).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUZv9UKl/wQSyHWgRAhjFAJ9PgvWYjb/osHNuTvUd95VLx7d7tACfRIgc
T0HA+XnTDTlqfjzQStfROnw=
=IZHW
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: zoom with scroll bars

Michael Schmid
On 21 May 2007, at 15:17, Adrian Daerr wrote:

> On 2005-09-01, Wayne Rasband wrote:
>> You can pan a zoomed image by holding down the space bar and dragging
>> with the mouse.
>
> Nice feature, just discoverd it. However there seems to be a small bug
> when panning while defining a ROI (e.g. rectangular). (...)

Hi Adrian,

as I understand it, panning is not meant to work *while* defining a roi.
The idea is to draw the roi within the visible area, get your fingers  
off
the mouse button, press space and pan until the roi is close to the  
border,
then extend the roi.

Michael
Reply | Threaded
Open this post in threaded view
|

Re: zoom with scroll bars

Adrian Daerr
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>> there seems to be a small bug when panning while defining a ROI
>
> as I understand it, panning is not meant to work *while* defining a roi.

Hello Michael,
thanks for taking the time to reply, but I am not sure I understand your
 answer.  Why should panning be "not meant to work" while defining a ROI
? Surely there is no intrinsic reason ? What you describe later on is a
valid work-around of course, but the way it is "meant" to be ? If you
claim it's not a bug, are you saying it's a feature ?

I am almost certain this can be corrected in a few minutes by someone
familiar with the code (at some point a pair of mouse coordinates or the
origin of the visible area is not updated between the objects involved).
I will put this on my TODO list, but it's not very high so it will take
time. Unfortunately I find it hard to describe *exactly* what is
happening, I was hoping somebody on the list would grasp what goes wrong.

greetings from Paris,
Adrian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUubVUKl/wQSyHWgRAqg+AJ4yklnnltXljfvv8qGWArjNDbisMwCfUAAT
kjF4ooInz0YHWI3ucSMnC6s=
=1lVz
-----END PGP SIGNATURE-----