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
5bd67c0c
Verified
Commit
5bd67c0c
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Fix concretisation of PulsedGradient
parent
b3e8d687
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/concrete_blocks.jl
+19
-5
19 additions, 5 deletions
src/concrete_blocks.jl
src/gradients/pulsed_gradients.jl
+1
-1
1 addition, 1 deletion
src/gradients/pulsed_gradients.jl
with
20 additions
and
6 deletions
src/concrete_blocks.jl
+
19
−
5
View file @
5bd67c0c
module
ConcreteBlocks
import
JuMP
:
has_values
,
optimize!
import
JuMP
:
has_values
,
optimize!
,
value
import
..
BuildingBlocks
:
BuildingBlock
,
BuildingBlockPlaceholder
,
properties
,
duration
import
..
SequenceBuilders
:
SequenceBuilder
,
to_block
,
AbstractSequence
import
..
SequenceBuilders
:
SequenceBuilder
,
to_block
,
AbstractSequence
,
TR
,
get_blocks
abstract type
AbstractConcreteBlock
<:
BuildingBlock
end
...
...
@@ -40,7 +40,17 @@ function ConcreteGradient(arr::Vector)
)
end
function
ConcreteGradient
(
times
,
gradients
)
ConcreteGradient
(
times
,
[
g
[
1
]
for
g
in
gradients
],
[
g
[
2
]
for
g
in
gradients
],
[
g
[
3
]
for
g
in
gradients
],
)
end
ConcreteGradient
(
::
Nothing
)
=
nothing
ConcreteGradient
(
values
::
Tuple
{
<:
Vector
,
<:
Vector
})
=
ConcreteGradient
(
values
...
)
ConcreteGradient
(
values
::
Tuple
{
<:
Vector
,
<:
Vector
,
<:
Vector
,
<:
Vector
})
=
ConcreteGradient
(
values
...
)
...
...
@@ -55,12 +65,13 @@ struct ConcreteBlock <: AbstractConcreteBlock
pulse
::
Union
{
ConcreteRFPulse
,
Nothing
}
gradient
::
Union
{
ConcreteGradient
,
Nothing
}
readout_times
::
Vector
{
Float64
}
rotate_gradients
::
Bool
end
ConcreteBlock
(
args
...
;
kwargs
...
)
=
BuildingBlockPlaceholder
{
ConcreteBlock
}(
args
...
;
kwargs
...
)
function
ConcreteBlock
(
builder
::
AbstractSequence
,
duration
::
Number
;
pulse
=
nothing
,
gradient
=
nothing
,
readout_times
=
Number
[])
ConcreteBlock
(
builder
,
duration
,
ConcreteRFPulse
(
pulse
),
ConcreteGradient
(
gradient
),
Float64
.
(
readout_times
))
function
ConcreteBlock
(
builder
::
AbstractSequence
,
duration
::
Number
;
pulse
=
nothing
,
gradient
=
nothing
,
readout_times
=
Number
[]
,
rotate_gradients
=
false
)
ConcreteBlock
(
builder
,
duration
,
ConcreteRFPulse
(
pulse
),
ConcreteGradient
(
gradient
),
Float64
.
(
readout_times
)
,
rotate_gradients
)
end
...
...
@@ -112,11 +123,14 @@ struct Sequence <: AbstractSequence
TR
::
Number
end
TR
(
seq
::
Sequence
)
=
seq
.
TR
get_blocks
(
seq
::
Sequence
)
=
seq
.
blocks
function
Sequence
(
builder
::
SequenceBuilder
)
if
!
has_values
(
builder
)
optimize!
(
builder
.
model
)
end
seq
=
Sequence
(
AbstractConcreteBlock
[],
value
(
TR
))
seq
=
Sequence
(
AbstractConcreteBlock
[],
value
(
TR
(
builder
)
))
for
block
in
builder
.
blocks
push!
(
seq
.
blocks
,
ConcreteBlock
(
seq
,
block
))
end
...
...
This diff is collapsed.
Click to expand it.
src/gradients/pulsed_gradients.jl
+
1
−
1
View file @
5bd67c0c
...
...
@@ -132,7 +132,7 @@ function to_concrete_block(s::AbstractSequence, block::PulsedGradient)
t_start
=
value
(
start_time
(
block
))
t_rise
=
value
(
rise_time
(
block
))
t_d
=
value
(
δ
(
block
))
return
ConcreteBlock
(
s
,
t_start
+
t_d
+
t_rise
,
gradient
s
=
[
return
ConcreteBlock
(
s
,
t_start
+
t_d
+
t_rise
,
gradient
=
[
(
t_start
,
zeros
(
3
)),
(
t_start
+
t_rise
,
qvec
),
(
t_start
+
t_d
,
qvec
),
...
...
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