Skip to content

Commit

Permalink
On branch develop
Browse files Browse the repository at this point in the history
	modified:   getk.m
  • Loading branch information
Jon-Fredrik Nielsen committed Dec 15, 2023
1 parent c64d3f7 commit 3e4aaa1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions +toppe/+utils/getk.m
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
function [kxo, kxe] = getk(sysGE, readoutFile, nfid)
% Get kspace sample locations (assumes dwell = 4us)
function [kxo, kxe] = getk(sysGE, readoutFile, nfid, del)
% Get kspace sample locations from .mod file
%
% Inputs:
% sysGE
% sysGE see toppe.systemspecs()
% readoutFile .mod file name containing ADC window
% nfid number of acquired samples in ADC window
%
% Option:
% del offset by this many samples (default: 0)
%
% Outputs:
% kxo [1 nfid], odd echo k-space, cycles/cm
% kxe [1 nfid], even echo k-space, cycles/cm

if nargin < 4
del = 0.0;
end

[rf,gx,gy,gz,desc,paramsint16,paramsfloat,hdr] = toppe.readmod(readoutFile);
kx = sysGE.raster*1e-6*sysGE.gamma*1e-4*cumsum(gx); % cycles/cm
kx = kx - kx(end)/2;
kx = kx((hdr.npre+1):(hdr.npre+nfid));
del = -0.0;
kxo = interp1(1:nfid, kx, (1:nfid) - 0.5 - del, 'linear', 'extrap');
kxe = interp1(1:nfid, kx, (1:nfid) + 0.5 + del, 'linear', 'extrap');
kxe = fliplr(kxe);

0 comments on commit 3e4aaa1

Please sign in to comment.