[ismrmrd] 172/281: Reverted size of physiology_time_stamps change for now. Deferred to a mojore version change.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:11 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 caf66d134b66eb57bb03850ae1d38abfe5167124
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Wed Aug 28 12:55:04 2013 -0400

    Reverted size of physiology_time_stamps change for now.  Deferred to a mojore version change.
---
 ismrmrd.h                           |  2 +-
 ismrmrd_hdf5_datatypes.h            |  4 ++++
 matlab/+ismrmrd/AcquisitionHeader.m | 25 ++++++++++++++++++-------
 3 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/ismrmrd.h b/ismrmrd.h
index db1640c..8c6d68e 100644
--- a/ismrmrd.h
+++ b/ismrmrd.h
@@ -46,7 +46,7 @@ typedef unsigned __int64 uint64_t;
 #define ISMRMRD_DIRECTION_LENGTH  3
 #define ISMRMRD_USER_INTS         8
 #define ISMRMRD_USER_FLOATS       8
-#define ISMRMRD_PHYS_STAMPS       3
+#define ISMRMRD_PHYS_STAMPS       8  //TODO: This should be changed to 3 (Major impact)
 #define ISMRMRD_CHANNEL_MASKS     16
 
 #ifdef __cplusplus
diff --git a/ismrmrd_hdf5_datatypes.h b/ismrmrd_hdf5_datatypes.h
index 016897b..ea6e75f 100644
--- a/ismrmrd_hdf5_datatypes.h
+++ b/ismrmrd_hdf5_datatypes.h
@@ -96,6 +96,8 @@ template <> inline boost::shared_ptr<DataType> getIsmrmrdHDF5Type<AcquisitionHea
 	ret->insertMember( "scan_counter", 				HOFFSET(AcquisitionHeader, scan_counter), 			PredType::NATIVE_UINT32);
 	ret->insertMember( "acquisition_time_stamp", 	HOFFSET(AcquisitionHeader, acquisition_time_stamp), PredType::NATIVE_UINT32);
 
+        // TODO: change ISMRMRD_PHYS_STAMPS to 3 (Major change)
+        // we should use the size defines and not hard coded numbers.
 	std::vector<hsize_t> dims(1,3);
 	boost::shared_ptr<DataType> array_type(new ArrayType(PredType::NATIVE_UINT32, 1, &dims[0]));
 	ret->insertMember( "physiology_time_stamp", HOFFSET(AcquisitionHeader, physiology_time_stamp), 		*array_type);
@@ -244,6 +246,8 @@ template <> inline boost::shared_ptr<DataType> getIsmrmrdHDF5Type<ImageHeader>()
 	ret->insertMember( "set",   					HOFFSET(ImageHeader, set), 						PredType::NATIVE_UINT16);
 	ret->insertMember( "acquisition_time_stamp", 	HOFFSET(ImageHeader, acquisition_time_stamp),   PredType::NATIVE_UINT32);
 
+        // TODO: ISMRMRD_PHYS_STAMPS should be 3 (Major change)
+        // we should use the size defines and not hard coded numbers.
 	dims[0] = 3;
 	boost::shared_ptr<DataType> array_type(new ArrayType(PredType::NATIVE_UINT32, 1, &dims[0]));
 	ret->insertMember( "physiology_time_stamp", HOFFSET(ImageHeader, physiology_time_stamp), 		*array_type);
diff --git a/matlab/+ismrmrd/AcquisitionHeader.m b/matlab/+ismrmrd/AcquisitionHeader.m
index b801cb1..bd28765 100644
--- a/matlab/+ismrmrd/AcquisitionHeader.m
+++ b/matlab/+ismrmrd/AcquisitionHeader.m
@@ -6,7 +6,9 @@ classdef AcquisitionHeader
         measurement_uid = uint32(0);                   % Unique ID for the measurement %
         scan_counter = uint32(0);                      % Current acquisition number in the measurement %
         acquisition_time_stamp = uint32(0);            % Acquisition clock %
-        physiology_time_stamp = zeros(3,1,'uint32');   % Physiology time stamps, e.g. ecg, breating, etc. %
+	% TODO: physiology_time_stamp should be 3.
+        %physiology_time_stamp = zeros(3,1,'uint32');   % Physiology time stamps, e.g. ecg, breating, etc. %
+        physiology_time_stamp = zeros(8,1,'uint32');   % Physiology time stamps, e.g. ecg, breating, etc. %
         number_of_samples = uint16(0);                 % Number of samples acquired %
         available_channels = uint16(0);                % Available coils %
         active_channels = uint16(0);                   % Active coils on current acquisiton %
@@ -38,7 +40,9 @@ classdef AcquisitionHeader
                 obj.measurement_uid        = typecast(bytes(off:off+3),  'uint32'); off=off+4;
                 obj.scan_counter           = typecast(bytes(off:off+3),  'uint32'); off=off+4;
                 obj.acquisition_time_stamp = typecast(bytes(off:off+3),  'uint32'); off=off+4;
-                obj.physiology_time_stamp  = typecast(bytes(off:off+11), 'uint32'); off=off+12;
+                % TODO: physiology_time_stamp should be 3.
+                %obj.physiology_time_stamp  = typecast(bytes(off:off+11), 'uint32'); off=off+12;
+                obj.physiology_time_stamp  = typecast(bytes(off:off+31), 'uint32'); off=off+32;
                 obj.number_of_samples      = typecast(bytes(off:off+1),  'uint16'); off=off+2;
                 obj.available_channels     = typecast(bytes(off:off+1),  'uint16'); off=off+2;
                 obj.active_channels        = typecast(bytes(off:off+1),  'uint16'); off=off+2;
@@ -62,6 +66,8 @@ classdef AcquisitionHeader
         
         % Convert to Bytes
         function bytes = toBytes(obj)
+            % TODO: physiology_time_stamp should be 3.
+            %bytes = zeros(340,1,'int8');
             bytes = zeros(360,1,'int8');
             off = 1;
             bytes(off:off+1)   = typecast(obj.version               ,'int8'); off=off+2;
@@ -69,7 +75,9 @@ classdef AcquisitionHeader
             bytes(off:off+3)   = typecast(obj.measurement_uid       ,'int8'); off=off+4;
             bytes(off:off+3)   = typecast(obj.scan_counter          ,'int8'); off=off+4;
             bytes(off:off+3)   = typecast(obj.acquisition_time_stamp,'int8'); off=off+4;
-            bytes(off:off+11)  = typecast(obj.physiology_time_stamp ,'int8'); off=off+12;
+            % TODO: physiology_time_stamp should be 3.
+            %bytes(off:off+11)  = typecast(obj.physiology_time_stamp ,'int8'); off=off+12;
+            bytes(off:off+31)  = typecast(obj.physiology_time_stamp ,'int8'); off=off+32;
             bytes(off:off+1)   = typecast(obj.number_of_samples     ,'int8'); off=off+2;
             bytes(off:off+1)   = typecast(obj.available_channels    ,'int8'); off=off+2;
             bytes(off:off+1)   = typecast(obj.active_channels       ,'int8'); off=off+2;
@@ -123,10 +131,13 @@ classdef AcquisitionHeader
         end
         
         function obj = set.physiology_time_stamp(obj,v)
-            if (length(v)~=3)
-                error('AcquisitionHeader.physiology_time_stamp must have 3 elements')
-            end
-            obj.physiology_time_stamp = uint32(v);
+            % TODO: physiology_time_stamp should be 3.
+            %if (length(v)~=3)
+            %    error('AcquisitionHeader.physiology_time_stamp must have 3 elements')
+            %end
+            %obj.physiology_time_stamp = uint32(v);
+            obj.physiology_time_stamp(1:3) = uint32(v(1:3));
+            obj.physiology_time_stamp(4:8) = uint32(0);
         end
         
         function obj = set.number_of_samples(obj,v)

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