import org.itk.simple.Image;
import org.itk.simple.SimpleITK;
import org.itk.simple.PixelIDValueEnum;
class ImageGetSetBuffer {
public static void main(String args[]) {
if (args.length < 1) {
System.out.format("Usage: ImageSetGetBuffer <input>");
System.exit(-1);
}
Image image = SimpleITK.readImage(args[0]);
if (image.getNumberOfComponentsPerPixel() != 1) {
} else {
}
java.nio.FloatBuffer buffer = (java.nio.FloatBuffer)image.getBufferAsBuffer();
System.out.println(buffer.toString());
for (int i = 0; i < 10 && buffer.hasRemaining(); ++i) {
System.out.println(buffer.get());
}
buffer.rewind();
while (buffer.hasRemaining()) {
buffer.put(0);
}
}
}