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 |
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 |
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 |
Thanks - I’ll try that.
In the meantime, I stumbled on a method using Stacks that I was just about to report on: a) make a stack (Image->Stacks->Images to Stack) b) make Composite (Image->Stacks->Make Composite) c) use the Brush Tool to draw/erase the mask d) when done, separate (Image->Colors->Split Channels e) lose the color map we picked up along the way (Image->LUT->Grays) f) save as PNG (I need PNG to feed into my non-ImageJ pipeline) My users seem to like this. One question on this procedure: when I make the Composite stack, I see IDENTICAL images no matter what slice is selected. Is this the expected behavior? Should there be any discernible difference between the slices when viewing as a “Composite”? Are there controls to this view that would allow me to play with the relative intensities, or an alpha value to control transparency? I’d like the gray-scale image to be as prominent as possible, with only a tiny bit of perceptual space taken up by the mask. As is, the mask is a bit TOO prominent, at the expense of gray-scale resolution in the original image. Would the “selection object” approach allow for better control? I have someone integrating this into our existing Java plug-in (which currently creates the initial binary mask). We had been editing the mask in isolation (with the original “off to the side”) - but decided that this was not optimal. For one thing, the images are 1536x1536 and are already scaled down for display; “side-by-side” wasn’t really working. When that version is complete, I’ll experiment with the “selection object” technique. One learns a large system like ImageJ one technique at a time. Thank you very much for the help. -- Kenneth Sloan [hidden email] "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme; il faut imaginer Sisyphe heureux." > On Feb 2, 2015, at 10:19 , Jerome Mutterer <[hidden email]> wrote: > > 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 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Kenneth,
composite images will always look the same, regardless which slice is selected. But you can adjust each channel/slice by using 'Image > Adjust > Brightness/Contrast...' ([Ctrl]+[Shift]+[C]). If you reduce the brightness of the mask it's like increasing the transparency of the selected slide. Best regards Michael Am 03.02.2015 um 20:13 schrieb Kenneth Sloan: > Thanks - I’ll try that. > > In the meantime, I stumbled on a method using Stacks that I was just about to report on: > > a) make a stack (Image->Stacks->Images to Stack) > b) make Composite (Image->Stacks->Make Composite) > c) use the Brush Tool to draw/erase the mask > d) when done, separate (Image->Colors->Split Channels > e) lose the color map we picked up along the way (Image->LUT->Grays) > f) save as PNG (I need PNG to feed into my non-ImageJ pipeline) > > My users seem to like this. > > One question on this procedure: when I make the Composite stack, I see IDENTICAL images no matter what slice is selected. > Is this the expected behavior? Should there be any discernible difference between the slices when viewing as a “Composite”? > Are there controls to this view that would allow me to play with the relative intensities, or an alpha value to control transparency? I’d like the gray-scale image to be as prominent as possible, with only a tiny bit of perceptual space taken up by the mask. As is, the mask is a bit TOO prominent, at the expense of gray-scale resolution in the original image. Would the “selection object” approach allow for better control? > > I have someone integrating this into our existing Java plug-in (which currently creates the initial binary mask). We had been editing the mask in isolation (with the original “off to the side”) - but decided that this was not optimal. For one thing, the images are 1536x1536 and are already scaled down for display; “side-by-side” wasn’t really working. When that version is complete, I’ll experiment with the “selection object” technique. One learns a large system like ImageJ one technique at a time. > > Thank you very much for the help. > > -- > Kenneth Sloan > [hidden email] > "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme; il faut imaginer Sisyphe heureux." > > >> On Feb 2, 2015, at 10:19 , Jerome Mutterer <[hidden email]> wrote: >> >> 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 > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |