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

Fix sequences for which no pathway is defined

parent bb2552b6
No related branches found
No related tags found
No related merge requests found
Pipeline #23166 failed
......@@ -3,7 +3,7 @@ import LinearAlgebra: norm, tr
import StaticArrays: SVector, SMatrix
import ..Components: NoGradient, RFPulseComponent, ReadoutComponent, InstantGradient, GradientWaveform, DelayedEvent
import ..Containers: BaseSequence, Sequence, BaseBuildingBlock, waveform, events, waveform_sequence, start_time, AlternativeBlocks
import ..Variables: qvec, qval, qval3, bmat_gradient, VariableType, effective_time, duration, TR, bmat, bval, area_under_curve, duration_dephase, duration_transverse
import ..Variables: qvec, qval, qval3, bmat_gradient, VariableType, effective_time, duration, TR, bmat, bval, area_under_curve, duration_dephase, duration_transverse, VariableNotAvailable
"""
......@@ -170,7 +170,14 @@ function get_pathway end
for fn in (:qvec, :area_under_curve, :bmat, :bval, :duration_dephase, :duration_transverse)
@eval function $fn(seq::Sequence)
pathway = get_pathway(seq)
pathway = try
get_pathway(seq)
catch e
if e isa MethodError
throw(VariableNotAvailable(typeof(seq), $fn))
end
rethrow()
end
if pathway isa Pathway
return $fn(pathway)
elseif pathway isa AbstractVector || pathway isa Tuple
......
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