[ismrmrd] 110/281: improving classes in Matlab ISMRMRD package

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:03 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 e588f8739777acc5d5ccbe9d8092ad27e4756ce4
Author: Joseph Naegele <joseph.naegele at gmail.com>
Date:   Mon Mar 25 13:57:05 2013 -0400

    improving classes in Matlab ISMRMRD package
---
 matlab/+ismrmrd/AcquisitionHeader.m | 37 +++++++++++++++++++++++++++++++++---
 matlab/+ismrmrd/EncodingCounters.m  | 18 ++++++++++++++++++
 matlab/+ismrmrd/ImageHeader.m       | 38 ++++++++++++++++++++++++++++++++++---
 3 files changed, 87 insertions(+), 6 deletions(-)

diff --git a/matlab/+ismrmrd/AcquisitionHeader.m b/matlab/+ismrmrd/AcquisitionHeader.m
index 687561d..e54619b 100644
--- a/matlab/+ismrmrd/AcquisitionHeader.m
+++ b/matlab/+ismrmrd/AcquisitionHeader.m
@@ -6,7 +6,7 @@ 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. %
+        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 %
@@ -28,7 +28,38 @@ classdef AcquisitionHeader
     end
     
     methods
-        
+       
+        % Constructor
+        function obj = AcquisitionHeader(s)
+            if (nargin == 1)
+                obj.version = s.version;
+                obj.flags = s.flags;
+                obj.measurement_uid = s.measurement_uid;
+                obj.scan_counter = s.scan_counter;
+                obj.acquisition_time_stamp = s.acquisition_time_stamp;
+                obj.physiology_time_stamp = s.physiology_time_stamp;
+                obj.number_of_samples = s.number_of_samples;
+                obj.available_channels = s.available_channels;
+                obj.active_channels = s.active_channels;
+                obj.channel_mask = s.channel_mask;
+                obj.discard_pre = s.discard_pre;
+                obj.discard_post = s.discard_post;
+                obj.center_sample = s.center_sample;
+                obj.encoding_space_ref = s.encoding_space_ref;
+                obj.trajectory_dimensions = s.trajectory_dimensions;
+                obj.sample_time_us = s.sample_time_us;
+                obj.position = s.position;
+                obj.read_dir = s.read_dir;
+                obj.phase_dir = s.phase_dir;
+                obj_slice_dir = s.slice_dir;
+                obj.patient_table_position = s.patient_table_position;
+                obj.idx = ismrmrd.EncodingCounters(s.idx);
+                obj.user_int = s.user_int;
+                obj.user_float = s.user_float;
+          end
+      end
+
+        % Set methods 
         function obj = set.version(obj,v)
             obj.version = uint16(v);
         end
@@ -50,7 +81,7 @@ classdef AcquisitionHeader
         end
         
         function obj = set.physiology_time_stamp(obj,v)
-            if (length(v)~=3)
+            if (length(v)~=8)
                 error('AcquisitionHeader.physiology_time_stamp must have 3 elements')
             end
             obj.physiology_time_stamp = uint32(v);
diff --git a/matlab/+ismrmrd/EncodingCounters.m b/matlab/+ismrmrd/EncodingCounters.m
index aee7e07..c9e4873 100644
--- a/matlab/+ismrmrd/EncodingCounters.m
+++ b/matlab/+ismrmrd/EncodingCounters.m
@@ -14,6 +14,24 @@ classdef EncodingCounters
     end
     
     methods
+
+        % Constructor
+        function obj = EncodingCounters(s)
+            if (nargin == 1)
+                obj.kspace_encode_step_1 = s.kspace_encode_step_1;
+                obj.kspace_encode_step_2 = s.kspace_encode_step_2; 
+                obj.average = s.average;
+                obj.slice = s.slice;
+                obj.contrast = s.contrast;
+                obj.phase = s.phase;
+                obj.repetition = s.repetition;
+                obj.set = s.set;
+                obj.segment = s.segment;
+                obj.user = s.user;
+            end
+        end
+
+        % Set methods
         function obj = set.kspace_encode_step_1(obj,v)
             obj.kspace_encode_step_1 = uint16(v);
         end
diff --git a/matlab/+ismrmrd/ImageHeader.m b/matlab/+ismrmrd/ImageHeader.m
index 5f0ca10..16ffe38 100644
--- a/matlab/+ismrmrd/ImageHeader.m
+++ b/matlab/+ismrmrd/ImageHeader.m
@@ -2,7 +2,7 @@ classdef ImageHeader
 
     properties
         version = uint16(0);                          % First unsigned int indicates the version %
-        flag = uint64(0);                             % bit field with flags %
+        flags = uint64(0);                             % bit field with flags %
         measurement_uid = uint32(0);                  % Unique ID for the measurement %
         matrix_size = zeros(3,1,'uint16');            % Pixels in the 3 spatial dimensions
         field_of_view = zeros(3,1,'single');          % Size (in mm) of the 3 spatial dimensions %
@@ -30,12 +30,44 @@ classdef ImageHeader
     
     methods
         
+        % Constructor
+        function obj = ImageHeader(s)
+            if (nargin == 1)
+                obj.version = s.version;
+                obj.flags = s.flags;
+                obj.measurement_uid = s.measurement_uid;
+                obj.matrix_size = s.matrix_size;
+                obj.field_of_view = s.field_of_view;
+                obj.channels = s.channels;
+                obj.position = s.position;
+                obj.read_dir = s.read_dir;
+                obj.phase_dir = s.phase_dir;
+                obj_slice_dir = s.slice_dir;
+                obj.patient_table_position = s.patient_table_position;
+                obj.average = s.average;
+                obj.slice = s.slice;
+                obj.contrast = s.contrast;
+                obj.phase = s.phase;
+                obj.repetition = s.repetition;
+                obj.set = s.set;
+                obj.acquisition_time_stamp = s.acquisition_time_stamp;
+                obj.physiology_time_stamp = s.physiology_time_stamp;
+                obj.image_data_type = s.image_data_type;
+                obj.image_type = s.image_type;
+                obj.image_index = s.image_index;
+                obj.image_series_index = s.image_series_index;
+                obj.user_int = s.user_int;
+                obj.user_float = s.user_float;
+            end
+        end
+
+        % Set methods 
         function obj = set.version(obj,v)
             obj.version = uint16(v);
         end
 
-        function obj = set.flag(obj,v)
-            obj.flag = uint64(v);
+        function obj = set.flags(obj,v)
+            obj.flags = uint64(v);
         end
         
         function obj = set.measurement_uid(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