virtual stack
Posted by Knecht, David on Mar 21, 2010; 1:53pm
URL: http://imagej.273.s1.nabble.com/virtual-stack-tp3688745.html
I am trying to add a time stamp to a stack that is too large to open in ImageJ. I added the Time Stamper plugin to a virtual stack macro to try to get it to do the job, but I get back an error message that the file is not a stack. How do you get around this? Dave
// Process Virtual Stack
//
// This macro demonstrates how to process the images in a
// virtual stack, save the processed images in a folder, and
// then open those images in another virtual stack. The virtual
// stack can be opened using File>Import>Image Sequence,
// File>Import>TIFF Virtual Stack or File>Import>Raw.
if (nSlices==1) exit("Stack required");
dir = getDirectory("Choose Destination Directory ");
setBatchMode(true);
id = getImageID;
for (i=1; i<= nSlices; i++) {
showProgress(i, nSlices);
selectImage(id);
setSlice(i);
name = getMetadata;
run("Duplicate...", "title=temp");
run("Time Stamper");
saveAs("tif", dir+pad(i-1));
close();
}
setBatchMode(false);
run("Image Sequence...", "open=["+dir+"00000.tif] use");
function pad(n) {
str = toString(n);
while (lengthOf(str)<5)
str = "0" + str;
return str;
}
Dr. David Knecht
Department of Molecular and Cell Biology
Co-head Flow Cytometry and Confocal Microscopy Facility
U-3125
91 N. Eagleville Rd.
University of Connecticut
Storrs, CT 06269
860-486-2200
860-486-4331 (fax)