Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/v6 #4

Open
wants to merge 2 commits into
base: dev/v6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions +pulsegeq/rf2pulseq.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
function rfout = rf2pulseq(rf,geRasterTime,seq)
function rfout = rf2pulseq(rf,geRasterTime,seq,sys)
% function rfout = rf2pulseq(rf,geRasterTime,seq)
% convert rf units from Gauss to Hz, and interpolate to seq.rfRasterTime
%
% rf [n 1] RF waveform, Gauss
% geRasterTime [1] sec
% seq Pulseq object. Only seq.rfRasterTime is used.
gamma = 4.2576e3; % Hz/G

% Di Cui: adapting for MNS
if ~exist('sys','var')
gamma = 4.2576e3; % Hz/G
else
gamma = sys.gamma*1e-4;
end

rf = rf*gamma; % Hz
T = numel(rf)*geRasterTime; % pulse duration
tge = 0:geRasterTime:(T-geRasterTime);
@@ -14,4 +21,3 @@
%L = 10; cutoff = 0.9;
%rf = interp(rf,dt/rfRasterTime,L,cutoff); % upsample from 4us to 1us
return;