/** Adds the image in 'ip' to the end of the stack. */ public void addSlice(String sliceLabel, ImageProcessor ip) { if (ip.getWidth() != width || ip.getHeight() != height) throw new IllegalArgumentException("Dimensions do not match"); if (nSlices == 0) { cm = ip.getColorModel(); min = ip.getMin(); max = ip.getMax(); } addSlice(sliceLabel, ip.getPixels()); }