-
Notifications
You must be signed in to change notification settings - Fork 0
/
explore_ismrmrd_flags.m
60 lines (48 loc) · 1.45 KB
/
explore_ismrmrd_flags.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function [ output_args ] = explore_ismrmrd_flags( varargin )
%EXPLORE_ISMRMRD_FLAGS Show summary of ISMRMRD flags
%
% explore_ismrmrd_flags
% explore_ismrmrd_flags( filename )
%
% Requires ISMRMRD MATLAB files on path
%
% See also EXPLORE_H5
if nargin > 0
if exist(varargin{1},'file')
fn = varargin{1} ;
else
fn = pref_uigetfile('explore_ismrmrd_flags', 'filename') ;
end
else
fn = pref_uigetfile('explore_ismrmrd_flags', 'filename') ;
end
if exist(fn, 'file')
dset = ismrmrd.Dataset(fn, 'dataset');
else
return
end
D = dset.readAcquisition();
% This is how to check if a flag is set in the acquisition header
isNoise = D.head.flagIsSet('ACQ_IS_NOISE_MEASUREMENT');
ispci = D.head.flagIsSet('ACQ_IS_PARALLEL_CALIBRATION_AND_IMAGING') ;
ispc = D.head.flagIsSet('ACQ_IS_PARALLEL_CALIBRATION') ;
isfes1 = D.head.flagIsSet('ACQ_FIRST_IN_ENCODE_STEP1');
isfslc = D.head.flagIsSet('ACQ_FIRST_IN_SLICE') ;
isfrep = D.head.flagIsSet('ACQ_FIRST_IN_REPETITION') ;
hf = figure('Name','ISMRMRD flags');
set(hf,'DefaultAxesFontSize',14)
set(hf,'DefaultLineMarkerSize',14)
plot(isNoise*1.5,'ro','MarkerFaceColor',[1 0 0]), hold on
plot(ispci*2,'bx')
plot(ispc*3,'bo')
plot(isfes1,'mo')
plot(isfslc,'mx')
plot(isfrep,'kx')
plot(0,3.5)
plot(0,-0.25)
legend('noise','acs and im', 'acs','1st in enc step1', '1st in slce', '1st in rep')
xlabel('measurement number')
yticks([])
ylabel([])
end