From 3ddd0789e26c295aa4ce3406aa8aefb6c0571e01 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Thu, 15 Feb 2024 15:44:30 +0000
Subject: [PATCH] Replace get_parts with waveform_sequence

---
 src/all_building_blocks/base_building_blocks.jl | 4 ++--
 src/pathways.jl                                 | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/all_building_blocks/base_building_blocks.jl b/src/all_building_blocks/base_building_blocks.jl
index c7194d2..15a6f66 100644
--- a/src/all_building_blocks/base_building_blocks.jl
+++ b/src/all_building_blocks/base_building_blocks.jl
@@ -150,7 +150,7 @@ function qvec(bb::BaseBuildingBlock, index1::Union{Nothing, Integer}, index2::Un
     if (index1 isa Number) && (index1 == index2)
         return zeros(3)
     end
-    sum(qvec.(get_parts(bb, index1, index2)); init=zero(SVector{3, Float64}))
+    sum(qvec.(waveform_sequence(bb, index1, index2)); init=zero(SVector{3, Float64}))
 end
 qvec(bb::BaseBuildingBlock) = qvec(bb, nothing, nothing)
 
@@ -162,7 +162,7 @@ function bmat_gradient(bb::BaseBuildingBlock, qstart, index1::Union{Nothing, Int
     result = Matrix{VariableType}(zeros(3, 3))
     qcurrent = Vector{VariableType}(qstart)
 
-    for part in get_parts(bb, index1, index2)
+    for part in waveform_sequence(bb, index1, index2)
         result = result .+ bmat_gradient(part, qcurrent)
         qcurrent = qcurrent .+ qvec(part, qcurrent)
     end
diff --git a/src/pathways.jl b/src/pathways.jl
index 4e75207..4d6afd6 100644
--- a/src/pathways.jl
+++ b/src/pathways.jl
@@ -3,7 +3,7 @@ import LinearAlgebra: norm, tr
 import StaticArrays: SVector, SMatrix
 import ..Components: NoGradient, RFPulseComponent, ReadoutComponent, InstantGradient, GradientWaveform
 import ..AllSequences: BaseSequence, Sequence
-import ..AllBuildingBlocks: BaseBuildingBlock, waveform, events, get_parts
+import ..AllBuildingBlocks: BaseBuildingBlock, waveform, events, waveform_sequence
 import ..Variables: qvec, qval, bmat_gradient, VariableType, effective_time, duration, qval_square, TR
 import ..ContainerBlocks: start_time
 import ..Alternatives: AlternativeBlocks
@@ -313,7 +313,7 @@ function walk_pathway!(block::BaseBuildingBlock, walker::PathwayWalker, pulse_ef
         end 
 
         # apply gradients up till interrupt
-        for part in get_parts(ao, current_index, index_inter)
+        for part in waveform_sequence(ao, current_index, index_inter)
             update_walker_gradient!(part, walker, current_time)
             current_time = current_time + duration(part)
         end 
@@ -330,7 +330,7 @@ function walk_pathway!(block::BaseBuildingBlock, walker::PathwayWalker, pulse_ef
     end
 
     # apply remaining gradients
-    for part in get_parts(ao, current_index, nothing)
+    for part in waveform_sequence(ao, current_index, nothing)
         update_walker_gradient!(part, walker, current_time)
         current_time = current_time + duration(part)
     end
-- 
GitLab