diff --git a/+toppe/+utils/+rf/makeslr.m b/+toppe/+utils/+rf/makeslr.m index 1523129..486ca06 100644 --- a/+toppe/+utils/+rf/makeslr.m +++ b/+toppe/+utils/+rf/makeslr.m @@ -281,12 +281,9 @@ rf = [rf(:); zeros(mod(length(rf),2),1)]; npix = length(rf); -% find center (peak) of RF pulse. Smooth pulse first to reduce risk of picking an outlier -I = find(rf==max(rf)); % approximate peak -I = I(1); % in case length(I) > 1 -s = rf((I-20):(I+19)); -s = smooth(s); -iref = find(s==max(s)) + I - 20; +% find center (peak) of RF pulse +I = find(abs(rf) > max(abs(rf(:)))-eps); +iref= round(mean(I)); %% make slice-select gradient waveform bw = tbw / dur; % kHz @@ -314,7 +311,7 @@ % slice-select rephaser gradient switch type case {'ex', 'st', 'sat'} - arearep = sum(gss_trap((iref):end)) * dt * 1e-3; % G/cm*s + arearep = (gss_trap(iref)/2+sum(gss_trap((iref+1):end))) * dt * 1e-3; % G/cm*s gzrep = -trapwave2(arearep, mxg, spoilDerate*mxs, dt); case 'se' gzrep = []; diff --git a/+toppe/+utils/+rf/slicesim.m b/+toppe/+utils/+rf/slicesim.m index 77714ec..0d2cc28 100644 --- a/+toppe/+utils/+rf/slicesim.m +++ b/+toppe/+utils/+rf/slicesim.m @@ -46,7 +46,7 @@ nstep = length(rf); for ii = 1:length(Z) - Beff = [real(rf)*1e-4 imag(rf)*1e-4 Bz(:,ii)]; % [nstep 3], Tesla + Beff = [real(rf)*1e-4 -imag(rf)*1e-4 Bz(:,ii)]; % [nstep 3], Tesla mtmp = toppe.utils.rf.blochsim(m0, Beff, T1, T2, dt, nstep); m(ii) = mtmp(end,1) + 1i*mtmp(end,2); end diff --git a/+toppe/+utils/loadpfile.m b/+toppe/+utils/loadpfile.m index 9727a24..29e19be 100644 --- a/+toppe/+utils/loadpfile.m +++ b/+toppe/+utils/loadpfile.m @@ -12,6 +12,9 @@ % Kwarg input options: % acqOrder true/false If true, data is sorted in the order of acquisition. (default: false) % +% To load data in order it was acquired, do: +% d = toppe.utils.loadpfile(pfile, [], [], [], 'acqOrder', true); +% % Output dimensions of dat: % [nFID, nc, nDabSlice, 1, maxView]