Login  Register

Re: painting an overlay

Posted by Kenneth Sloan-2 on May 02, 2014; 4:53pm
URL: http://imagej.273.s1.nabble.com/painting-an-overlay-tp5007497p5007553.html

RTFM lead me to the conclusion that this is not a “stock operation” in ImageJ.  Unless I’m missing something, a current Overlay can only consist of stroke graphics elements.  I need a RasterOverlay.
It doesn’t look all that hard for me to implement, but it will mean implementing “yet another paintbrush tool”.
Before I start - has anyone done this?  Is anyone working on it?

And, of course, is this a reasonable feature to request in future versions?

I’m taking “No Answer” to the previous query as an indication that this isn’t “stock ImageJ”.

Again, I think the core operations are:

a) convert binary image to “RasterOverlay” and back again
b) use standard paintbrush tools to paint on the overlay

I’d also like to specify the opacity of the overlay - that may already exist for the current overlay
feature, but I haven’t found it yet, and I’ve stopped looking because it looks like I’ll be
writing my own version.

Before I start - anyone with a “wish list” of features?  At first glance I’ll want draw/erase, set color, set opacity, perhaps turn “overlay” on/off, and convert “overlay” to/from 8-bit Binary image.  Anything else? Are there standard conventions on what to do if, say, the input Binary image has a size that is different from the gray-scale image being overlaid?  Could this be done with a heterogeneous Stack (containing two images, gray-scale and binary, with some wort of blending rule)?

All clues gratefully rented.  I’ll probably start on this…Wednesday, 7 May.

In case anyone cares, what I’m doing is building a tool to allow a trained observer to edit a binary mask.  The binary mask produced by automatic means is very good - but not *quite* good enough.  So, there will be a single plugin to
produce the initial mask and then allow the observer to edit it.  Final output is simply the edited mask, written as a .png file.  Programs further down the pipeline (probably *not* ImageJ programs) will start from the original image and the binary mask and do …whatever…

The point is that it is useful to see the gray values under the mask, especially when making decisions about ERASING parts of the mask.  Right now, we’re doing this “side-by-side”, which works fairly well, just not as nicely as I’d like.

…on the road to ARVO…if any ImageJ hackers will be there…let’s do lunch.

--
Kenneth Sloan
[hidden email]


On Apr 29, 2014, at 18:15 , Kenneth Sloan <[hidden email]> wrote:

> I am looking for help on a feature that I think exists, but I have never used.
> The answer is probably RTFM, but I would appreciate a few hints.
>
> Here’s what I want to do:
>
> a) I have a plugin that accepts any type of image, makes a copy, converts to 8-bit
>   and then uses auto local thresholding to create a binary mask
> b) I would like to give a trained observer the option to PAINT in the thresholded image
>   to correct errors made by the auto local threshold
> c) That works now - except that the user has little guidance correlating the gray-scale
>   image with the binary mask
> d) So…I would like to OVERLAY the binary mask on the grayscale image and allow the observer
>   to paint the OVERLAY
> e) and then…at the end…I need to convert the overlay to an independent binary mask image.
>
> The parts I don’t know how to do are:
>
> * convert binary mask to an overlay on the original gray-scale image
>  (it’s ok, of course, to do this on a COPY of the original, since the original
>   may not be 8-bit in the first place)
> * draw/erase the overlay (are there paintbrush tools available to work on an overlay?)
> * convert the final overlay to a binary image.
>
> Pointers to the documentation, or example code that does something even vaguely similar, would be
> most appreciated.
>
> --
> Kenneth Sloan
> [hidden email]
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html