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 module ConstantPulses
import JuMP: @constraint import JuMP: @constraint
import ...AbstractTypes: RFPulseComponent, split_timestep 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 import ..GenericPulses: GenericPulse
""" """
...@@ -34,6 +34,7 @@ function ConstantPulse(; amplitude=nothing, duration=nothing, phase=nothing, fre ...@@ -34,6 +34,7 @@ function ConstantPulse(; amplitude=nothing, duration=nothing, phase=nothing, fre
) )
apply_simple_constraint!(res.amplitude, :>=, 0) apply_simple_constraint!(res.amplitude, :>=, 0)
set_simple_constraints!(res, kwargs) set_simple_constraints!(res, kwargs)
add_cost_function!(res.frequency^2 + res.phase^2)
return res return res
end end
......
...@@ -28,6 +28,7 @@ function InstantPulse(; flip_angle=nothing, phase=nothing, group=nothing) ...@@ -28,6 +28,7 @@ function InstantPulse(; flip_angle=nothing, phase=nothing, group=nothing)
group group
) )
apply_simple_constraint!(res.flip_angle, :>=, 0) apply_simple_constraint!(res.flip_angle, :>=, 0)
add_cost_function!(res.phase^2)
return res return res
end end
......
...@@ -55,6 +55,7 @@ function SincPulse(; ...@@ -55,6 +55,7 @@ function SincPulse(;
apply_simple_constraint!(res.lobe_duration, :>=, 0) apply_simple_constraint!(res.lobe_duration, :>=, 0)
end end
set_simple_constraints!(res, kwargs) set_simple_constraints!(res, kwargs)
add_cost_function!(res.frequency^2 + res.phase^2)
return res return res
end end
......