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
2a43fc72
Verified
Commit
2a43fc72
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Use iter for readout_times rather than custom implementation
parent
fdd85ba6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/containers/abstract.jl
+9
-8
9 additions, 8 deletions
src/containers/abstract.jl
src/containers/base_sequences.jl
+0
-8
0 additions, 8 deletions
src/containers/base_sequences.jl
src/containers/building_blocks.jl
+0
-10
0 additions, 10 deletions
src/containers/building_blocks.jl
with
9 additions
and
26 deletions
src/containers/abstract.jl
+
9
−
8
View file @
2a43fc72
module
Abstract
module
Abstract
import
...
Variables
:
AbstractBlock
,
duration
,
effective_time
,
gradient_strength
,
amplitude
,
phase
,
VariableType
import
...
Variables
:
AbstractBlock
,
duration
,
effective_time
,
gradient_strength
,
amplitude
,
phase
,
VariableType
import
...
Components
.
Readouts
:
readout_times
import
...
Components
.
Readouts
:
readout_times
import
...
Components
:
BaseComponent
,
InstantPulse
,
InstantGradient
import
...
Components
:
BaseComponent
,
InstantPulse
,
InstantGradient
,
ReadoutComponent
"""
"""
Parent type for `BuildingBlock` or `BaseSequence`, i.e., any building block that contains other MRI components/blocks.
Parent type for `BuildingBlock` or `BaseSequence`, i.e., any building block that contains other MRI components/blocks.
...
@@ -47,13 +47,6 @@ effective_time(container::ContainerBlock, index, indices...) = start_time(contai
...
@@ -47,13 +47,6 @@ effective_time(container::ContainerBlock, index, indices...) = start_time(contai
effective_time
(
block
::
Tuple
{
<:
VariableType
,
<:
AbstractBlock
})
=
block
[
1
]
+
effective_time
(
block
[
2
])
effective_time
(
block
::
Tuple
{
<:
VariableType
,
<:
AbstractBlock
})
=
block
[
1
]
+
effective_time
(
block
[
2
])
"""
readout_times(sequence/ADC)
Return the times of all of the readout events in ms.
"""
function
readout_times
end
"""
"""
edge_times(container)
edge_times(container)
...
@@ -125,4 +118,12 @@ Returns all the [`InstantGradient`](@ref) within the sequence with their timings
...
@@ -125,4 +118,12 @@ Returns all the [`InstantGradient`](@ref) within the sequence with their timings
iter_instant_gradients
(
container
::
ContainerBlock
)
=
iter
(
container
,
Val
(
:
instantgradient
))
iter_instant_gradients
(
container
::
ContainerBlock
)
=
iter
(
container
,
Val
(
:
instantgradient
))
iter
(
component
::
Tuple
{
<:
Number
,
<:
InstantGradient
},
::
Val
{
:
instantgradient
})
=
[
component
]
iter
(
component
::
Tuple
{
<:
Number
,
<:
InstantGradient
},
::
Val
{
:
instantgradient
})
=
[
component
]
"""
readout_times(sequence)
Returns all the times that the sequence will readout.
"""
readout_times
(
container
::
ContainerBlock
)
=
[
time
for
(
time
,
_
)
in
iter
(
container
,
Val
(
:
readout
))]
iter
(
component
::
Tuple
{
<:
Number
,
<:
ReadoutComponent
},
::
Val
{
:
readout
})
=
[(
time
,
nothing
)
for
time
in
readout_times
(
component
[
2
])]
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/containers/base_sequences.jl
+
0
−
8
View file @
2a43fc72
...
@@ -100,14 +100,6 @@ repetition_time(bs::BaseSequence) = duration(bs)
...
@@ -100,14 +100,6 @@ repetition_time(bs::BaseSequence) = duration(bs)
duration
(
bs
::
BaseSequence
{
0
})
=
0.
duration
(
bs
::
BaseSequence
{
0
})
=
0.
duration
(
bs
::
BaseSequence
)
=
sum
(
duration
.
(
bs
);
init
=
0.
)
duration
(
bs
::
BaseSequence
)
=
sum
(
duration
.
(
bs
);
init
=
0.
)
function
readout_times
(
seq
::
BaseSequence
)
res
=
Float64
[]
for
(
index
,
block
)
in
enumerate
(
seq
)
append!
(
res
,
readout_times
(
block
)
.+
start_time
(
seq
,
index
))
end
return
res
end
function
edge_times
(
seq
::
BaseSequence
)
function
edge_times
(
seq
::
BaseSequence
)
res
=
Float64
[]
res
=
Float64
[]
for
(
index
,
block
)
in
enumerate
(
seq
)
for
(
index
,
block
)
in
enumerate
(
seq
)
...
...
This diff is collapsed.
Click to expand it.
src/containers/building_blocks.jl
+
0
−
10
View file @
2a43fc72
...
@@ -208,16 +208,6 @@ function bmat_gradient(bb::BaseBuildingBlock, qstart, index1, index2)
...
@@ -208,16 +208,6 @@ function bmat_gradient(bb::BaseBuildingBlock, qstart, index1, index2)
end
end
bmat_gradient
(
bb
::
BaseBuildingBlock
,
qstart
)
=
bmat_gradient
(
bb
,
qstart
,
nothing
,
nothing
)
bmat_gradient
(
bb
::
BaseBuildingBlock
,
qstart
)
=
bmat_gradient
(
bb
,
qstart
,
nothing
,
nothing
)
function
readout_times
(
bb
::
BaseBuildingBlock
)
res
=
Float64
[]
for
(
key
,
event
)
in
events
(
bb
)
if
event
isa
ReadoutComponent
append!
(
res
,
readout_times
(
event
)
.+
start_time
(
bb
,
key
))
end
end
return
res
end
function
edge_times
(
bb
::
BaseBuildingBlock
)
function
edge_times
(
bb
::
BaseBuildingBlock
)
res
=
Float64
[]
res
=
Float64
[]
for
key
in
keys
(
bb
)
for
key
in
keys
(
bb
)
...
...
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