context.waitAnyUpdateAll();
float[] histogram = calcHist();
ShortBuffer depth = depthMD.getData().createShortBuffer();
depth.rewind();
while (depth.remaining() > 0) {
int pos = depth.position();
short pixel = depth.get();
imgbytes[pos] = (byte) histogram[pixel];
}
} catch (GeneralException e) {