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
3a3b96da
Verified
Commit
3a3b96da
authored
11 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Test edge_times calculation
parent
cc227cb7
No related branches found
No related tags found
No related merge requests found
Pipeline
#23609
passed
11 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/containers/base_sequences.jl
+2
-2
2 additions, 2 deletions
src/containers/base_sequences.jl
test/test_sequences.jl
+2
-0
2 additions, 0 deletions
test/test_sequences.jl
with
4 additions
and
2 deletions
src/containers/base_sequences.jl
+
2
−
2
View file @
3a3b96da
...
...
@@ -100,14 +100,14 @@ repetition_time(bs::BaseSequence) = duration(bs)
duration
(
bs
::
BaseSequence
{
0
})
=
0.
duration
(
bs
::
BaseSequence
)
=
sum
(
duration
.
(
bs
);
init
=
0.
)
function
edge_times
(
seq
::
BaseSequence
)
function
edge_times
(
seq
::
BaseSequence
;
tol
=
1e-6
)
res
=
Float64
[]
for
(
index
,
block
)
in
enumerate
(
seq
)
append!
(
res
,
edge_times
(
block
)
.+
start_time
(
seq
,
index
))
end
unique_res
=
Float64
[
res
[
1
]]
for
edge
in
res
if
!
isapprox
(
edge
,
unique_res
[
end
],
atol
=
1e-6
)
if
!
isapprox
(
edge
,
unique_res
[
end
],
atol
=
tol
)
push!
(
unique_res
,
edge
)
end
end
...
...
This diff is collapsed.
Click to expand it.
test/test_sequences.jl
+
2
−
0
View file @
3a3b96da
...
...
@@ -25,6 +25,7 @@
@test
TR
(
seq
)
≈
80.
@test
4.8
<
bval
(
seq
)
<
4.9
@test
rise_time
(
seq
[
:
gradient
])
≈
min_rise_time
rtol
=
1e-4
@test
all
(
isapprox
.
(
edge_times
(
seq
,
tol
=
1e-3
),
[
0.
,
min_rise_time
,
40.
-
min_rise_time
,
40
,
40
+
min_rise_time
,
80
-
min_rise_time
,
80.
],
atol
=
1e-4
))
# can also maximise q-value
seq2
=
DiffusionSpinEcho
(
TE
=
80.
,
qval
=:
max
)
...
...
@@ -41,6 +42,7 @@
@test
0.72
<
bval
(
seq
)
<
0.73
@test
readout_times
(
seq
)[
1
]
≈
TE
(
seq
)
@test
rise_time
(
seq
[
:
gradient
])
≈
min_rise_time
rtol
=
1e-4
@test
all
(
isapprox
.
(
edge_times
(
seq
),
[
0.
,
min_rise_time
,
10.
-
min_rise_time
,
10.
,
40
,
70
,
70
+
min_rise_time
,
80
-
min_rise_time
,
80.
],
atol
=
1e-4
))
end
@testset
"Set gradient duration"
begin
seq
=
DiffusionSpinEcho
(
TE
=
80.
,
gradient
=
(
duration
=
10.
,
),
bval
=:
max
)
...
...
This diff is collapsed.
Click to expand it.
Michiel Cottaar
@ndcn0236
mentioned in commit
8184dc3b
·
11 months ago
mentioned in commit
8184dc3b
mentioned in commit 8184dc3b91bdad03b817ab5419659094123a224e
Toggle commit list
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