Skip to content
Snippets Groups Projects
Unverified Commit 7e18e7c6 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Fix adding events at edge of BuildingBlock

parent 92cd24c0
No related branches found
No related tags found
1 merge request!3Add InstantPulse and InstantGradient pulseq extension support
......@@ -328,12 +328,21 @@ function BuildingBlock(waveform::AbstractVector, events::AbstractVector; orienta
else
push!(components, ChangingGradient(prev_grad, (grad .- prev_grad) ./ duration, orientation, duration, group))
end
if prev_time == time
continue
end
for (t_event, event) in events
if prev_time <= t_event < time
push!(components, (t_event - prev_time, event))
end
end
end
for (t_event, event) in events
if t_event == waveform[end][1]
push!(components, (t_event - waveform[end-1][1], event))
end
end
return BuildingBlock(components)
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