ana
ana

Reputation: 79

ImageJ macro for deinterleaving and merging colors

I'm trying to write a macro in Fiji that would deinterleave my original tif file, and then merge the two channels.

name=getTitle();
subname = substring(name, 0,14);
selectWindow(name);
dir = getDirectory("image"); 
fullname2 = name + " #2";
fullname1 = name + " #1";
run("Deinterleave", "how=2 keep");
selectWindow(name + " #2");
run("8-bit");
selectWindow(name + " #1");
run("8-bit");
run("Merge Channels...", "c1=["fullname2"] c2=["fullname1"] create");
saveAs("Tiff", dir + subname + "_composite.tif");

But there seems to be an error in the 12. line with Merge channels.

This is the error that I get.

I don't get why. I also tried writing that line like this:

run("Merge Channels...", "c1=[fullname2] c2=[fullname1] create");

But it also doesn't work. Any ideas on what I'm doing wrong? Thanks a lot!!

Upvotes: 0

Views: 611

Answers (1)

ana
ana

Reputation: 79

Ok! I figured it out! This is the solution, in case anyone has the same problem.

run("Merge Channels...", "c1=["+fullname2+"] c2=["+fullname1+"] create");

Upvotes: 1

Related Questions