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

Detect if edges are valid

parent 94735364
No related branches found
No related tags found
No related merge requests found
......@@ -119,20 +119,27 @@ function waveform_sequence(bb::BaseBuildingBlock, first, last)
current_grad_key = key
current_start = nothing
end
if key == first
if key == first || key == Val(first)
@assert !started
started = true
current_start = effective_time(bb[key])
end
if key == last
if key == last || key == Val(last)
@assert started
if isnothing(current_start)
push!(parts, (current_grad_key, split_gradient(bb[current_grad_key], effective_time(bb[key]))[1]))
else
push!(parts, (current_grad_key, split_gradient(bb[current_grad_key], current_start, effective_time(bb[key]))[2]))
end
return parts
end
end
if !started
error("Starting index of $first not recognised.")
end
if !isnothing(last)
error("Final index of $last not recognised.")
end
return parts
end
......
......@@ -38,7 +38,7 @@ end
function SpoiltSliceSelect(pulse::RFPulseComponent; orientation=[0, 0, 1], group=nothing, spoiler_scale=nothing, slice_thickness=nothing, kwargs...)
model = global_model()
res = nothing
if isinf(slice_thickness)
if slice_thickness isa Number && isinf(slice_thickness)
rise_time_var = get_free_variable(nothing)
flat_time_var = get_free_variable(nothing)
res = SpoiltSliceSelect(
......@@ -70,9 +70,9 @@ function SpoiltSliceSelect(pulse::RFPulseComponent; orientation=[0, 0, 1], group
for time_var in (res.rise_time1, res.flat_time1, res.diff_time, res.flat_time2, res.fall_time2)
@constraint model time_var >= 0
end
@constraint model res.diff_time <= res.rise_time1
@constraint model res.diff_time <= res.fall_time2
@constraint model qval(res, nothing, 1) == qval(res, 1, nothing)
#@constraint model res.diff_time <= res.rise_time1
#@constraint model res.diff_time <= res.fall_time2
#@constraint model qval(res, nothing, 1) == qval(res, 1, nothing)
end
if !isnothing(spoiler_scale)
......
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