Login  Register

Re: Batch splitting of stacks and saving

Posted by Ash Dunne on Mar 15, 2012; 9:50am
URL: http://imagej.273.s1.nabble.com/Batch-splitting-of-stacks-and-saving-tp4578247p4620695.html

Hi Michael and Dave,

Thanks for your input. I appreciate the help!

I've almost got there by modifying Michael's macros (haven't had a proper look at yours yet Dave).

What I'm getting at the moment is that when I run the macro as batch, I am also getting duplicates of the original file in the destination folder. Not a massive problem, but it would be great if I could sort that out once and for all.

I think it's because the Batch box is already asking for an output folder and file type. Is there anyway to stop it saving the duplicated original file?

Here's what I'm currently using:

title=getTitle();
if(endsWith(title, ".tif"))
title=substring(title, 0, lengthOf(title)-4);
dir="\\\\AIFNAS3\\AIFdatasets\\Dom James\\2012-03scan\\test batch split\\";
titleD=title+"_DAPI.tif";
setSlice(1);
run("Duplicate...", "title=titleD");
saveAs("Tiff", dir+titleD);
close();
setSlice(2);
titleG=title+"_488.tif";
run("Duplicate...", "title=titleG");
saveAs("Tiff", dir+titleG);
close();
close();