getDimensions(w, h, channels, slices, frames); for (t=1; t<=frames; t++) { for (z=1; z<=slices; z++) { for (c=1; c<=channels; c++) { Stack.setPosition(c, z, t); if (c==1) setMetadata("Label", "Red"); else if (c==2) setMetadata("Label", "Green"); else if (c==3) setMetadata("Label", "Blue"); } } }