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
6e6f3056
Unverified
Commit
6e6f3056
authored
7 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Update tests for additional wait block after readout
parent
a22f6ea1
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Resolve "Add secondary objective function"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_sequences.jl
+12
-12
12 additions, 12 deletions
test/test_sequences.jl
with
12 additions
and
12 deletions
test/test_sequences.jl
+
12
−
12
View file @
6e6f3056
@testset
"test_sequences.jl"
begin
@testset
"test_sequences.jl"
begin
@testset
"GradientEcho"
begin
@testset
"GradientEcho"
begin
seq
=
GradientEcho
(
TE
=
40
)
seq
=
GradientEcho
(
TE
=
40
)
@test
length
(
seq
)
==
3
@test
length
(
seq
)
==
4
@test
variables
.
duration
(
seq
)
==
40
@test
variables
.
duration
(
seq
)
==
40
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
40.
,
0.
],
atol
=
1e-6
))
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
40.
,
0.
,
0.
],
atol
=
1e-6
))
@test
length
(
collect
(
iter_instant_pulses
(
seq
)))
==
1
@test
length
(
collect
(
iter_instant_pulses
(
seq
)))
==
1
@test
length
(
collect
(
iter_instant_gradients
(
seq
)))
==
0.
@test
length
(
collect
(
iter_instant_gradients
(
seq
)))
==
0.
@test
variables
.
duration_dephase
(
seq
)
≈
40.
@test
variables
.
duration_dephase
(
seq
)
≈
40.
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
end
end
@testset
"SpinEcho"
begin
@testset
"SpinEcho"
begin
seq
=
SpinEcho
(
TE
=
40
)
seq
=
SpinEcho
(
TE
=
40
)
@test
length
(
seq
)
==
5
@test
length
(
seq
)
==
6
@test
variables
.
duration
(
seq
)
==
40
@test
variables
.
duration
(
seq
)
==
40
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
20.
,
0.
,
20.
,
0.
],
atol
=
1e-6
))
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
20.
,
0.
,
20.
,
0.
,
0.
],
atol
=
1e-6
))
@test
length
(
collect
(
iter_instant_pulses
(
seq
)))
==
2
@test
length
(
collect
(
iter_instant_pulses
(
seq
)))
==
2
@test
length
(
collect
(
iter_instant_gradients
(
seq
)))
==
0.
@test
length
(
collect
(
iter_instant_gradients
(
seq
)))
==
0.
@test
variables
.
duration_dephase
(
seq
)
≈
0.
atol
=
1e-4
@test
variables
.
duration_dephase
(
seq
)
≈
0.
atol
=
1e-4
...
@@ -25,9 +25,9 @@
...
@@ -25,9 +25,9 @@
@testset
"Instant pulse & readout"
begin
@testset
"Instant pulse & readout"
begin
@testset
"Minimise TE"
begin
@testset
"Minimise TE"
begin
seq
=
DiffusionSpinEcho
(
TE
=:
min
,
bval
=
1.
)
seq
=
DiffusionSpinEcho
(
TE
=:
min
,
bval
=
1.
)
@test
length
(
seq
)
==
9
@test
length
(
seq
)
==
10
grad_duration
=
variables
.
TE
(
seq
)
/
2
grad_duration
=
variables
.
TE
(
seq
)
/
2
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
grad_duration
,
0.
,
0.
,
0.
,
grad_duration
,
0.
,
0.
],
atol
=
1e-6
))
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
grad_duration
,
0.
,
0.
,
0.
,
grad_duration
,
0.
,
0.
,
0.
],
atol
=
1e-6
))
@test
length
([
iter_instant_pulses
(
seq
)
...
])
==
2
@test
length
([
iter_instant_pulses
(
seq
)
...
])
==
2
@test
length
([
iter_instant_gradients
(
seq
)
...
])
==
0.
@test
length
([
iter_instant_gradients
(
seq
)
...
])
==
0.
@test
variables
.
bval
(
seq
)
≈
1.
@test
variables
.
bval
(
seq
)
≈
1.
...
@@ -37,8 +37,8 @@
...
@@ -37,8 +37,8 @@
end
end
@testset
"Maximise b-value"
begin
@testset
"Maximise b-value"
begin
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
bval
=:
max
)
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
bval
=:
max
)
@test
length
(
seq
)
==
9
@test
length
(
seq
)
==
10
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
40.
,
0.
,
0.
,
0.
,
40.
,
0.
,
0.
],
atol
=
1e-4
,
rtol
=
1e-4
))
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
40.
,
0.
,
0.
,
0.
,
40.
,
0.
,
0.
,
0.
],
atol
=
1e-4
,
rtol
=
1e-4
))
@test
length
([
iter_instant_pulses
(
seq
)
...
])
==
2
@test
length
([
iter_instant_pulses
(
seq
)
...
])
==
2
@test
length
([
iter_instant_gradients
(
seq
)
...
])
==
0.
@test
length
([
iter_instant_gradients
(
seq
)
...
])
==
0.
@test
variables
.
TE
(
seq
)
≈
80.
@test
variables
.
TE
(
seq
)
≈
80.
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
end
end
@testset
"Set diffusion time Δ"
begin
@testset
"Set diffusion time Δ"
begin
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
Δ
=
70.
,
qval
=:
max
)
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
Δ
=
70.
,
qval
=:
max
)
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
10.
,
30.
,
0.
,
30.
,
10.
,
0.
,
0.
],
atol
=
1e-4
,
rtol
=
1e-4
))
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
10.
,
30.
,
0.
,
30.
,
10.
,
0.
,
0.
,
0.
],
atol
=
1e-4
,
rtol
=
1e-4
))
@test
variables
.
Δ
(
seq
)
≈
70.
@test
variables
.
Δ
(
seq
)
≈
70.
@test
variables
.
TE
(
seq
)
≈
80.
@test
variables
.
TE
(
seq
)
≈
80.
@test
variables
.
duration
(
seq
)
≈
80.
@test
variables
.
duration
(
seq
)
≈
80.
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
end
end
@testset
"Set gradient duration"
begin
@testset
"Set gradient duration"
begin
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
gradient
=
(
duration
=
10.
,
),
bval
=:
max
)
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
gradient
=
(
duration
=
10.
,
),
bval
=:
max
)
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
10.
,
30.
,
0.
,
30.
,
10.
,
0.
,
0.
],
atol
=
1e-4
,
rtol
=
1e-4
))
@test
all
(
isapprox
.
(
variables
.
duration
.
(
seq
),
[
0.
,
0.
,
10.
,
30.
,
0.
,
30.
,
10.
,
0.
,
0.
,
0.
],
atol
=
1e-4
,
rtol
=
1e-4
))
@test
variables
.
Δ
(
seq
)
≈
70.
rtol
=
1e-4
@test
variables
.
Δ
(
seq
)
≈
70.
rtol
=
1e-4
@test
variables
.
TE
(
seq
)
≈
80.
@test
variables
.
TE
(
seq
)
≈
80.
@test
variables
.
duration
(
seq
)
≈
80.
@test
variables
.
duration
(
seq
)
≈
80.
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
@testset
"DW-SE with finite RF pulses"
begin
@testset
"DW-SE with finite RF pulses"
begin
@testset
"slice-select DW-SE"
begin
@testset
"slice-select DW-SE"
begin
seq
=
DiffusionSpinEcho
(
duration
=:
min
,
bval
=
2.
,
slice_thickness
=
2.
)
seq
=
DiffusionSpinEcho
(
duration
=:
min
,
bval
=
2.
,
slice_thickness
=
2.
)
@test
length
(
seq
)
==
9
@test
length
(
seq
)
==
10
@test
variables
.
duration
(
seq
[
1
])
>
1.
@test
variables
.
duration
(
seq
[
1
])
>
1.
for
index
in
1
:
9
for
index
in
1
:
9
if
index
in
[
2
,
4
,
8
,
9
]
if
index
in
[
2
,
4
,
8
,
9
]
...
@@ -94,7 +94,7 @@
...
@@ -94,7 +94,7 @@
end
end
@testset
"voxel-wise DW-SE"
begin
@testset
"voxel-wise DW-SE"
begin
seq
=
DiffusionSpinEcho
(
duration
=:
min
,
bval
=
2.
,
voxel_size
=
2.
,
fov
=
(
20
,
20
,
20
))
seq
=
DiffusionSpinEcho
(
duration
=:
min
,
bval
=
2.
,
voxel_size
=
2.
,
fov
=
(
20
,
20
,
20
))
@test
length
(
seq
)
==
9
@test
length
(
seq
)
==
10
@test
variables
.
duration
(
seq
[
1
])
>
1.
@test
variables
.
duration
(
seq
[
1
])
>
1.
for
index
in
1
:
9
for
index
in
1
:
9
if
index
in
[
2
,
6
,
8
]
if
index
in
[
2
,
6
,
8
]
...
...
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