Skip to content

Commit

Permalink
Fix #88
Browse files Browse the repository at this point in the history
  • Loading branch information
beorostica committed Sep 12, 2022
1 parent 3184f8d commit 7e24c68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/datatypes/Sequence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,10 @@ get_kspace(seq::Sequence; Δt=1) = begin
kspace = γ * k #[m^-1]
#Interp, as Gradients are piece-wise linear, the integral is piece-wise quadratic
#Nevertheless, the integral is sampled at the ADC times so a linear interp is sufficient
ts = t .+ Δt
t_adc = get_sample_times(seq)
kx_adc = LinearInterpolation(ts,kspace[:,1])(t_adc)
ky_adc = LinearInterpolation(ts,kspace[:,2])(t_adc)
kz_adc = LinearInterpolation(ts,kspace[:,3])(t_adc)
kx_adc = LinearInterpolation(t,kspace[:,1],extrapolation_bc=0)(t_adc)
ky_adc = LinearInterpolation(t,kspace[:,2],extrapolation_bc=0)(t_adc)
kz_adc = LinearInterpolation(t,kspace[:,3],extrapolation_bc=0)(t_adc)
kspace_adc = [kx_adc ky_adc kz_adc]
#Final
kspace, kspace_adc
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/SimulatorCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function run_sim_time_iter(obj::Phantom,seq::Sequence, t::Array{Float64,1}, Δt;
end
#Output
t_interp = get_sample_times(seq)
S_interp = LinearInterpolation(t.+Δt,S,extrapolation_bc=0)(t_interp) .* get_sample_phase_compensation(seq)
S_interp = LinearInterpolation(t,S,extrapolation_bc=0)(t_interp) .* get_sample_phase_compensation(seq)
(S_interp, M0)
end

Expand Down

0 comments on commit 7e24c68

Please sign in to comment.