[ismrmrd] 118/281: added example code for java and python bindings

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag ismrmrd0.5
in repository ismrmrd.

commit cb74efac9804fc58447f55e20a288ec35955081d
Author: Joseph Naegele <joseph.naegele at gmail.com>
Date:   Thu Mar 28 15:42:53 2013 -0400

    added example code for java and python bindings
---
 bindings/java/runme.java | 16 ++++++++++++++++
 bindings/python/test.py  |  9 +++++++++
 2 files changed, 25 insertions(+)

diff --git a/bindings/java/runme.java b/bindings/java/runme.java
new file mode 100644
index 0000000..30b849b
--- /dev/null
+++ b/bindings/java/runme.java
@@ -0,0 +1,16 @@
+public class runme {
+    public static void main(String argv[]) {
+        System.loadLibrary("jismrmrd");
+
+        //System.out.format("ISMRMRD_USER_INTS: %d%n", ismrmrd.ISMRMRD_USER_INTS);
+        IsmrmrdDataset f = new IsmrmrdDataset("testdata.h5", "/dataset");
+        String xml = f.readHeader();
+        System.out.println(xml);
+
+        Acquisition a = f.readAcquisition(10);
+        float[] data = a.getData();
+        for (int i=0; i < a.getNumberOfSamples() * a.getActiveChannels(); i++) {
+            System.out.format("%f ", data[i]);
+        }
+    }
+}
diff --git a/bindings/python/test.py b/bindings/python/test.py
new file mode 100644
index 0000000..a209650
--- /dev/null
+++ b/bindings/python/test.py
@@ -0,0 +1,9 @@
+import ismrmrd
+
+f = ismrmrd.IsmrmrdDataset('./testdata.h5', '/dataset')
+xml = f.readHeader()
+
+a = f.readAcquisition(10)
+
+print(a.getPosition(0), a.getPosition(1), a.getPosition(2))
+print(a.getReadDirection(0), a.getReadDirection(1), a.getReadDirection(2))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list