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
5152977c
Unverified
Commit
5152977c
authored
9 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Add InstantGradient extension
parent
490bc5b2
No related branches found
No related tags found
1 merge request
!3
Add InstantPulse and InstantGradient pulseq extension support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sequence_io/pulseq.jl
+29
-4
29 additions, 4 deletions
src/sequence_io/pulseq.jl
with
29 additions
and
4 deletions
src/sequence_io/pulseq.jl
+
29
−
4
View file @
5152977c
...
...
@@ -129,8 +129,8 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim
ext
=
[]
for
(
key
,
event
)
in
events
(
block
)
gen
=
make_generic
(
event
)
if
event
isa
InstantPulse
push!
(
ext
,
(
Int
(
div
(
start_time
(
block
,
key
),
1e-3
,
RoundNearest
)),
event
))
if
event
isa
Union
{
InstantPulse
,
InstantGradient
}
push!
(
ext
,
(
start_time
(
block
,
key
),
event
))
elseif
event
isa
RFPulseComponent
if
!
isnothing
(
rf
)
error
(
"Pulseq does not support a single building block containing multiple RF pulses."
)
...
...
@@ -197,10 +197,35 @@ end
get_extension_name
(
::
Tuple
{
<:
Number
,
InstantPulse
})
=
:
InstantPulse
function
add_extension_definition!
(
content
::
Vector
{
String
},
obj
::
Tuple
{
Int
,
InstantPulse
})
function
add_extension_definition!
(
content
::
Vector
{
String
},
obj
::
Tuple
{
Number
,
InstantPulse
})
to_store
=
(
obj
[
1
],
obj
[
2
]
.
flip_angle
,
obj
[
2
]
.
phase
)
for
line
in
content
(
id
,
this_line
...
)
=
parse
.
((
Int
,
Int
,
Float64
,
Float64
),
split
(
line
))
(
id
,
this_line
...
)
=
parse
.
((
Int
,
Float64
,
Float64
,
Float64
),
split
(
line
))
if
all
(
to_store
.
≈
this_line
)
return
id
end
end
push!
(
content
,
"
$
(length(content) + 1) "
*
join
(
string
.
(
to_store
),
" "
))
return
length
(
content
)
end
# I/O of InstantGradient
function
parse_extension
(
ext
::
PulseqExtensionDefinition
{
:
InstantGradient
})
mapping
=
Dict
{
Int
,
InstantGradient
}()
for
line
in
ext
.
content
(
id
,
delay
,
qvec
...
)
=
parse
.
((
Int
,
Float64
,
Float64
,
Float64
,
Float64
),
split
(
line
))
mapping
[
id
]
=
(
delay
,
InstantGradient3D
([
qvec
...
],
nothing
))
end
return
mapping
end
get_extension_name
(
::
Tuple
{
<:
Number
,
<:
InstantGradient
})
=
:
InstantGradient
function
add_extension_definition!
(
content
::
Vector
{
String
},
obj
::
Tuple
{
<:
Number
,
<:
InstantGradient
})
to_store
=
(
obj
[
1
],
variables
.
qvec
(
obj
[
2
])
...
)
for
line
in
content
(
id
,
this_line
...
)
=
parse
.
((
Int
,
Float64
,
Float64
,
Float64
,
Float64
),
split
(
line
))
if
all
(
to_store
.
≈
this_line
)
return
id
end
...
...
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