[ismrmrd] 184/281: Can now properly append acquisitions.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:12 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 c8a9671eb201a005bd0b262e8400388eb6995109
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Fri Sep 6 13:54:07 2013 -0400

    Can now properly append acquisitions.
---
 matlab/+ismrmrd/AcquisitionHeader.m | 38 +++++++++++++++++++++++++++++++++++++
 matlab/+ismrmrd/IsmrmrdDataset.m    |  4 ++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/matlab/+ismrmrd/AcquisitionHeader.m b/matlab/+ismrmrd/AcquisitionHeader.m
index 09fddf8..e28d128 100644
--- a/matlab/+ismrmrd/AcquisitionHeader.m
+++ b/matlab/+ismrmrd/AcquisitionHeader.m
@@ -266,6 +266,44 @@ classdef AcquisitionHeader < handle
             obj.user_int = hdr.user_int;
             obj.user_float = hdr.user_float;            
         end
+
+        function hdr = toStruct(obj)
+            %warning! no error checking
+            hdr = struct();
+            hdr.version = obj.version;
+            hdr.flags = obj.flags;
+            hdr.measurement_uid = obj.measurement_uid;
+            hdr.scan_counter = obj.scan_counter;
+            hdr.acquisition_time_stamp = obj.acquisition_time_stamp;
+            hdr.physiology_time_stamp = obj.physiology_time_stamp;
+            hdr.number_of_samples = obj.number_of_samples;
+            hdr.available_channels = obj.available_channels;
+            hdr.active_channels = obj.active_channels;
+            hdr.channel_mask = obj.channel_mask;
+            hdr.discard_pre = obj.discard_pre;
+            hdr.discard_post = obj.discard_post;
+            hdr.center_sample = obj.center_sample;
+            hdr.encoding_space_ref = obj.encoding_space_ref;
+            hdr.trajectory_dimensions = obj.trajectory_dimensions;
+            hdr.sample_time_us = obj.sample_time_us;
+            hdr.position = obj.position;
+            hdr.read_dir = obj.read_dir;
+            hdr.phase_dir = obj.phase_dir;
+            hdr.slice_dir = obj.slice_dir;
+            hdr.patient_table_position = obj.patient_table_position;
+            hdr.idx.kspace_encode_step_1 = obj.idx.kspace_encode_step_1;
+            hdr.idx.kspace_encode_step_2 = obj.idx.kspace_encode_step_2;
+            hdr.idx.average = obj.idx.average;
+            hdr.idx.slice = obj.idx.slice;
+            hdr.idx.contrast = obj.idx.contrast;
+            hdr.idx.phase = obj.idx.phase;
+            hdr.idx.repetition = obj.idx.repetition;
+            hdr.idx.set = obj.idx.set;
+            hdr.idx.segment = obj.idx.segment;
+            hdr.idx.user = obj.idx.user;
+            hdr.user_int = obj.user_int;
+            hdr.user_float = obj.user_float;            
+        end
         
         function fromBytes(obj, bytearray)
 
diff --git a/matlab/+ismrmrd/IsmrmrdDataset.m b/matlab/+ismrmrd/IsmrmrdDataset.m
index c465621..d38fbae 100644
--- a/matlab/+ismrmrd/IsmrmrdDataset.m
+++ b/matlab/+ismrmrd/IsmrmrdDataset.m
@@ -217,7 +217,7 @@ classdef IsmrmrdDataset
             % TODO: Check the type of the input
             
             % The number of acquisitions that we are going to append
-            N = acq.getNumberOfAcquisitions();
+            N = acq.getNumber();
             
             % Check if the Data exists
             %   if it does not exist, create it
@@ -269,7 +269,7 @@ classdef IsmrmrdDataset
 
             % Pack the acquisition into the correct struct for writing
             d = struct();
-            d.head = acq.head;
+            d.head = acq.head.toStruct();
             d.traj = acq.traj;
             d.data = acq.dataToFloat();
             

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