Login  Register

Re: editing an overlay

Posted by Jerome Mutterer-3 on Feb 02, 2015; 4:19pm
URL: http://imagej.273.s1.nabble.com/editing-an-overlay-tp5011378p5011407.html

Dear Kenneth,

I understand you're trying to edit a mask over a grayscale image.
You could try the following: convert your mask to a selection object,
give this ROI a transparent red fill color and you're done.
You can restore this selection on the grayscale image and edit it using the
built in selection brush.
Sincerely,
Jerome

run("AuPbSn 40 (56K)");
id=getImageID;
run("Duplicate...", " ");
setOption("BlackBackground", false);
run("Make Binary");
run("Create Selection");
roiManager("Add");
selectWindow("AuPbSn40.jpg");
roiManager("Select", 0);
roiManager("Set Fill Color", "#33ff0000");
setTool("brush");





On 1 February 2015 at 23:11, Kenneth Sloan <[hidden email]> wrote:
>
> Help, please - I'm making  very slow progress on this and could really
use some assistance.
>
> If looks like I want to use an Image Overlay and the Overlay Brush Tool -
but I'm having difficulty with the details.
>
> So far...I have managed to combine the binary mask with the gray scale
image - and have discovered that applying the "Red" color map to the binary
mask gives me roughly the effect I want.
>
> But, I can't figure out how to EDIT the mask in the composite image.
Perhaps this is not possible (without writing the drawing tool myself?)
>
> Would I be better off performing this task in PhotoShop?
>
> Again - my goal is to combine a grayscale original with a (RED) binary
mask overlay, and then edit (use a brush tool to paint or erase) just the
mask.  If I get that far, I'd eventually like to be able to extract the
edited mask (probably easy to do by flattening the composite and then
finding pixels with a different value in the R channel - but it must be
easier than that; I simply can't find it in the documentation).
>
> My users are PhotoShop hackers - I'm trying to move them as far as
possible into ImageJ - but right now, I'm stuck.
>
> Even an authoritative statement that "it doesn't exist - write it
yourself" would be helpful.
>
> Do I want to instead consider an RGB stack?  Is it reasonable to, say -
put the original grayscale image in the GREEN channel, the mask in the RED
channel - and then view the composite?  If I do that, can I EDIT the RED
channel while viewing the composite?
>
> Grasping at straws here...
>
> --
> Kenneth Sloan
> [hidden email]
> "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme;
il faut imaginer Sisyphe heureux."
>
>
> > On Jan 29, 2015, at 16:41 , Kenneth Sloan <[hidden email]> wrote:
> >
> > I have a plugin which creates a binary image from a grayscale image,
and then does a few clean-up operations on the binary image.  After that, a
trained observer is given the task of editing the binary image.  In it's
current, crude state, the observer has very little help from the original
data - at best, the observer can see the two images side-by-side.
> >
> > This is no longer acceptable - I would like to display the binary
version as a transparent mask overlaid on top of the original grayscale
image (say, coloring the grayscale in shades of red where the binary mask
is 1).  But, I also want the observer to be able to edit the mask.
> >
> > It's not clear to me precisely how to do this.  I would appreciate
pointers to appropriate places in the API, or sample snippets of (Java,
please) plug-in code that I can use as building blocks.
> >
> > So:
> >  input: 2 images, one grayscale the other a binary mask
> >         (original input is just the grayscale - I already generate the
binary mask)
> >
> >  behavior: display the grayscale image with shades of red where the
mask is 1 and gray otherwise
> >            EDIT the mask (draw and erase - or, draw with either 0 or 1)
> >            an alternate view : color the grayscale GREEN where the mask
is 0 and RED where
> >                                the mask is 1 - allow the observer to
"draw" in GREEN or RED
> >  output: the modified binary mask.
> >
> > Environment: FIJI - latest major, stable release.
> >
> > It may well be that this is trivial with ordinary FIJI controls - if
so, I'm just ignorant of these.
> >
> > It would be acceptable to output the grayscale image (tinted in shades
of RED or GREEN - mutually exclusively) - If this is easier, I will happily
convert that image to a binary mask.  My problem is in editing the mask
information on a display which shows the grayscale and the mask in perfect
overlay registration.
> >
> > Mostly, I'm trying to avoid the pain of writing
yet-another-drawing-program - hoping that I can use a built-in process to
allow the observer to use standard drawing tools to modify the mask.
> >
> > --
> > Kenneth Sloan
> > [hidden email]
> > "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme;
il faut imaginer Sisyphe heureux."
> >
> >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html




--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
T 0367155339
www.ibmp.cnrs.fr

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