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
0fd4dfc4
Unverified
Commit
0fd4dfc4
authored
10 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Fix block duration setting for v1.3.1
parent
61a43a29
No related branches found
No related tags found
1 merge request
!1
Add writing to Pulseq files
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sequence_io/pulseq.jl
+17
-4
17 additions, 4 deletions
src/sequence_io/pulseq.jl
with
17 additions
and
4 deletions
src/sequence_io/pulseq.jl
+
17
−
4
View file @
0fd4dfc4
...
...
@@ -14,13 +14,13 @@ function Sequence(pulseq::PulseqSequence; scanner=nothing, B0=nothing)
use_B0
=
isnothing
(
B0
)
?
get
(
pulseq
.
definitions
,
:
B0
,
3.
)
:
B0
scanner
=
Scanner
(
B0
=
use_B0
)
end
blocks
=
BuildingBlock
.
(
pulseq
.
blocks
;
pulseq
.
definitions
...
)
blocks
=
BuildingBlock
.
(
pulseq
.
blocks
;
pulseq
.
definitions
...
,
version
=
pulseq
.
version
)
return
Sequence
(
blocks
;
name
=
Symbol
(
get
(
pulseq
.
definitions
,
:
Name
,
"from_pulseq"
)),
scanner
=
scanner
)
end
function
BuildingBlock
(
pulseq
::
PulseqBlock
;
BlockDurationRaster
,
RadiofrequencyRasterTime
,
GradientRasterTime
,
kwargs
...
)
duration
=
pulseq
.
duration
*
BlockDurationRaster
*
1e3
function
BuildingBlock
(
pulseq
::
PulseqBlock
;
version
,
BlockDurationRaster
,
RadiofrequencyRasterTime
,
GradientRasterTime
,
kwargs
...
)
stated_
duration
=
pulseq
.
duration
*
BlockDurationRaster
*
1e3
events
=
[]
if
!
isnothing
(
pulseq
.
rf
)
...
...
@@ -52,7 +52,20 @@ function BuildingBlock(pulseq::PulseqBlock; BlockDurationRaster, RadiofrequencyR
end
grads
=
[
pulseq
.
gx
,
pulseq
.
gy
,
pulseq
.
gz
]
times
=
sort
(
unique
(
vcat
([
0.
,
duration
],
_control_times
.
(
grads
,
GradientRasterTime
)
...
)))
min_duration
=
max
(
maximum
(
e
[
1
]
+
duration
(
e
[
2
])
for
e
in
events
;
init
=
0.
),
maximum
(
vcat
(
_control_times
.
(
grads
,
GradientRasterTime
)
...
);
init
=
0.
)
)
if
min_duration
>
stated_duration
if
version
==
v
"1.3.1"
stated_duration
=
min_duration
else
error
(
"Minimum duration to play all RF/gradient/ADC events exceeds stated duration."
)
end
end
times
=
sort
(
unique
(
vcat
([
0.
,
stated_duration
],
_control_times
.
(
grads
,
GradientRasterTime
)
...
)))
waveform
=
[(
t
,
_get_amplitude
.
(
grads
,
t
,
GradientRasterTime
))
for
t
in
times
]
return
BuildingBlock
(
waveform
,
events
)
...
...
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