Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ndcn0236/mribuilder.jl
1 result
Show changes
Commits on Source (1)
module ConstantPulses
import JuMP: @constraint
import ...AbstractTypes: RFPulseComponent, split_timestep
import ....Variables: VariableType, set_simple_constraints!, make_generic, get_free_variable, adjust_internal, variables, @defvar, apply_simple_constraint!
import ....Variables: VariableType, set_simple_constraints!, make_generic, get_free_variable, adjust_internal, variables, @defvar, apply_simple_constraint!, add_cost_function!
import ..GenericPulses: GenericPulse
"""
......@@ -34,6 +34,7 @@ function ConstantPulse(; amplitude=nothing, duration=nothing, phase=nothing, fre
)
apply_simple_constraint!(res.amplitude, :>=, 0)
set_simple_constraints!(res, kwargs)
add_cost_function!(res.frequency^2 + res.phase^2)
return res
end
......
......@@ -28,6 +28,7 @@ function InstantPulse(; flip_angle=nothing, phase=nothing, group=nothing)
group
)
apply_simple_constraint!(res.flip_angle, :>=, 0)
add_cost_function!(res.phase^2)
return res
end
......
......@@ -55,6 +55,7 @@ function SincPulse(;
apply_simple_constraint!(res.lobe_duration, :>=, 0)
end
set_simple_constraints!(res, kwargs)
add_cost_function!(res.frequency^2 + res.phase^2)
return res
end
......