Returns the size of this image in bytes.
()
| 1333 | |
| 1334 | /** Returns the size of this image in bytes. */ |
| 1335 | public double getSizeInBytes() { |
| 1336 | double size = ((double)getWidth()*getHeight()*getStackSize()); |
| 1337 | int type = getType(); |
| 1338 | switch (type) { |
| 1339 | case ImagePlus.GRAY16: size *= 2.0; break; |
| 1340 | case ImagePlus.GRAY32: size *= 4.0; break; |
| 1341 | case ImagePlus.COLOR_RGB: size *= 4.0; break; |
| 1342 | } |
| 1343 | return size; |
| 1344 | } |
| 1345 | |
| 1346 | /** Returns the number of stack images. */ |
| 1347 | public int getStackSize() { |
no test coverage detected