Skip to content

Commit

Permalink
Merge pull request #1 from LarsonLab/HP_toolbox_edits
Browse files Browse the repository at this point in the history
  • Loading branch information
agentmess authored Jan 18, 2018
2 parents 66cdbfb + 51a48a0 commit 7f4b9a3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
12 changes: 8 additions & 4 deletions create_freq_specs.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
function [fspec, a_angs, d] = create_freq_specs(mets)
function [fspec, a_angs, d] = create_freq_specs(mets, fmid)
% CREATE_FREQ_SPECS - Helper function for creating spectral-spatial
% frequency specifications
%
% [fspec, a_angs, d] = create_freq_specs(mets);
% [fspec, a_angs, d] = create_freq_specs(mets, fmid);
%
% INPUT
% mets - structure containing:
% mets(i).f - center frequency of bands (Hz)
% mets(i).df - bandwidth of bands (Hz)
% mets(i).ang - flip angle of bands (degress)
% mets(i).d - ripple of bands (Mxy, default = .01)
% fmid [optional] - center frequency spec around fmid
%
% OUTPUT
% spec, a_angs, d - inputs for ss_design()
Expand Down Expand Up @@ -41,6 +42,9 @@
end
end

% by default, center frequency specification
fmid = (mets(1).f+mets(end).f)/2;
if nargin < 2 || isempty(fmid)
% by default, center frequency specification
fmid = (min(fspec)+max(fspec))/2;
end

fspec = fspec - fmid;
46 changes: 46 additions & 0 deletions examples/demo_C13_singleband.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,49 @@
ss_design(z_thk, z_tb, [z_d1 z_d2], fspec, a_angs, d, ptype, ...
z_ftype, s_ftype, ss_type, fctr);
set(gcf,'Name', '[1-13C]lac only for 14T animal system');

fprintf(1,'Hit any key to continue:\n');
pause;


%% lactate-only pulse
fprintf(1, '\nFor studies including copolarized 13C-urea or a 13C-urea phantom\n');
fprintf(1, 'Here''s a C13 single-band excitation pulse to excite only [1-13C]lactate\n');
fprintf(1, 'while not exciting pyruvate, alanine and pyruvate-hydrate AND urea, for a 3T clinical system\n\n');

clear all; ss_opt([]); ss_globals; % Reset all options

% GENERAL PULSE PARAMETERS
ss_type = 'EP Whole';
ptype = 'ex'; % excitation pulse
opt = ss_opt({'Nucleus', 'Carbon', ...
'Max Duration', 25e-3, ...
'Spect Correct', 1});

% SPECTRAL PULSE PARAMETERS - large pass/stop bands chosen for wide
% supression regions
B0 = 3e4; % G
df = 0.5e-6 * B0 * SS_GAMMA; % 0.5 ppm = gamma_C13 * B0 * 0.5e-6
% metabolite frequency (Hz) freq bandwidth (Hz) flip angle (deg)
mets(1).name = 'urea'; mets(1).f = -470; mets(1).df = 2*df; mets(1).ang = 0;
mets(2).name = 'pyr'; mets(2).f = -230; mets(2).df = 2*df; mets(2).ang = 0;
mets(3).name = 'ala'; mets(3).f = -45; mets(3).df = 3*df; mets(3).ang = 0;
mets(4).name = 'pyrh'; mets(4).f = 40; mets(4).df = 2*df; mets(4).ang = 0;
mets(5).name = 'lac'; mets(5).f = 165; mets(5).df = 2*df; mets(5).ang = 90;

% create vectors of angles, ripples, and band edges for input to pulse design
[fspec, a_angs, d] = create_freq_specs(mets);
fctr = 0; % force pulse design to optimize for center of frequency specification
s_ftype = 'min'; % minimum-phase spectral filter

% SPATIAL PULSE PARAMETERS
z_thk = 1; % thickness (cm)
z_tb = 4; % time-bandwidth, proportional to profile sharpness
z_ftype='ls'; % least-squares filter design
z_d1 = 0.01; z_d2 = 0.01; % slice profile pass and stop-band ripples, respectively

% DESIGN THE PULSE!
[g,rf,fs,z,f,mxy] = ...
ss_design(z_thk, z_tb, [z_d1 z_d2], fspec, a_angs, d, ptype, ...
z_ftype, s_ftype, ss_type, fctr);
set(gcf,'Name', '[1-13C]lac only for 3T clinical system, avoiding urea');
2 changes: 1 addition & 1 deletion ss_plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
subplot(4,nplot,3*nplot + idx);
m_f = calc_mag(rf_rot,gz_rot+i*gf_rot, z, fplot(idx),ptype);
plot_mag(z,m_f,ptype);
title(sprintf('Spatial Profile - Freq = %5.1f', fplot(idx)));
title(sprintf('%5.1f', fplot(idx)));
xlabel('Position [cm]');
end;

Expand Down

0 comments on commit 7f4b9a3

Please sign in to comment.