[ismrmrd] 167/177: Make sure that AcquisitionHeader blocks have the proper shape.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:15 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 39927764fbf2913ca600ea918f20eb6ee7499eca
Author: Souheil Inati <souheil.inati at nih.gov>
Date: Mon Nov 3 13:42:49 2014 -0500
Make sure that AcquisitionHeader blocks have the proper shape.
---
matlab/+ismrmrd/AcquisitionHeader.m | 134 ++++++++++++++++++------------------
1 file changed, 67 insertions(+), 67 deletions(-)
diff --git a/matlab/+ismrmrd/AcquisitionHeader.m b/matlab/+ismrmrd/AcquisitionHeader.m
index 4a68ef7..c672b11 100644
--- a/matlab/+ismrmrd/AcquisitionHeader.m
+++ b/matlab/+ismrmrd/AcquisitionHeader.m
@@ -209,78 +209,78 @@ classdef AcquisitionHeader < handle
Nstart = obj.getNumber + 1;
Nend = obj.getNumber + length(head.version);
Nrange = Nstart:Nend;
- obj.version(Nrange) = hdr.version;
- obj.flags(Nrange) = hdr.flags;
- obj.measurement_uid(Nrange) = hdr.measurement_uid;
- obj.scan_counter(Nrange) = hdr.scan_counter;
- obj.acquisition_time_stamp(Nrange) = hdr.acquisition_time_stamp;
- obj.physiology_time_stamp(:,Nrange) = hdr.physiology_time_stamp;
- obj.number_of_samples(Nrange) = hdr.number_of_samples;
- obj.available_channels(Nrange) = hdr.available_channels;
- obj.active_channels(Nrange) = hdr.active_channels;
- obj.channel_mask(:,Nrange) = hdr.channel_mask;
- obj.discard_pre(Nrange) = hdr.discard_pre;
- obj.discard_post(Nrange) = hdr.discard_post;
- obj.center_sample(Nrange) = hdr.center_sample;
- obj.encoding_space_ref(Nrange) = hdr.encoding_space_ref;
- obj.trajectory_dimensions(Nrange) = hdr.trajectory_dimensions;
- obj.sample_time_us(Nrange) = hdr.sample_time_us;
- obj.position(:,Nrange) = hdr.position;
- obj.read_dir(:,Nrange) = hdr.read_dir;
- obj.phase_dir(:,Nrange) = hdr.phase_dir;
- obj.slice_dir(:,Nrange) = hdr.slice_dir;
- obj.patient_table_position(:,Nrange) = hdr.patient_table_position;
- obj.idx.kspace_encode_step_1(Nrange) = hdr.idx.kspace_encode_step_1;
- obj.idx.kspace_encode_step_2(Nrange) = hdr.idx.kspace_encode_step_2;
- obj.idx.average(Nrange) = hdr.idx.average;
- obj.idx.slice(Nrange) = hdr.idx.slice;
- obj.idx.contrast(Nrange) = hdr.idx.contrast;
- obj.idx.phase(Nrange) = hdr.idx.phase;
- obj.idx.repetition(Nrange) = hdr.idx.repetition;
- obj.idx.set(Nrange) = hdr.idx.set;
- obj.idx.segment(Nrange) = hdr.idx.segment;
- obj.idx.user(:,Nrange) = hdr.idx.user;
- obj.user_int(:,Nrange) = hdr.user_int;
- obj.user_float(:,Nrange) = hdr.user_float;
+ obj.version(1,Nrange) = hdr.version(:);
+ obj.flags(1,Nrange) = hdr.flags(:);
+ obj.measurement_uid(1,Nrange) = hdr.measurement_uid(:);
+ obj.scan_counter(1,Nrange) = hdr.scan_counter(:);
+ obj.acquisition_time_stamp(1,Nrange) = hdr.acquisition_time_stamp(:);
+ obj.physiology_time_stamp(:,Nrange) = hdr.physiology_time_stamp(:);
+ obj.number_of_samples(1,Nrange) = hdr.number_of_samples(:);
+ obj.available_channels(1,Nrange) = hdr.available_channels(:);
+ obj.active_channels(1,Nrange) = hdr.active_channels(:);
+ obj.channel_mask(:,Nrange) = hdr.channel_mask(:);
+ obj.discard_pre(1,Nrange) = hdr.discard_pre(:);
+ obj.discard_post(1,Nrange) = hdr.discard_post(:);
+ obj.center_sample(1,Nrange) = hdr.center_sample(:);
+ obj.encoding_space_ref(1,Nrange) = hdr.encoding_space_ref(:);
+ obj.trajectory_dimensions(1,Nrange) = hdr.trajectory_dimensions(:);
+ obj.sample_time_us(1,Nrange) = hdr.sample_time_us(:);
+ obj.position(:,Nrange) = hdr.position(:);
+ obj.read_dir(:,Nrange) = hdr.read_dir(:);
+ obj.phase_dir(:,Nrange) = hdr.phase_dir(:);
+ obj.slice_dir(:,Nrange) = hdr.slice_dir(:);
+ obj.patient_table_position(:,Nrange) = hdr.patient_table_position(:);
+ obj.idx.kspace_encode_step_1(1,Nrange) = hdr.idx.kspace_encode_step_1(:);
+ obj.idx.kspace_encode_step_2(1,Nrange) = hdr.idx.kspace_encode_step_2(:);
+ obj.idx.average(1,Nrange) = hdr.idx.average(:);
+ obj.idx.slice(1,Nrange) = hdr.idx.slice(:);
+ obj.idx.contrast(1,Nrange) = hdr.idx.contrast(:);
+ obj.idx.phase(1,Nrange) = hdr.idx.phase(:);
+ obj.idx.repetition(1,Nrange) = hdr.idx.repetition(:);
+ obj.idx.set(1,Nrange) = hdr.idx.set(:);
+ obj.idx.segment(1,Nrange) = hdr.idx.segment(:);
+ obj.idx.user(:,Nrange) = hdr.idx.user(:);
+ obj.user_int(:,Nrange) = hdr.user_int(:);
+ obj.user_float(:,Nrange) = hdr.user_float(:);
end
function fromStruct(obj, hdr)
% Convert a struct to the object
-
+ N = length(hdr.version);
%warning! no error checking
- obj.version = hdr.version;
- obj.flags = hdr.flags;
- obj.measurement_uid = hdr.measurement_uid;
- obj.scan_counter = hdr.scan_counter;
- obj.acquisition_time_stamp = hdr.acquisition_time_stamp;
- obj.physiology_time_stamp = hdr.physiology_time_stamp;
- obj.number_of_samples = hdr.number_of_samples;
- obj.available_channels = hdr.available_channels;
- obj.active_channels = hdr.active_channels;
- obj.channel_mask = hdr.channel_mask;
- obj.discard_pre = hdr.discard_pre;
- obj.discard_post = hdr.discard_post;
- obj.center_sample = hdr.center_sample;
- obj.encoding_space_ref = hdr.encoding_space_ref;
- obj.trajectory_dimensions = hdr.trajectory_dimensions;
- obj.sample_time_us = hdr.sample_time_us;
- obj.position = hdr.position;
- obj.read_dir = hdr.read_dir;
- obj.phase_dir = hdr.phase_dir;
- obj.slice_dir = hdr.slice_dir;
- obj.patient_table_position = hdr.patient_table_position;
- obj.idx.kspace_encode_step_1 = hdr.idx.kspace_encode_step_1;
- obj.idx.kspace_encode_step_2 = hdr.idx.kspace_encode_step_2;
- obj.idx.average = hdr.idx.average;
- obj.idx.slice = hdr.idx.slice;
- obj.idx.contrast = hdr.idx.contrast;
- obj.idx.phase = hdr.idx.phase;
- obj.idx.repetition = hdr.idx.repetition;
- obj.idx.set = hdr.idx.set;
- obj.idx.segment = hdr.idx.segment;
- obj.idx.user = hdr.idx.user;
- obj.user_int = hdr.user_int;
- obj.user_float = hdr.user_float;
+ obj.version = reshape(hdr.version,[1,N]);
+ obj.flags = reshape(hdr.flags,[1,N]);
+ obj.measurement_uid = reshape(hdr.measurement_uid,[1,N]);
+ obj.scan_counter = reshape(hdr.scan_counter,[1,N]);
+ obj.acquisition_time_stamp = reshape(hdr.acquisition_time_stamp,[1,N]);
+ obj.physiology_time_stamp = reshape(hdr.physiology_time_stamp,[3,N]);
+ obj.number_of_samples = reshape(hdr.number_of_samples,[1,N]);
+ obj.available_channels = reshape(hdr.available_channels,[1,N]);
+ obj.active_channels = reshape(hdr.active_channels,[1,N]);
+ obj.channel_mask = reshape(hdr.channel_mask,[16,N]);
+ obj.discard_pre = reshape(hdr.discard_pre,[1,N]);
+ obj.discard_post = reshape(hdr.discard_post,[1,N]);
+ obj.center_sample = reshape(hdr.center_sample,[1,N]);
+ obj.encoding_space_ref = reshape(hdr.encoding_space_ref,[1,N]);
+ obj.trajectory_dimensions = reshape(hdr.trajectory_dimensions,[1,N]);
+ obj.sample_time_us = reshape(hdr.sample_time_us,[1,N]);
+ obj.position = reshape(hdr.position,[3,N]);
+ obj.read_dir = reshape(hdr.read_dir,[3,N]);
+ obj.phase_dir = reshape(hdr.phase_dir,[3,N]);
+ obj.slice_dir = reshape(hdr.slice_dir,[3,N]);
+ obj.patient_table_position = reshape(hdr.patient_table_position,[3,N]);
+ obj.idx.kspace_encode_step_1 = reshape(hdr.idx.kspace_encode_step_1,[1,N]);
+ obj.idx.kspace_encode_step_2 = reshape(hdr.idx.kspace_encode_step_2,[1,N]);
+ obj.idx.average = reshape(hdr.idx.average,[1,N]);
+ obj.idx.slice = reshape(hdr.idx.slice,[1,N]);
+ obj.idx.contrast = reshape(hdr.idx.contrast,[1,N]);
+ obj.idx.phase = reshape(hdr.idx.phase,[1,N]);
+ obj.idx.repetition = reshape(hdr.idx.repetition,[1,N]);
+ obj.idx.set = reshape(hdr.idx.set,[1,N]);
+ obj.idx.segment = reshape(hdr.idx.segment,[1,N]);
+ obj.idx.user = reshape(hdr.idx.user,[8,N]);
+ obj.user_int = reshape(hdr.user_int,[8,N]);
+ obj.user_float = reshape(hdr.user_float,[8,N]);
end
function hdr = toStruct(obj)
--
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