Error using "Merge Channels" command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error using "Merge Channels" command

Ramin
Hi,
I'm developing a macro for foci colocalisation. I encountered an issue when using the "merge channels" method. The open Images are part of a list to make access easier. However I can't seem to refer to the list in the command for "Merge Channels". I tried assigning variables to the filename in the list. For example

list0 = newArray(list[0]);
run("Merge Channels...", "c1=&list0 c2=&list1 keep"); 
But It still doesn't work. I keep getting the error message: <  "0" is not a valid choice for C1 Red  >

Here my original code:

list = getFileList(dir);
		
	for (i=0; i<list.length; i++) {
		open(dir+list[i]);
	}

run("Merge Channels...", "c1=&list[0] c2=&list[1] keep");

Does anyone know a way around this?

using fiji 1.5e
Reply | Threaded
Open this post in threaded view
|

Re: Error using "Merge Channels" command

Rocco D'Antuono
Hi Ramin, use the following line in your code:

run("Merge Channels...", "c1="+list[0]+" c2="+list[1]+" keep");

Best regards,
Rocco
Senior Microscopist
Crick Advanced Light Microscopy facility (CALM)
The Francis Crick Institute
1 Midland Road, NW1 1AT, London (UK)
https://roccodant.github.io/