I need help with a small macro I want to create. Background: I have ics2-format stacks from my deconvolution program and I need them for an IDL based programm as tiff and in an concatenated stack order. Since I have tons of these stacks I hoped to get my macro running to convert these files without any further questions.
Now I have two problems:
First: How to automatically define the split channels for creating concatenated stacks the macro. After splitting the stack to channel stacks ImageJ names them C1-…, C2-…and so on + filename. Since the file name differs in some parts I can not just use this as source. Now I tried several stuff that imageJ just takes the image containing “C1” as image 1, “C2” as image 2 and so on. Until now none of my tries were accepted
Here is my current draft…
run("Bio-Formats", "open autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT"); dir = getDirectory("image"); name=getTitle; path = dir+name; run("Split Channels"); run("Concatenate...", " title=[Concatenated Stacks] image1=[name, "C1"] image2=[C2.ics] image3=[C3.ics] image4=[-- None --]"); saveAs("Tiff", path); close();
Another question I have is how I can put this in a loop. For images just “opened” it always worked with “openNext” but with the bioformats-importer this is also an issue.
Would be great if you could help me!