changeset 2462:588e08253889

added vecotr_dimension entry to the list of dimension names so to fix the problem with converting vector_dimension images to minc2.CVS: ----------------------------------------------------------------------
author baghdadi <baghdadi>
date Thu, 04 Sep 2008 16:14:27 +0000
parents dea23be6fae5
children 857815ae5b00
files libsrc/hdf_convenience.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libsrc/hdf_convenience.c
+++ b/libsrc/hdf_convenience.c
@@ -8,7 +8,7 @@
 #include "minc_private.h"
 #include "hdf_convenience.h"
 
-#define MI2_STD_DIM_COUNT 8
+#define MI2_STD_DIM_COUNT  9
 #define MI2_DIMORDER "dimorder"
 #define MI2_LENGTH "length"
 #define MI2_CLASS "class"
@@ -275,7 +275,8 @@
 	MIxfrequency,
 	MIyfrequency,
 	MIzfrequency,
-	MItfrequency
+	MItfrequency,
+        MIvector_dimension,
     };
     int i;
 
@@ -919,8 +920,13 @@
 
     aspc_id = H5Screate(H5S_SCALAR);
     if (aspc_id >= 0) {
+      H5E_BEGIN_TRY {
+        H5Adelete(dst_id, MI2_LENGTH);
+        /* Create the attribute anew.
+	 */
         att_id = H5Acreate(dst_id, MI2_LENGTH, H5T_STD_U32LE, aspc_id, 
                            H5P_DEFAULT);
+      }  H5E_END_TRY;
         if (att_id >= 0) {
             H5Awrite(att_id, H5T_NATIVE_LONG, (void *) &length);
             H5Aclose(att_id);