int width = image[0].getWidth();
int height = image[0].getHeight();
double min = Double.MAX_VALUE;
double max = -Double.MAX_VALUE;
ImageStack stack = new ImageStack(width, height);
FileInfo fi = image[0].getOriginalFileInfo();
if (fi!=null && fi.directory==null) fi = null;
for (int i=0; i<count; i++) {
ImageProcessor ip = image[i].getProcessor();
if (ip.getMin()<min) min = ip.getMin();
if (ip.getMax()>max) max = ip.getMax();
String label = image[i].getTitle();
String info = (String)image[i].getProperty("Info");
if (info!=null) label += "\n" + info;
if (fi!=null) {
FileInfo fi2 = image[i].getOriginalFileInfo();
if (fi2!=null && !fi.directory.equals(fi2.directory))
fi = null;
}
stack.addSlice(label, ip);
image[i].changes = false;