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
0bfa5869
Verified
Commit
0bfa5869
authored
11 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Store instants in dense vector form
parent
2a43fc72
No related branches found
No related tags found
No related merge requests found
Pipeline
#23445
passed
11 months ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/containers/linearise.jl
+7
-7
7 additions, 7 deletions
src/containers/linearise.jl
with
7 additions
and
7 deletions
src/containers/linearise.jl
+
7
−
7
View file @
0bfa5869
...
...
@@ -123,7 +123,7 @@ function split_times(sequences::AbstractVector{<:BaseSequence}, tstart::Number,
timestep
=
Float64
(
max_timestep
)
for
sequence
in
sequences
(
block_time
,
block
)
=
sequence
[
mod
(
tmean
,
duration
(
sequence
))
]
(
block_time
,
block
)
=
sequence
(
mod
(
tmean
,
duration
(
sequence
))
)
for
key
in
keys
(
block
)
if
!
(
start_time
(
block
,
key
)
<
block_time
<
end_time
(
block
,
key
))
continue
...
...
@@ -156,8 +156,8 @@ If multiple sequences are provided a vector of `LinearSequence` objects are retu
"""
struct
LinearSequence
finite_parts
::
Vector
{
SequencePart
}
instant_pulses
::
Vector
{
Tuple
{
Int
,
InstantPulse
}}
instant_gradient
::
Vector
{
Tuple
{
Int
,
InstantGradient3D
}}
instant_pulses
::
Vector
{
Union
{
Nothing
,
InstantPulse
}}
instant_gradient
::
Vector
{
Union
{
Nothing
,
InstantGradient3D
}}
end
LinearSequence
(
sequence
::
BaseSequence
;
kwargs
...
)
=
LinearSequence
(
sequence
,
0.
,
duration
(
sequence
);
kwargs
...
)
...
...
@@ -169,8 +169,8 @@ function LinearSequence(container::BaseSequence, times::AbstractVector{<:Number}
tstart
=
times
[
1
]
tfinal
=
times
[
end
]
pulses
=
Tuple
{
Int
,
InstantPulse
}[]
gradients
=
Tuple
{
Int
,
InstantGradient3D
}[]
pulses
=
Union
{
Nothing
,
InstantPulse
}[
nothing
for
_
in
1
:
length
(
times
)
]
gradients
=
Union
{
Nothing
,
InstantGradient3D
}[
nothing
for
_
in
1
:
length
(
times
)
]
for
nTR
in
div
(
tstart
,
duration
(
container
),
RoundDown
)
:
div
(
tfinal
,
duration
(
container
),
RoundUp
)
for
(
to_store
,
func
)
in
[
(
pulses
,
iter_instant_pulses
),
...
...
@@ -181,8 +181,8 @@ function LinearSequence(container::BaseSequence, times::AbstractVector{<:Number}
if
!
(
tstart
<=
real_time
<
tfinal
)
continue
end
index
=
findmin
(
t
->
abs
(
t
-
real_time
),
times
)[
2
]
-
1
push!
(
to_store
,
(
index
,
pulse
))
index
=
findmin
(
t
->
abs
(
t
-
real_time
),
times
)[
2
]
to_store
[
index
]
=
pulse
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Michiel Cottaar
@ndcn0236
mentioned in commit
d23d975b
·
11 months ago
mentioned in commit
d23d975b
mentioned in commit d23d975b5bd7f0aa1d69921fb66dd3ff1f6d851d
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