HeapReader.java
Go to the documentation of this file.00001 package theba.core.io;
00002
00010 public class HeapReader implements VolumeReader {
00011 private int width;
00012
00013 private int height;
00014
00015 private int depth;
00016
00017 private short[][] volume;
00018
00019 public HeapReader(int width, int height, int depth) {
00020 this.width = width;
00021 this.height = height;
00022 this.depth = depth;
00023 volume = new short[depth][width * height];
00024 }
00025
00026 public int getWidth() {
00027 return width;
00028 }
00029
00030 public int getHeight() {
00031 return height;
00032 }
00033
00034 public int getDepth() {
00035 return depth;
00036 }
00037
00038 public void close() {
00039 }
00040
00041 public void flush() {
00042 }
00043
00044 public short[] getSlice(int sliceNo) {
00045 return volume[sliceNo];
00046 }
00047
00048 public synchronized void putSlice(short[] data, int pos) {
00049 System.arraycopy(data, 0, volume[pos], 0, width * height);
00050 }
00051
00052 public void destroy() {
00053 volume = null;
00054 System.gc();
00055 }
00056 }