This method has been replaced by IJ.createHyperStack().
(String title, int channels, int slices, int frames, int bitDepth)
| 2779 | |
| 2780 | /** This method has been replaced by IJ.createHyperStack(). */ |
| 2781 | public ImagePlus createHyperStack(String title, int channels, int slices, int frames, int bitDepth) { |
| 2782 | int size = channels*slices*frames; |
| 2783 | ImageStack stack2 = new ImageStack(width, height, size); // create empty stack |
| 2784 | ImageProcessor ip2 = null; |
| 2785 | switch (bitDepth) { |
| 2786 | case 8: ip2 = new ByteProcessor(width, height); break; |
| 2787 | case 16: ip2 = new ShortProcessor(width, height); break; |
| 2788 | case 24: ip2 = new ColorProcessor(width, height); break; |
| 2789 | case 32: ip2 = new FloatProcessor(width, height); break; |
| 2790 | default: throw new IllegalArgumentException("Invalid bit depth"); |
| 2791 | } |
| 2792 | stack2.setPixels(ip2.getPixels(), 1); // can't create ImagePlus will null 1st image |
| 2793 | ImagePlus imp2 = new ImagePlus(title, stack2); |
| 2794 | stack2.setPixels(null, 1); |
| 2795 | imp2.setDimensions(channels, slices, frames); |
| 2796 | imp2.setCalibration(getCalibration()); |
| 2797 | imp2.setOpenAsHyperStack(true); |
| 2798 | return imp2; |
| 2799 | } |
| 2800 | |
| 2801 | /** Copies the calibration of the specified image to this image. */ |
| 2802 | public void copyScale(ImagePlus imp) { |
no test coverage detected