Hi,
I am trying to create a very simple macro that starts by splitting an image into its 3 or 4 channels (colors), then I want the program to always select the image which name starts with C1; or even better the green channel. However, when I record, the macro saves the specific name of the image that I used to create my macro and I don't know how to replace this for "any image starting with C1" for example, or even better, the green-channel window. Thanks a lot for your help. This is my macro // A click on the empty rectangle will have the same // effect as File>Save As>Jpeg... macro "Neurite Tracer Action Tool - C000R11ee" { run("Split Channels"); selectWindow("C1-Sh488 Ph568 PSD95 647 63x_18.lsm"); call("ij3d.ImageJ3DViewer.setCoordinateSystem", "false"); run("Simple Neurite Tracer", " choice=[Create New 3D Viewer] resampling=1"); |
Hi,
Modify your macro with the following lines. Hopefully, one of the selectWindow lines below will work for you. George macro "Neurite Tracer Action Tool - C000R11ee" { imageTitle=getTitle();//returns a string with the image title run("Split Channels"); selectWindow("C1-"+imageTitle); //concatenate "C1-" or whichever channel you want with the string returned above or maybe use selectWindow(imageTitle+" (green)"); //this concatenates the title of the image with the channel designation in the new image On Fri, Jan 17, 2014 at 12:57 PM, mia2005 <[hidden email]> wrote: > Hi, > I am trying to create a very simple macro that starts by splitting an image > into its 3 or 4 channels (colors), > then I want the program to always select the image which name starts with > C1; or even better the green channel. However, when I record, the macro > saves the specific name of the image that I used to create my macro and I > don't know how to replace this for "any image starting with C1" for > example, > or even better, the green-channel window. > > Thanks a lot for your help. > > This is my macro > > // A click on the empty rectangle will have the same > // effect as File>Save As>Jpeg... > > macro "Neurite Tracer Action Tool - C000R11ee" { > > run("Split Channels"); > selectWindow("C1-Sh488 Ph568 PSD95 647 63x_18.lsm"); > call("ij3d.ImageJ3DViewer.setCoordinateSystem", "false"); > run("Simple Neurite Tracer", " choice=[Create New 3D Viewer] > resampling=1"); > > > > > -- > View this message in context: > http://imagej.1557.x6.nabble.com/Select-window-name-X-tp5006167.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hello,
If you want to introduce even more automation to your workflow, you could also consider using a for loop based on the name of your images - it seems like you might have some set that goes from "Sh488 Ph568 PSD95 647 63x_1.lsm" to "Sh488 Ph568 PSD95 647 63x_2.lsm", etc. If that's the case, you could do: for(variable=1; variable<=100; variable++){ open("Sh488 Ph568 PSD95 647 63x_"+variable+".lsm); run("Split Channels"); etc } Best, Will On Fri, Jan 17, 2014 at 2:29 PM, George Patterson <[hidden email]>wrote: > Hi, > Modify your macro with the following lines. > Hopefully, one of the selectWindow lines below will work for you. > George > > macro "Neurite Tracer Action Tool - C000R11ee" { > imageTitle=getTitle();//returns a string with the image title > run("Split Channels"); > > selectWindow("C1-"+imageTitle); > //concatenate "C1-" or whichever channel you want with the string returned > above > > or maybe use > > selectWindow(imageTitle+" (green)"); > //this concatenates the title of the image with the channel designation in > the new image > > > > On Fri, Jan 17, 2014 at 12:57 PM, mia2005 <[hidden email]> > wrote: > > > Hi, > > I am trying to create a very simple macro that starts by splitting an > image > > into its 3 or 4 channels (colors), > > then I want the program to always select the image which name starts with > > C1; or even better the green channel. However, when I record, the macro > > saves the specific name of the image that I used to create my macro and I > > don't know how to replace this for "any image starting with C1" for > > example, > > or even better, the green-channel window. > > > > Thanks a lot for your help. > > > > This is my macro > > > > // A click on the empty rectangle will have the same > > // effect as File>Save As>Jpeg... > > > > macro "Neurite Tracer Action Tool - C000R11ee" { > > > > run("Split Channels"); > > selectWindow("C1-Sh488 Ph568 PSD95 647 63x_18.lsm"); > > call("ij3d.ImageJ3DViewer.setCoordinateSystem", "false"); > > run("Simple Neurite Tracer", " choice=[Create New 3D Viewer] > > resampling=1"); > > > > > > > > > > -- > > View this message in context: > > http://imagej.1557.x6.nabble.com/Select-window-name-X-tp5006167.html > > Sent from the ImageJ mailing list archive at Nabble.com. > > > > -- > > 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 |