[ismrmrd] 223/281: change the dependency measurement definition in schema

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:17 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 207597cec6ef147948c88367fc26fdc7c99bc836
Author: Hui Xue <hui.xue at nih.gov>
Date:   Sat Apr 19 13:11:39 2014 -0400

    change the dependency measurement definition in schema
---
 CMakeLists.txt         |  2 +-
 ismrmrd.h              | 26 +++++++++++++-------------
 schema/ismrmrd.xsd     | 27 ++++++++++++++++-----------
 tests/c/t_cstructs.cpp | 14 +++++++-------
 4 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a565aa9..30a08a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,7 @@ add_library(dummy SHARED ${XSDS_SOURCES})
 target_link_libraries(dummy ${XERCESC_LIBRARIES})
 
 # Add library ismrmrd
-add_library(ismrmrd SHARED ismrmrd_hdf5.cpp)
+add_library(ismrmrd SHARED ismrmrd_hdf5.cpp schema/ismrmrd.xsd)
 
 #The findHDF5.cmake does not work very well on Windows, let's help it out
 IF(WIN32)
diff --git a/ismrmrd.h b/ismrmrd.h
index c4680b2..33defe4 100644
--- a/ismrmrd.h
+++ b/ismrmrd.h
@@ -1109,9 +1109,9 @@ static void directions_to_quaternion(float read_dir[3], float phase_dir[3],
     float r21 = read_dir[1], r22 = phase_dir[1], r23 = slice_dir[1];
     float r31 = read_dir[2], r32 = phase_dir[2], r33 = slice_dir[2];
 
-    float a = 1, b = 0, c = 0, d = 0, s = 0;
-    float trace = 0;
-    float xd, yd, zd;
+    double a = 1, b = 0, c = 0, d = 0, s = 0;
+    double trace = 0;
+    double xd, yd, zd;
 
     /* verify the sign of the rotation*/
     if (sign_of_directions(read_dir, phase_dir, slice_dir) < 0) {
@@ -1170,7 +1170,7 @@ static void directions_to_quaternion(float read_dir[3], float phase_dir[3],
         }
     }
 
-    quat[0] = a; quat[1] = b; quat[2] = c; quat[3] = d;
+    quat[0] = (float)a; quat[1] = (float)b; quat[2] = (float)c; quat[3] = (float)d;
 }
 
 /**
@@ -1184,17 +1184,17 @@ static void quaternion_to_directions(float quat[4], float read_dir[3],
 {
     float a = quat[0], b = quat[1], c = quat[2], d = quat[3];
 
-    read_dir[0]  = 1.0 - 2.0 * ( b*b + c*c );
-    phase_dir[0] = 2.0 * ( a*b - c*d );
-    slice_dir[0] = 2.0 * ( a*c + b*d );
+    read_dir[0]  = 1.0f - 2.0f * ( b*b + c*c );
+    phase_dir[0] = 2.0f * ( a*b - c*d );
+    slice_dir[0] = 2.0f * ( a*c + b*d );
 
-    read_dir[1]  = 2.0 * ( a*b + c*d );
-    phase_dir[1] = 1.0 - 2.0 * ( a*a + c*c );
-    slice_dir[1] = 2.0 * ( b*c - a*d );
+    read_dir[1]  = 2.0f * ( a*b + c*d );
+    phase_dir[1] = 1.0f - 2.0f * ( a*a + c*c );
+    slice_dir[1] = 2.0f * ( b*c - a*d );
 
-    read_dir[2]  = 2.0 * ( a*c - b*d );
-    phase_dir[2] = 2.0 * ( b*c + a*d );
-    slice_dir[2] = 1.0 - 2.0 * ( a*a + b*b );
+    read_dir[2]  = 2.0f * ( a*c - b*d );
+    phase_dir[2] = 2.0f * ( b*c + a*d );
+    slice_dir[2] = 1.0f - 2.0f * ( a*a + b*b );
 }
 
 #ifdef __cplusplus
diff --git a/schema/ismrmrd.xsd b/schema/ismrmrd.xsd
index 27a37f1..efa1b79 100644
--- a/schema/ismrmrd.xsd
+++ b/schema/ismrmrd.xsd
@@ -46,7 +46,7 @@
   </xs:complexType>
 
   <xs:complexType name="measurementInformationType">
-    <xs:all>
+    <xs:sequence>
       <xs:element minOccurs="0" name="measurementID" type="xs:string"/>
       <xs:element minOccurs="0" name="seriesDate" type="xs:date"/>
       <xs:element minOccurs="0" name="seriesTime" type="xs:time"/>
@@ -67,18 +67,15 @@
       <xs:element minOccurs="0" name="initialSeriesNumber" type="xs:long"/>
       <xs:element minOccurs="0" name="protocolName" type="xs:string"/>
       <xs:element minOccurs="0" name="seriesDescription" type="xs:string"/>
-      <xs:element maxOccurs="1" minOccurs="0" name="measurementDependencyIDs" type="measurementDependenciesType"/>
-    </xs:all>
+      <xs:element maxOccurs="unbounded" minOccurs="0" name="measurementDependency" type="measurementDependencyType"/>
+    </xs:sequence>
   </xs:complexType>
 
-  <xs:complexType name="measurementDependenciesType">
-    <xs:all>
-      <xs:element maxOccurs="1" minOccurs="0" name="noiseMeasurement" type="xs:string"/>
-      <xs:element maxOccurs="1" minOccurs="0" name="surfaceCoilCorrectionMeasurement" type="xs:string"/>
-      <xs:element maxOccurs="1" minOccurs="0" name="otherMeasurement1" type="xs:string"/>
-      <xs:element maxOccurs="1" minOccurs="0" name="otherMeasurement2" type="xs:string"/>
-      <xs:element maxOccurs="1" minOccurs="0" name="otherMeasurement3" type="xs:string"/>
-    </xs:all>
+  <xs:complexType name="measurementDependencyType">
+    <xs:sequence>
+        <xs:element maxOccurs="1" minOccurs="1" name="dependencyType" type="xs:string"/>
+        <xs:element maxOccurs="1" minOccurs="1" name="measurementID" type="xs:string"/>
+    </xs:sequence>
   </xs:complexType>
 
   <xs:complexType name="acquisitionSystemInformationType">
@@ -197,6 +194,13 @@
     </xs:all>
   </xs:complexType>
 
+  <xs:complexType name="userParameterStringType">
+    <xs:all>
+      <xs:element name="name" type="xs:string"/>
+      <xs:element name="value" type="xs:string"/>
+    </xs:all>
+  </xs:complexType>
+
   <xs:complexType name="userParameterBase64Type">
     <xs:all>
       <xs:element name="name" type="xs:string"/>
@@ -245,6 +249,7 @@
     <xs:sequence>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="userParameterLong" type="userParameterLongType"/>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="userParameterDouble" type="userParameterDoubleType"/>
+      <xs:element maxOccurs="unbounded" minOccurs="0" name="userParameterString" type="userParameterStringType"/>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="userParameterBase64" type="userParameterBase64Type"/>
     </xs:sequence>
   </xs:complexType>
diff --git a/tests/c/t_cstructs.cpp b/tests/c/t_cstructs.cpp
index 848b078..6f53a39 100644
--- a/tests/c/t_cstructs.cpp
+++ b/tests/c/t_cstructs.cpp
@@ -44,9 +44,9 @@ int main(void)
     acq_head.trajectory_dimensions = 2;
     acq_head.sample_time_us = 123.321;
 
-    acq_head.position[0] = -12.80;
-    acq_head.position[1] = 0.23;
-    acq_head.position[2] = 12.45;
+    acq_head.position[0] = -12.80f;
+    acq_head.position[1] = 0.23f;
+    acq_head.position[2] = 12.45f;
 
     acq_head.read_dir[0] = 1;
     acq_head.read_dir[1] = 0;
@@ -88,9 +88,9 @@ int main(void)
 
     img_head.channels = 32;
 
-    img_head.position[0] = -12.80;
-    img_head.position[1] = 0.23;
-    img_head.position[2] = 12.45;
+    img_head.position[0] = -12.80f;
+    img_head.position[1] = 0.23f;
+    img_head.position[2] = 12.45f;
 
     img_head.read_dir[0] = 1;
     img_head.read_dir[1] = 0;
@@ -106,7 +106,7 @@ int main(void)
 
     img_head.patient_table_position[0] = 0.0;
     img_head.patient_table_position[1] = 0.0;
-    img_head.patient_table_position[2] = 2.13;
+    img_head.patient_table_position[2] = 2.13f;
 
     img_head.average = 50;
     img_head.slice = 14;

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