diff --git a/ij/io/FileOpener.java b/ij/io/FileOpener.java index 7b91dfbe..c2bbb26c 100644 --- a/ij/io/FileOpener.java +++ b/ij/io/FileOpener.java @@ -305,6 +305,24 @@ ImagePlus openStack(ColorModel cm, boolean show) { return imp; } + /** Applies the slice labels, ROI, overlay and properties stored in the + FileInfo. Called by Opener.openTiffStack() for stacks that it assembles + itself, one IFD per slice, which is the path taken by compressed stacks; + openStack() above applies the same metadata inline. */ + void setStackMetadata(ImagePlus imp) { + ImageStack stack = imp.getStack(); + if (fi.sliceLabels!=null && fi.sliceLabels.length<=stack.size()) { + for (int i=0; i1) imp = makeComposite(imp, fi); + // Applied last, after any conversion to a CompositeImage, since that + // replaces 'imp'. FileOpener.openStack() does the same for stacks + // read contiguously; without this, compressed stacks silently lose + // their slice labels, ROI, overlay and properties. + new FileOpener(fi).setStackMetadata(imp); IJ.showProgress(1.0); return imp; }