Skip to content
Snippets Groups Projects
Verified Commit ba42455e authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Adjust gradient reading for new shape interface

parent db4fb2bc
No related branches found
No related tags found
No related merge requests found
...@@ -234,7 +234,6 @@ function build_sequence(; scanner=nothing, B0=3., TR=nothing, definitions, versi ...@@ -234,7 +234,6 @@ function build_sequence(; scanner=nothing, B0=3., TR=nothing, definitions, versi
phase_size = rad2deg.(phase_shape) .+ phase_times .* (proc.freq * 1e-3 * 360) .+ rad2deg(proc.phase) phase_size = rad2deg.(phase_shape) .+ phase_times .* (proc.freq * 1e-3 * 360) .+ rad2deg(proc.phase)
end end
if version != v"1.3.1" && !iszero(proc.time_id) if version != v"1.3.1" && !iszero(proc.time_id)
@show shapes
(num, _, time_shape) = shapes[proc.time_id] (num, _, time_shape) = shapes[proc.time_id]
times = time_shape .* rf_raster times = time_shape .* rf_raster
ampl = ampl_size ampl = ampl_size
...@@ -260,15 +259,16 @@ function build_sequence(; scanner=nothing, B0=3., TR=nothing, definitions, versi ...@@ -260,15 +259,16 @@ function build_sequence(; scanner=nothing, B0=3., TR=nothing, definitions, versi
if !isnothing(gradients) && grad_id in keys(gradients) if !isnothing(gradients) && grad_id in keys(gradients)
proc = gradients[grad_id] proc = gradients[grad_id]
start_time = proc.delay * 1e-3 start_time = proc.delay * 1e-3
(num, grad_shape) = shapes[proc.shape_id] (num, grad_time, grad_shape) = shapes[proc.shape_id]
if version != v"1.3.1" && !iszero(proc.time_id) if version != v"1.3.1" && !iszero(proc.time_id)
(num, time_shape) = shapes[proc.time_id] (num, _, time_shape) = shapes[proc.time_id]
times = time_shape.amplitudes .* gradient_raster .+ start_time times = time_shape .* gradient_raster .+ start_time
@assert length(times) == length(grad_shape)
else else
times = grad_shape.times .* (num * gradient_raster) .+ start_time times = grad_time .* (num * gradient_raster) .+ start_time
end end
push!(grad_shapes, (times, grad_shape.amplitudes .* (proc.amp * 1e-9))) push!(grad_shapes, (times, grad_shape .* (proc.amp * 1e-9)))
block_duration = max(start_time + num * gradient_raster, block_duration) block_duration = max(start_time + num * gradient_raster, block_duration)
elseif !isnothing(trap) && grad_id in keys(trap) elseif !isnothing(trap) && grad_id in keys(trap)
proc = trap[grad_id] proc = trap[grad_id]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment