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

Fix start time effect on block duration for gradients

parent 620cec76
No related branches found
No related tags found
No related merge requests found
Pipeline #23458 passed
...@@ -267,13 +267,13 @@ function build_sequence(; scanner=nothing, B0=3., TR=nothing, definitions, versi ...@@ -267,13 +267,13 @@ function build_sequence(; scanner=nothing, B0=3., TR=nothing, definitions, versi
times = grad_shape.times .* (num * gradient_raster) .+ start_time times = grad_shape.times .* (num * gradient_raster) .+ start_time
end end
push!(grad_shapes, (times, grad_shape.amplitudes .* (proc.amp * 1e-9))) push!(grad_shapes, (times, grad_shape.amplitudes .* (proc.amp * 1e-9)))
block_duration = max(proc.delay * 1e-3 + 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]
start_time = proc.delay * 1e-3 start_time = proc.delay * 1e-3
times = (cumsum([0, proc.rise, proc.flat, proc.fall]) .* 1e-3) .+ start_time times = (cumsum([0, proc.rise, proc.flat, proc.fall]) .* 1e-3) .+ start_time
push!(grad_shapes, (times, [0, proc.amp * 1e-9, proc.amp * 1e-9, 0])) push!(grad_shapes, (times, [0, proc.amp * 1e-9, proc.amp * 1e-9, 0]))
block_duration = max((proc.delay + proc.rise + proc.flat + proc.fall) * 1e-3, block_duration) block_duration = max((start_time + proc.rise + proc.flat + proc.fall) * 1e-3, block_duration)
else else
error("Gradient ID $grad_id not found in either of [GRADIENTS] or [TRAP] sections") error("Gradient ID $grad_id not found in either of [GRADIENTS] or [TRAP] sections")
end end
......
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