[ismrmrd] 67/177: Fixed append image and append array to reverse the labels in the hdf5 array to conform with the C-style hdf5 labeling. dimensions are N x CHA x Z x Y x X.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:03 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 d3b7d22f253c0998fa208202c1323f33d4af6cb9
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Fri Sep 19 17:00:39 2014 -0400

    Fixed append image and append array to reverse the labels in the hdf5 array to conform with the C-style hdf5 labeling.  dimensions are N x CHA x Z x Y x X.
---
 libsrc/dataset.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libsrc/dataset.c b/libsrc/dataset.c
index e82a772..f670a6a 100644
--- a/libsrc/dataset.c
+++ b/libsrc/dataset.c
@@ -954,10 +954,11 @@ int ismrmrd_append_image(const ISMRMRD_Dataset *dset, const char *varname,
             /* Handle the data */
             datapath = append_to_path(dset, path, "data");
             datatype = get_hdf5type_ndarray(im->head.data_type);
-            dims[0] = im->head.matrix_size[0];
-            dims[1] = im->head.matrix_size[1];
-            dims[2] = im->head.matrix_size[2];
-            dims[3] = im->head.channels;
+            /* permute the dimensions in the hdf5 file */
+            dims[3] = im->head.matrix_size[0];
+            dims[2] = im->head.matrix_size[1];
+            dims[1] = im->head.matrix_size[2];
+            dims[0] = im->head.channels;
             status = append_element(dset, datapath, im->data, datatype, 4, dims);
             if (status != ISMRMRD_NOERROR) {
                 ISMRMRD_THROW(ISMRMRD_FILEERROR, "Failed to append image data.");
@@ -1015,8 +1016,9 @@ int ismrmrd_append_array(const ISMRMRD_Dataset *dset, const char *varname,
             datatype = get_hdf5type_ndarray(arr->data_type);
             ndim = arr->ndim;
             dims = (uint16_t *) malloc(ndim*sizeof(uint16_t));
+            /* permute the dimensions in the hdf5 file */
             for (n=0; n<ndim; n++) {
-                dims[n] = arr->dims[n];
+                dims[ndim-n-1] = arr->dims[n];
             }
             status = append_element(dset, path, arr->data, datatype, ndim, dims);
             if (status != ISMRMRD_NOERROR) {

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