MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getOutputStackSize

Method getOutputStackSize

ij/src/main/java/ij/plugin/Slicer.java:732–755  ·  view source on GitHub ↗
(double inSpacing, double outSpacing, int count)

Source from the content-addressed store, hash-verified

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();

Callers 1

getSizeMethod · 0.95

Calls 8

getBoundsMethod · 0.95
getTypeMethod · 0.95
getRoiMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
getStackSizeMethod · 0.45
getBitDepthMethod · 0.45
roundMethod · 0.45

Tested by

no test coverage detected