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
c2c06fc8
Verified
Commit
c2c06fc8
authored
11 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Add sequence merging
parent
16bab2fe
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/MRIBuilder.jl
+2
-2
2 additions, 2 deletions
src/MRIBuilder.jl
src/post_hoc.jl
+25
-1
25 additions, 1 deletion
src/post_hoc.jl
with
27 additions
and
3 deletions
src/MRIBuilder.jl
+
2
−
2
View file @
c2c06fc8
...
...
@@ -37,8 +37,8 @@ export Pathway, duration_transverse, duration_dephase, bval, bmat, get_pathway
import
.
Parts
:
dwi_gradients
,
readout_event
,
excitation_pulse
,
refocus_pulse
,
Trapezoid
,
SliceSelect
,
LineReadout
,
opposite_kspace_lines
,
SpoiltSliceSelect
,
SliceSelectRephase
,
EPIReadout
,
interpret_image_size
export
dwi_gradients
,
readout_event
,
excitation_pulse
,
refocus_pulse
,
Trapezoid
,
SliceSelect
,
LineReadout
,
opposite_kspace_lines
,
SpoiltSliceSelect
,
SliceSelectRephase
,
EPIReadout
,
interpret_image_size
import
.
PostHoc
:
adjust
export
adjust
import
.
PostHoc
:
adjust
,
merge
export
adjust
,
merge
import
.
Sequences
:
GradientEcho
,
SpinEcho
,
DiffusionSpinEcho
,
DW_SE
,
DWI
export
GradientEcho
,
SpinEcho
,
DiffusionSpinEcho
,
DW_SE
,
DWI
...
...
This diff is collapsed.
Click to expand it.
src/post_hoc.jl
+
25
−
1
View file @
c2c06fc8
...
...
@@ -5,7 +5,7 @@ module PostHoc
import
..
Variables
:
AbstractBlock
,
adjust_internal
,
adjustable
import
..
Components
:
GradientWaveform
,
RFPulseComponent
,
BaseComponent
,
NoGradient
import
..
Containers
:
ContainerBlock
import
..
Containers
:
ContainerBlock
,
Sequence
,
Wait
"""
adjust(block; kwargs...)
...
...
@@ -68,4 +68,28 @@ adjust_helper(dict_variable::AbstractDict, used_names::Set{Symbol}; kwargs...) =
adjust_helper
(
tuple_variable
::
Tuple
,
used_names
::
Set
{
Symbol
};
kwargs
...
)
=
map
(
tuple_variable
)
do
v
adjust_helper
(
v
,
used_names
;
kwargs
...
)
end
adjust_helper
(
pair
::
Pair
,
used_names
::
Set
{
Symbol
};
kwargs
...
)
=
adjust_helper
(
pair
[
1
],
used_names
;
kwargs
...
)
=>
adjust_helper
(
pair
[
2
],
used_names
;
kwargs
...
)
"""
merge(sequences...; wait_time=0.)
Merge multiple sequences together.
Sequences will be run one after each other with `wait_time` in between.
"""
merge
(
sequences
::
Sequence
{
S
}
...
;
kwargs
...
)
where
{
S
}
=
merge_internal
(
sequences
...
;
name
=
S
,
kwargs
...
)
merge
(
sequences
::
Sequence
...
;
kwargs
...
)
=
merge_internal
(
sequences
...
;
kwargs
...
)
function
merge_internal
(
sequences
...
;
name
=:
Sequence
,
wait_time
=
0.
)
wb
=
Wait
(
wait_time
)
new_blocks
=
ContainerBlock
[]
for
seq
in
sequences
append!
(
new_blocks
,
map
(
b
->
b
[
2
],
seq
.
blocks
))
push!
(
new_blocks
,
wb
)
end
new_blocks
=
new_blocks
[
1
:
end
-
1
]
return
Sequence
(
new_blocks
;
scanner
=
sequences
[
1
]
.
scanner
,
name
=
name
)
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