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
9ff2b61a
Unverified
Commit
9ff2b61a
authored
8 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Add slice selection to SpoiltSliceSelect
parent
3ea78d24
No related branches found
No related tags found
1 merge request
!5
Resolve "Allow slice selection"
Pipeline
#25011
failed
8 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/parts/spoilt_slice_selects.jl
+4
-4
4 additions, 4 deletions
src/parts/spoilt_slice_selects.jl
test/test_post_hoc.jl
+10
-0
10 additions, 0 deletions
test/test_post_hoc.jl
with
14 additions
and
4 deletions
src/parts/spoilt_slice_selects.jl
+
4
−
4
View file @
9ff2b61a
...
@@ -4,7 +4,7 @@ import LinearAlgebra: norm
...
@@ -4,7 +4,7 @@ import LinearAlgebra: norm
import
StaticArrays
:
SVector
import
StaticArrays
:
SVector
import
JuMP
:
@constraint
,
@objective
,
objective_function
import
JuMP
:
@constraint
,
@objective
,
objective_function
import
...
BuildSequences
:
global_scanner
import
...
BuildSequences
:
global_scanner
import
...
Variables
:
VariableType
,
get_pulse
,
set_simple_constraints!
,
variables
,
@defvar
,
gradient_orientation
,
adjust_groups
,
adjust_internal
,
get_free_variable
,
apply_simple_constraint!
import
...
Variables
:
VariableType
,
get_pulse
,
set_simple_constraints!
,
variables
,
@defvar
,
gradient_orientation
,
adjust
,
adjust_groups
,
adjust_internal
,
get_free_variable
,
apply_simple_constraint!
import
...
Components
:
ChangingGradient
,
ConstantGradient
,
RFPulseComponent
import
...
Components
:
ChangingGradient
,
ConstantGradient
,
RFPulseComponent
import
...
Containers
:
BaseBuildingBlock
import
...
Containers
:
BaseBuildingBlock
...
@@ -139,17 +139,17 @@ Returns the time of the [`SpoiltSliceSelect`](@ref) to return to zero.
...
@@ -139,17 +139,17 @@ Returns the time of the [`SpoiltSliceSelect`](@ref) to return to zero.
"""
"""
variables
.
fall_time
variables
.
fall_time
adjust_groups
(
::
SpoiltSliceSelect
)
=
[
ss
.
group
,
:
slice
]
adjust_groups
(
ss
::
SpoiltSliceSelect
)
=
[
ss
.
group
,
:
slice
]
function
adjust_internal
(
ss
::
SpoiltSliceSelect
;
shift
=
0.
)
function
adjust_internal
(
ss
::
SpoiltSliceSelect
;
shift
=
0.
)
return
SliceSelect
(
return
Spoilt
SliceSelect
(
ss
.
orientation
,
ss
.
orientation
,
ss
.
rise_time1
,
ss
.
rise_time1
,
ss
.
flat_time1
,
ss
.
flat_time1
,
ss
.
diff_time
,
ss
.
diff_time
,
adjust
(
adjust
(
ss
.
pulse
;
ss
.
pulse
;
frequency
=
variables
.
all_gradient_strengths
(
ss
)[
2
]
*
shift
*
1e3
pulse
=
(
frequency
=
variables
.
all_gradient_strengths
(
ss
)[
2
]
*
shift
*
1e3
,
)
),
),
ss
.
flat_time2
,
ss
.
flat_time2
,
ss
.
fall_time2
,
ss
.
fall_time2
,
...
...
This diff is collapsed.
Click to expand it.
test/test_post_hoc.jl
+
10
−
0
View file @
9ff2b61a
...
@@ -53,5 +53,15 @@
...
@@ -53,5 +53,15 @@
@test
all
(
variables
.
qvec
(
new_dwi
[
:
gradient
])
.
≈
[
qval_orig
/
√2
,
qval_orig
/
√2
,
0.
])
@test
all
(
variables
.
qvec
(
new_dwi
[
:
gradient
])
.
≈
[
qval_orig
/
√2
,
qval_orig
/
√2
,
0.
])
end
end
end
end
@testset
"Slice selection"
begin
dwi
=
DWI
(
bval
=
1.
,
slice_thickness
=
2.
,
refocus
=
(
spoiler
=
0.5
,
))
@test
variables
.
frequency
(
dwi
)
==
(
excitation
=
0.
,
refocus
=
0.
)
new_dwi
=
adjust
(
dwi
,
slice
=
(
shift
=
2.
,
))
@test
variables
.
frequency
(
new_dwi
)
.
excitation
≈
variables
.
bandwidth
(
dwi
)
.
excitation
@test
variables
.
frequency
(
new_dwi
)
.
refocus
≈
variables
.
bandwidth
(
dwi
)
.
refocus
another_dwi
=
adjust
(
new_dwi
,
slice
=
(
shift
=-
3.
,
))
@test
variables
.
frequency
(
another_dwi
)
.
excitation
≈
-
variables
.
bandwidth
(
dwi
)
.
excitation
*
0.5
@test
variables
.
frequency
(
another_dwi
)
.
refocus
≈
-
variables
.
bandwidth
(
dwi
)
.
refocus
*
0.5
end
end
end
end
end
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