[ismrmrd] 11/177: Stubbed out dataset C header.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:56 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 3e72300b5c02fc88afc6eff0573fda92a5e4ec58
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Wed Jul 23 09:28:34 2014 -0400

    Stubbed out dataset C header.
---
 ismrmrd.h         |  10 ++--
 ismrmrd_dataset.h | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+), 5 deletions(-)

diff --git a/ismrmrd.h b/ismrmrd.h
index 78ac603..7aa04b6 100644
--- a/ismrmrd.h
+++ b/ismrmrd.h
@@ -48,7 +48,7 @@ extern "C" {
  * Constants
  *
  */
-enum Constants {
+enum ISMRMRD_Constants {
     ISMRMRD_VERSION = 1,
     ISMRMRD_USER_INTS = 8,
     ISMRMRD_USER_FLOATS = 8,
@@ -60,7 +60,7 @@ enum Constants {
 /**
  * Data Types
  */
-enum DataTypes {
+enum ISMRMRD_DataTypes {
     ISMRMRD_USHORT = 1, /**< corresponds to uint16_t */
     ISMRMRD_SHORT,      /**< corresponds to int16_t */
     ISMRMRD_UINT,       /**< corresponds to uint32_t */
@@ -74,7 +74,7 @@ enum DataTypes {
 /**
  * Acquisition Flags
  */
-enum AcquisitionFlags {
+enum ISMRMRD_AcquisitionFlags {
     ISMRMRD_ACQ_FIRST_IN_ENCODE_STEP1 = 1,
     ISMRMRD_ACQ_LAST_IN_ENCODE_STEP1,
     ISMRMRD_ACQ_FIRST_IN_ENCODE_STEP2,
@@ -117,7 +117,7 @@ enum AcquisitionFlags {
 /**
  * Image Types
  */
-enum ImageType {
+enum ISMRMRD_ImageType {
     ISMRMRD_IMTYPE_MAGNITUDE = 1,
     ISMRMRD_IMTYPE_PHASE,
     ISMRMRD_IMTYPE_REAL,
@@ -128,7 +128,7 @@ enum ImageType {
 /**
  * Image Flags
  */
-enum ImageFlags {
+enum ISMRMRD_ImageFlags {
     ISMRMRD_IMAGE_IS_NAVIGATION_DATA = 1,
     ISMRMRD_IMAGE_USER1 = 57,
     ISMRMRD_IMAGE_USER2,
diff --git a/ismrmrd_dataset.h b/ismrmrd_dataset.h
new file mode 100644
index 0000000..8a46640
--- /dev/null
+++ b/ismrmrd_dataset.h
@@ -0,0 +1,133 @@
+/* ISMRMRD Data Set */
+
+#pragma once
+#ifndef ISMRMRD_DATASET_H
+#define ISMRMRD_DATASET_H
+
+#include "ismrmrd.h"
+#include <hdf5.h>
+
+#ifdef __cplusplus
+namespace ISMRMRD {
+extern "C" {
+#endif
+
+/**
+ * Image and Array storage block modes
+ */
+enum ISMRMRD_BlockModes {
+    ISMRMRD_BLOCKMODE_ARRAY,
+    ISMRMRD_BLOCKMODE_BLOBS
+};
+
+/**
+ *   Interface for accessing an ISMRMRD Data Set stored on disk in HDF5 format.
+ *
+ *   A given ISMRMRD dataset if assumed to be stored under one group name in the
+ *   HDF5 file.  To make the datasets consistent, this library enforces that the
+ *   XML configuration is stored in the variable groupname/xml and the
+ *   Acquisitions are stored in the variable groupname/data.
+ *
+ */
+typedef struct ISMRMRD_Dataset {
+    char *filename_;
+    char *groupname_;
+    int dataset_;
+} ISMRMRD_Dataset;
+
+/**
+ * Opens an ISMRMRD dataset.
+ *
+ */
+int ismrmrd_open_dataset(ISMRMRD_Dataset *dset);
+
+/**
+ * Closes all references to the underlying HDF5 file.
+ *
+ */
+int ismrmrd_close_dataset(ISMRMRD_Dataset *dset);
+
+/**
+ *  Writes the XML header string to the dataset.
+ *
+ *  @warning There is no check of whether the string is a valid XML document at this point.
+ *
+ */
+int ismrmrd_write_xml_header(const ISMRMRD_Dataset *dset, const char *xml);
+
+/**
+ *  Reads the XML configuration header from the dataset.
+ */
+int ismrmrd_read_xml_header(const ISMRMRD_Dataset *dset, char *xml);
+
+/**
+ *  Appends and NMR/MRI acquisition to the dataset.
+ *
+ *  Please consult @See Acquisition struct for details.
+ */
+int ismrmrd_append_acquisition(const ISMRMRD_Dataset *dset, const Acquisition *a);
+
+/**
+ *  Reads the acquisition with the specified index from the dataset.
+ */
+int ismrmrd_read_acquisition(const ISMRMRD_Dataset *dset, unsigned long index, ISMRMRD_Acquisition *a);
+
+/**
+ *  Return the number of acquisitions in the dataset.
+ */
+unsigned long ismrmrd_get_number_of_acquisitions(const ISMRMRD_Dataset *dset);
+
+/**
+ *  Appends an Image to the variable named varname in the dataset.
+ *
+ *  Please consult @See Image struct for details.
+ *
+ *  Images can be stored in one of two ways.  In either case headers and attribute strings are stored
+ *  separatey for each of image.   This allows for easy viewing and reading in other applications.
+ *
+ *  Method 1: Images of the same size can be appended to "grow" an array.
+ *    e.g. 20 images of size (256, 256, 4, 16), i.e. 4 slice and 16 channels, can be appended
+ *    one at a time to make a (256, 256, 4, 16, 20) array in the file.
+ *
+ *  Method 2: Images of different sizes can be appended individually.
+ *
+ */
+int ismrmrd_append_image(const ISMRMRD_Dataset *dset, const char *varname,
+                         const int blockmode, const *Image);
+
+/**
+ *   Reads an image stored with appendImage.
+ *   The index indicates which image to read from the variable named varname.
+ */
+int ismrmrd_read_image(const ISMRMRD_Dataset *dset, const char *varname,
+                       const unsigned long index, Image *im);
+
+/**
+ *  Appends an NDArray to the variable named varname in the dataset.
+ *
+ *  Please consult @See NDArray struct for details.
+ *
+ *  Arrays contain simple data elements such as float, double, etc.
+ *  Arrays can be stored in one of two ways to allow for easy viewing in other applications.
+ *
+ *  Method 1: Arrays of the same size can be appended to "grow" an array,
+ *    e.g. 3D arrays of size (K,L,M) can be appended to grow a 4D array of size (K,L,M,N).
+ *
+ *  Method 2:Arrays of varying dimensionality and size can be appended as blobs of data.
+ *
+ */
+int ismrmrd_append_array(const ISMRMRD_Dataset *dset, const char *varname,
+                         const int blockmode, const ISMRMRD_NDArray *arr);
+
+/**
+ *  Reads a multi-dimensional array from the data file.
+ */
+int ismrmrd_read_array(const ISMRMRD_Dataset *dataset, const char *varname,
+                       const unsigned long index, ISMRMRD_NDArray *arr);
+
+#ifdef __cplusplus
+} /* extern "C" */
+} /* ISMRMRD namespace */
+#endif
+
+#endif /* ISMRMRD_DATASET_H */

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