[ismrmrd] 06/177: Basic C program to test the C API.

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


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

ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.

commit 90ab007b01103a08eca0655490c9c38a2c239600
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Sat Jul 19 22:43:15 2014 -0400

    Basic C program to test the C API.
---
 tests/c/basic_test.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/tests/c/basic_test.c b/tests/c/basic_test.c
new file mode 100644
index 0000000..e1398b5
--- /dev/null
+++ b/tests/c/basic_test.c
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <ismrmrd.h>
+
+#ifdef __cplusplus
+using namespace ISMRMRD;
+#endif
+
+int main(void)
+{
+
+   Acquisition acq;
+   InitAcquisition(&acq);
+   acq.head.number_of_samples = 128;
+   acq.head.active_channels = 4;
+   MakeConsistentAcquisition(&acq);
+   printf("Acq Version: %d\n", acq.head.version);
+
+   flags_set(&(acq.head.flags), ACQ_FIRST_IN_SLICE);
+   printf("Flags: %llu\n", acq.head.flags);
+   printf("ACQ_FIRST_IN_SLICE: %d\n", flags_is_set(acq.head.flags, ACQ_FIRST_IN_SLICE));
+   flags_clear(&(acq.head.flags), ACQ_FIRST_IN_SLICE);
+   printf("Flags: %llu\n", acq.head.flags);
+   printf("ACQ_FIRST_IN_SLICE: %d\n", flags_is_set(acq.head.flags, ACQ_FIRST_IN_SLICE));
+
+
+   Image im;
+   InitImage(&im);
+   printf("Image Version: %d\n", im.head.version);
+
+   NDArray arr;
+   InitNDArray(&arr);
+   printf("Array ndim: %d\n", arr.ndim);
+   printf("Array dim[0]: %d\n", arr.dims[0]);  
+
+   return 0;
+}

-- 
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