(double inSpacing, double outSpacing, int count)
| 730 | } |
| 731 | |
| 732 | int getOutputStackSize(double inSpacing, double outSpacing, int count) { |
| 733 | Roi roi = imp.getRoi(); |
| 734 | int width = imp.getWidth(); |
| 735 | int height = imp.getHeight(); |
| 736 | if (roi!=null) { |
| 737 | Rectangle r = roi.getBounds(); |
| 738 | width = r.width; |
| 739 | width = r.height; |
| 740 | } |
| 741 | int type = roi!=null?roi.getType():0; |
| 742 | int stackSize = imp.getStackSize(); |
| 743 | double size = 0.0; |
| 744 | if (type==Roi.RECTANGLE) { |
| 745 | size = width*height*stackSize; |
| 746 | if (outSpacing>0&&!nointerpolate) size *= inSpacing/outSpacing; |
| 747 | } else |
| 748 | size = gLength*count*stackSize; |
| 749 | int bits = imp.getBitDepth(); |
| 750 | switch (bits) { |
| 751 | case 16: size*=2; break; |
| 752 | case 24: case 32: size*=4; break; |
| 753 | } |
| 754 | return (int)Math.round(size/1048576.0); |
| 755 | } |
| 756 | |
| 757 | int getAvailableMemory() { |
| 758 | long max = IJ.maxMemory(); |
no test coverage detected