|
I am trying to create a macro that will automatically scale a selection, split it in three channels and then vertically stack them (see code below)
I have managed to do the first 2 parts (scale selection select new window and split it in 3 channels) and for the second part (vertically stack them) I am using the StackCombiner plugin.
My problem is that when I am trying to combine two channels which I am specifying as ImageTitle+" (green)" or ImageTitle+" (red)" etc etc , I believe that the StackCombiner does not like the quotes and it wont recall the ImageTitle....
Is there anyway to recall a name of an image + an extension without using quotes?
Thanks in advance
P
run("Draw", "slice");
run("Scale...", "x=3 y=3 width=234 height=138 interpolation=Bilinear average create");
imageTitle=getTitle();
selectWindow(imageTitle);
run("Split Channels");
run("Stack Combiner", "stack1=[imageTitle+" (green)"] stack2=[imageTitle+" (red)"]");
run("Stack Combiner", "stack1=[Combined Stacks] stack2=[imageTitle+" (blue)"]");
saveAs("Tiff", "/Users/sapou/Downloads/lazyROI1.tif");
|