Hey all ImageJers,
I'm using ImageJ to split full-color photographs of cell stains and am splitting them into RGB photographs (gives 3 B/W pictures based on the intensity of the various colors). However, I really want to be able to use a specific color (red) and have a macro automatically select this window to threshold it and analyze the particles. When I attempt this, my macro always just selects the topmost window (blue) and analyzes that. Obviously, I end up with erroneous results. Does anyone know how to script a macro in order for it to select a specific window? Or will I have to do it manually? Thanks in advance for any help! Ryan Johnson University of Colorado at Colorado Springs |
Hi,
I had the same problem and solved it by going to Window and selecting the one you want or closing the ones you don't want using the Window pull down menu. Andy KLigerman US EPA Ryan Johnson <[hidden email] DU> To Sent by: ImageJ [hidden email] Interest Group cc <[hidden email] .GOV> Subject Selecting a specific color on RGB spectrum split 10/03/2006 03:13 PM Please respond to ImageJ Interest Group <[hidden email] .GOV> Hey all ImageJers, I'm using ImageJ to split full-color photographs of cell stains and am splitting them into RGB photographs (gives 3 B/W pictures based on the intensity of the various colors). However, I really want to be able to use a specific color (red) and have a macro automatically select this window to threshold it and analyze the particles. When I attempt this, my macro always just selects the topmost window (blue) and analyzes that. Obviously, I end up with erroneous results. Does anyone know how to script a macro in order for it to select a specific window? Or will I have to do it manually? Thanks in advance for any help! Ryan Johnson University of Colorado at Colorado Springs |
In reply to this post by Ryan Johnson-3
I assume you're doing something like this in your macro
---run("RGB Stack"); ---run("Convert Stack to Images"); After that, use ---selectWindow("Red"); to select the window with the red channel. This will work as long as you're working with only one image at a time. If you break several images into color channels, there will be multiple windows named "Red" and you'll have a chance of selecting the wrong one. If that's the case, run this after you break up each image ---selectWindow("Red"); ---someWindowID = getImageID(); Store different IDs in different variables, and use this to pick the one you want. ---selectImage(someWindowID); There's probabaly a better way to do it, but this way works for me. Justin On 10/3/06, Ryan Johnson <[hidden email]> wrote: > Hey all ImageJers, > > I'm using ImageJ to split full-color photographs of cell stains and am > splitting them into RGB photographs (gives 3 B/W pictures based on the > intensity of the various colors). However, I really want to be able to use > a specific color (red) and have a macro automatically select this window to > threshold it and analyze the particles. When I attempt this, my macro > always just selects the topmost window (blue) and analyzes that. Obviously, > I end up with erroneous results. Does anyone know how to script a macro in > order for it to select a specific window? Or will I have to do it manually? > Thanks in advance for any help! > > Ryan Johnson > University of Colorado at Colorado Springs > |
Free forum by Nabble | Edit this page |