requires("1.42k"); Stack.getDimensions(mywidth, myheight, mychannels, myslices, myframes); if (mychannels>1 && myslices==1 && myframes==1) { //print("Hyperstack!"); run("Duplicate...", "title=Animation duplicate"); run("RGB Color"); selectWindow("Animation"); close(); selectWindow("Animation (RGB)"); run("8-bit"); run("Invert LUT"); rename("Animation"); } else if (mychannels==1 && myslices>1 && myframes==1) { //print("Stack!"); run("Duplicate...", "title=Animation duplicate"); rename("Animation"); } else { print("---------------------------------------"); print("c: ", mychannels, " channels"); print("z: ", myslices, " slices"); print("t: ", myframes, " frames"); print(""); print("Image is neither Stack nor Hyperstack."); print("Gif Animation unnecessary. Aborting..."); print("---------------------------------------"); print(""); }