|
Bugzilla – Bug 1000 |
"images to stack" does not work |
Last modified: 2015-02-06 14:01:56 CST |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||
P;ease provide a small test macro that reproduces the problem. The following macro, which opens three images and runs "Images to Stack", works as expected. run("Close All"); run("Boats (356K)"); run("Bridge (174K)"); run("Dot Blot (7K)"); run("Images to Stack", "method=[Copy (center)] name=Stack use");Created attachment 230 image propertiesCreated attachment 231 errorBased on your screenshots, I created a macro that reproduces the problem on my system: newImage("5x7_000001.tif", "16-bit random", 2273, 3570, 4); run("Properties...", "channels=1 slices=1 frames=4 unit=pixel pixel_width=1.0000 pixel_height=1.0000 voxel_depth=1.0000"); newImage("5x7_000002.tif", "16-bit random", 2273, 3181, 4); run("Properties...", "channels=1 slices=1 frames=4 unit=pixel pixel_width=1.0000 pixel_height=1.0000 voxel_depth=1.0000"); run("Images to Stack");Thanks Wayne! Here is a patch that tells the user this when such a circumstance occurs: diff --git a/src/main/java/ij/plugin/ImagesToStack.java b/src/main/java/ij/plugin/ImagesToStack.java index e84d924..d72dc30 100644 --- a/src/main/java/ij/plugin/ImagesToStack.java +++ b/src/main/java/ij/plugin/ImagesToStack.java @@ -38,15 +38,22 @@ public class ImagesToStack implements PlugIn { return; } - int count = 0; + int count = 0, stackCount = 0; image = new ImagePlus[wList.length]; for (int i=0; i<wList.length; i++) { ImagePlus imp = WindowManager.getImage(wList[i]); if (imp.getStackSize()==1) image[count++] = imp; + else + stackCount++; } if (count<2) { - IJ.error("Images to Stack", "There must be at least two open images."); + if (stackCount >= 2) { + IJ.error("Images to Stack", "The \"Images to Stack\" command " + + "does not work with stacks as input.\nInstead, use the " + + "Image>Stacks>Tools>Concatenate command."); + } + else IJ.error("Images to Stack", "There must be at least two open images."); return; }Created attachment 232 img propertiesCreated attachment 233 errorRun the following macro before using the Concatenate command. It zero pads all open images so that they have the same dimensions. maxWidth = 0; maxHeight = 0; for (i=1; i<=nImages; i++) { selectImage(i); if (getWidth>maxWidth) maxWidth=getWidth; if (getHeight>maxHeight) maxHeight=getHeight; } for (i=1; i<=nImages; i++) { selectImage(i); if (getWidth!=maxWidth || getHeight!=maxHeight) run("Canvas Size...", "width=&maxWidth height=&maxHeight position=Center zero"); }