From 46a68dd417f8de6b182209d52ea0be20aa080261 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Fri, 23 Feb 2024 13:09:49 +0000
Subject: [PATCH] Fix computing of qvec for last part of gradient waveform

---
 src/containers/building_blocks.jl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/containers/building_blocks.jl b/src/containers/building_blocks.jl
index 30cb02a..8ffddbb 100644
--- a/src/containers/building_blocks.jl
+++ b/src/containers/building_blocks.jl
@@ -169,6 +169,7 @@ function waveform_sequence(bb::BaseBuildingBlock, first, last)
     if !isnothing(last)
         error("Final index of $last not recognised.")
     end
+    push!(parts, (current_grad_key, isnothing(current_start) ? bb[current_grad_key] : split_gradient(bb[current_grad_key], current_start)[2]))
     return parts
 end
 
-- 
GitLab