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
c585709e
Verified
Commit
c585709e
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Fix duration calculation
parent
2023f056
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/components/gradient_waveforms/no_gradient_blocks.jl
+1
-1
1 addition, 1 deletion
src/components/gradient_waveforms/no_gradient_blocks.jl
src/containers/building_blocks.jl
+2
-3
2 additions, 3 deletions
src/containers/building_blocks.jl
with
3 additions
and
4 deletions
src/components/gradient_waveforms/no_gradient_blocks.jl
+
1
−
1
View file @
c585709e
...
@@ -23,7 +23,7 @@ struct NoGradient{N} <: GradientWaveform{N}
...
@@ -23,7 +23,7 @@ struct NoGradient{N} <: GradientWaveform{N}
end
end
end
end
duration
(
ngb
::
NoGradient
)
=
duration
(
ngb
)
duration
(
ngb
::
NoGradient
)
=
ngb
.
duration
for
func
in
(
:
qval
,
:
gradient_strength
,
:
slew_rate
)
for
func
in
(
:
qval
,
:
gradient_strength
,
:
slew_rate
)
@eval
$
func
(
::
NoGradient
{
1
})
=
0.
@eval
$
func
(
::
NoGradient
{
1
})
=
0.
@eval
$
func
(
::
NoGradient
{
3
})
=
zero
(
SVector
{
3
,
Float64
})
@eval
$
func
(
::
NoGradient
{
3
})
=
zero
(
SVector
{
3
,
Float64
})
...
...
This diff is collapsed.
Click to expand it.
src/containers/building_blocks.jl
+
2
−
3
View file @
c585709e
...
@@ -24,7 +24,6 @@ Main interface:
...
@@ -24,7 +24,6 @@ Main interface:
Sub-types need to implement:
Sub-types need to implement:
- `Base.keys`: returns sequence of keys to all the components.
- `Base.keys`: returns sequence of keys to all the components.
- `Base.getindex`: returns the actual component for each key.
- `Base.getindex`: returns the actual component for each key.
- [`duration`](@ref): total duration of the building block.
"""
"""
abstract type
BaseBuildingBlock
<:
ContainerBlock
end
abstract type
BaseBuildingBlock
<:
ContainerBlock
end
...
@@ -126,6 +125,8 @@ function start_time(building_block::BaseBuildingBlock, index)
...
@@ -126,6 +125,8 @@ function start_time(building_block::BaseBuildingBlock, index)
error
(
"Building block with index '
$
index' not found"
)
error
(
"Building block with index '
$
index' not found"
)
end
end
duration
(
bb
::
BaseBuildingBlock
)
=
sum
([
duration
(
wv
)
for
(
_
,
wv
)
in
waveform_sequence
(
bb
)])
# Pathway support
# Pathway support
"""
"""
waveform_sequence(building_block, first, last)
waveform_sequence(building_block, first, last)
...
@@ -259,8 +260,6 @@ make_generic(other_block::BaseBuildingBlock) = BuildingBlock(duration(other_bloc
...
@@ -259,8 +260,6 @@ make_generic(other_block::BaseBuildingBlock) = BuildingBlock(duration(other_bloc
Base
.
keys
(
bb
::
BuildingBlock
)
=
1
:
length
(
bb
.
parts
)
Base
.
keys
(
bb
::
BuildingBlock
)
=
1
:
length
(
bb
.
parts
)
Base
.
getindex
(
bb
::
BuildingBlock
,
i
::
Integer
)
=
bb
.
parts
[
i
]
Base
.
getindex
(
bb
::
BuildingBlock
,
i
::
Integer
)
=
bb
.
parts
[
i
]
duration
(
bb
::
BuildingBlock
)
=
sum
(
duration
,
waveform_sequence
(
bb
);
init
=
0.
)
function
get_pulse
(
bb
::
BuildingBlock
)
function
get_pulse
(
bb
::
BuildingBlock
)
pulses
=
[
p
for
p
in
events
(
bb
)
if
p
isa
RFPulseComponent
]
pulses
=
[
p
for
p
in
events
(
bb
)
if
p
isa
RFPulseComponent
]
if
length
(
pulses
)
==
0
if
length
(
pulses
)
==
0
...
...
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