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

Replace get_parts with waveform_sequence

parent 770fb545
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
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