[ismrmrd] 174/177: Removed spacing the Matlab ImageHeader

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:16 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 c4e4a8e9ba4a11f2e16bdf5d06a3d74c03a94ca7
Author: David C Hansen <dch at cs.au.dk>
Date:   Wed Nov 5 14:35:54 2014 +0100

    Removed spacing the Matlab ImageHeader
---
 matlab/+ismrmrd/ImageHeader.m | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/matlab/+ismrmrd/ImageHeader.m b/matlab/+ismrmrd/ImageHeader.m
index d895cb6..d245a17 100644
--- a/matlab/+ismrmrd/ImageHeader.m
+++ b/matlab/+ismrmrd/ImageHeader.m
@@ -263,8 +263,7 @@ classdef ImageHeader < handle
         function fromBytes(obj, bytearray)
             % Convert from a byte array to an ISMRMRD ImageHeader
 	    % This conforms to the memory layout of the C-struct
-
-            if size(bytearray,1) ~= 214
+            if size(bytearray,1) ~= 198
                 error('Wrong number of bytes for ImageHeader.')
             end
             N = size(bytearray,2);
@@ -288,15 +287,13 @@ classdef ImageHeader < handle
                 obj.repetition(p)               = typecast(bytearray(105:106,p), 'uint16');
                 obj.set(p)                      = typecast(bytearray(107:108,p), 'uint16');
                 obj.acquisition_time_stamp(p)   = typecast(bytearray(109:112,p), 'uint32');
-                obj.physiology_time_stamp(:,p)  = typecast(bytearray(113:124,p), 'uint32');
-                                                           ... %   C-struct has padding
-                
-                obj.image_type(p)               = typecast(bytearray(147:148,p), 'uint16');
-                obj.image_index(p)              = typecast(bytearray(149:150,p), 'uint16');
-                obj.image_series_index(p)       = typecast(bytearray(151:152,p), 'uint16');
-                obj.user_int(:,p)               = typecast(bytearray(153:184,p), 'uint32');
-                obj.user_float(:,p)             = typecast(bytearray(185:216,p), 'single');
-                obj.attribute_string_len        = typecast(bytearray(217:220,p), 'uint32');
+                obj.physiology_time_stamp(:,p)  = typecast(bytearray(113:124,p), 'uint32');                                                          
+                obj.image_type(p)               = typecast(bytearray(125:126,p), 'uint16');
+                obj.image_index(p)              = typecast(bytearray(127:128,p), 'uint16');
+                obj.image_series_index(p)       = typecast(bytearray(129:130,p), 'uint16');
+                obj.user_int(:,p)               = typecast(bytearray(131:162,p), 'uint32');
+                obj.user_float(:,p)             = typecast(bytearray(163:194,p), 'single');
+                obj.attribute_string_len        = typecast(bytearray(195:198,p), 'uint32');
                 
             end              
         end
@@ -306,7 +303,7 @@ classdef ImageHeader < handle
 	    % This conforms to the memory layout of the C-struct
 
             N = obj.getNumber;
-            bytes = zeros(214,N,'uint8');
+            bytes = zeros(198,N,'uint8');
             for p = 1:N
                 off = 1;
                 bytes(off:off+1,p)   = typecast(obj.version(p)                 ,'uint8'); off=off+2;
@@ -328,9 +325,9 @@ classdef ImageHeader < handle
                 bytes(off:off+1,p)   = typecast(obj.repetition(p)              ,'uint8'); off=off+2;
                 bytes(off:off+1,p)   = typecast(obj.set(p)                     ,'uint8'); off=off+2;
                 bytes(off:off+3,p)   = typecast(obj.acquisition_time_stamp(p)  ,'uint8'); off=off+4;
-                % The C struct has padding.
+                
                 bytes(off:off+11,p)  = typecast(obj.physiology_time_stamp(:,p) ,'uint8'); off=off+12;
-                off = off+20; % Discard 5*uint32;              
+                
                 bytes(off:off+1,p)   = typecast(obj.image_type(p)              ,'uint8'); off=off+2;
                 bytes(off:off+1,p)   = typecast(obj.image_index(p)             ,'uint8'); off=off+2;
                 bytes(off:off+1,p)   = typecast(obj.image_series_index(p)      ,'uint8'); off=off+2;

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