Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MRIBuilder.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
MRIBuilder.jl
Commits
ccc52e8b
Verified
Commit
ccc52e8b
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Add concrete versions of instantaneous gradients/pulses
parent
c17b68c0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gradients/instant_gradients.jl
+15
-4
15 additions, 4 deletions
src/gradients/instant_gradients.jl
src/pulses/instant_pulses.jl
+17
-5
17 additions, 5 deletions
src/pulses/instant_pulses.jl
with
32 additions
and
9 deletions
src/gradients/instant_gradients.jl
+
15
−
4
View file @
ccc52e8b
...
@@ -2,7 +2,7 @@ module InstantGradients
...
@@ -2,7 +2,7 @@ module InstantGradients
import
JuMP
:
@constraint
,
@variable
,
VariableRef
import
JuMP
:
@constraint
,
@variable
,
VariableRef
import
...
BuildingBlocks
:
BuildingBlock
,
properties
,
BuildingBlockPlaceholder
,
set_simple_constraints!
,
duration
import
...
BuildingBlocks
:
BuildingBlock
,
properties
,
BuildingBlockPlaceholder
,
set_simple_constraints!
,
duration
import
...
SequenceBuilders
:
SequenceBuilder
,
owner_model
,
start_time
import
...
SequenceBuilders
:
SequenceBuilder
,
owner_model
,
start_time
import
...
ConcreteBlocks
:
to_concrete_block
import
...
ConcreteBlocks
:
to_concrete_block
,
AbstractConcreteBlock
import
..
IntegrateGradients
:
qval
,
bval
import
..
IntegrateGradients
:
qval
,
bval
"""
"""
...
@@ -21,7 +21,7 @@ This is a [`BuildingBlock`](@ref) for the [`SequenceBuilder`](@ref).
...
@@ -21,7 +21,7 @@ This is a [`BuildingBlock`](@ref) for the [`SequenceBuilder`](@ref).
struct
InstantGradientBlock
<:
BuildingBlock
struct
InstantGradientBlock
<:
BuildingBlock
builder
::
SequenceBuilder
builder
::
SequenceBuilder
orientation
::
Any
orientation
::
Any
qval
::
Union
{
VariableRef
,
Number
}
qval
::
VariableRef
end
end
InstantGradientBlock
(;
kwargs
...
)
=
BuildingBlockPlaceholder
{
InstantGradientBlock
}(;
kwargs
...
)
InstantGradientBlock
(;
kwargs
...
)
=
BuildingBlockPlaceholder
{
InstantGradientBlock
}(;
kwargs
...
)
...
@@ -43,9 +43,20 @@ bval(instant::InstantGradientBlock) = 0.
...
@@ -43,9 +43,20 @@ bval(instant::InstantGradientBlock) = 0.
duration
(
instant
::
InstantGradientBlock
)
=
0.
duration
(
instant
::
InstantGradientBlock
)
=
0.
properties
(
::
Type
{
<:
InstantGradientBlock
})
=
[
qval
]
properties
(
::
Type
{
<:
InstantGradientBlock
})
=
[
qval
]
"""
ConcreteInstantGradient(orientation, qval)
Instantaneous MR gradient with no free variables.
See [`InstantGradientBlock`](@ref) for a version where [`qval`](@ref) is variable.
"""
struct
ConcreteInstantGradient
<:
AbstractConcreteBlock
orientation
::
Any
qval
::
Number
end
function
to_concrete_block
(
builder
::
SequenceBuilder
,
block
::
InstantGradientBlock
)
function
to_concrete_block
(
block
::
InstantGradientBlock
)
InstantGradientBlock
(
builder
,
block
.
orientation
,
value
(
qval
(
block
)))
return
ConcreteInstantGradient
(
block
.
orientation
,
value
(
qval
(
block
)))
end
end
...
...
This diff is collapsed.
Click to expand it.
src/pulses/instant_pulses.jl
+
17
−
5
View file @
ccc52e8b
...
@@ -2,13 +2,13 @@ module InstantPulses
...
@@ -2,13 +2,13 @@ module InstantPulses
import
JuMP
:
@constraint
,
@variable
,
VariableRef
,
value
import
JuMP
:
@constraint
,
@variable
,
VariableRef
,
value
import
...
BuildingBlocks
:
BuildingBlock
,
properties
,
BuildingBlockPlaceholder
,
set_simple_constraints!
,
duration
import
...
BuildingBlocks
:
BuildingBlock
,
properties
,
BuildingBlockPlaceholder
,
set_simple_constraints!
,
duration
import
...
SequenceBuilders
:
SequenceBuilder
,
owner_model
,
start_time
import
...
SequenceBuilders
:
SequenceBuilder
,
owner_model
,
start_time
import
...
ConcreteBlocks
:
to_concrete_block
import
...
ConcreteBlocks
:
to_concrete_block
,
AbstractConcreteBlock
import
..
Properties
:
flip_angle
,
phase
import
..
Properties
:
flip_angle
,
phase
struct
InstantRFPulseBlock
<:
BuildingBlock
struct
InstantRFPulseBlock
<:
BuildingBlock
builder
::
SequenceBuilder
builder
::
SequenceBuilder
flip_angle
::
Union
{
VariableRef
,
Number
}
flip_angle
::
VariableRef
phase
::
Union
{
VariableRef
,
Number
}
phase
::
VariableRef
end
end
InstantRFPulseBlock
(;
kwargs
...
)
=
BuildingBlockPlaceholder
{
InstantRFPulseBlock
}(;
kwargs
...
)
InstantRFPulseBlock
(;
kwargs
...
)
=
BuildingBlockPlaceholder
{
InstantRFPulseBlock
}(;
kwargs
...
)
...
@@ -30,8 +30,20 @@ duration(instant::InstantRFPulseBlock) = 0.
...
@@ -30,8 +30,20 @@ duration(instant::InstantRFPulseBlock) = 0.
properties
(
::
Type
{
<:
InstantRFPulseBlock
})
=
[
flip_angle
,
phase
]
properties
(
::
Type
{
<:
InstantRFPulseBlock
})
=
[
flip_angle
,
phase
]
function
to_concrete_block
(
builder
::
SequenceBuilder
,
block
::
InstantRFPulseBlock
)
"""
return
InstantRFPulseBlock
(
builder
,
value
(
flip_angle
(
block
)),
value
(
phase
(
block
)))
ConcreteInstantRFPulse(flip_angle, phase)
Instantaneous RF pulse with no free variables.
See [`InstantRFPulseBlock`](@ref) for a version where [`flip_angle`](@ref) and [`phase`](@ref) are variables.
"""
struct
ConcreteInstantRFPulse
<:
AbstractConcreteBlock
flip_angle
::
Number
phase
::
Number
end
function
to_concrete_block
(
block
::
InstantRFPulseBlock
)
return
ConcreteInstantRFPulse
(
value
(
flip_angle
(
block
)),
value
(
phase
(
block
)))
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment