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
68916b6c
Unverified
Commit
68916b6c
authored
9 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Replace qval with qvec where appropriate
parent
d91ffef9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Define variables through new @defvar macro
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/instant_gradients.jl
+9
-9
9 additions, 9 deletions
src/components/instant_gradients.jl
src/parts/epi_readouts.jl
+1
-1
1 addition, 1 deletion
src/parts/epi_readouts.jl
with
10 additions
and
10 deletions
src/components/instant_gradients.jl
+
9
−
9
View file @
68916b6c
...
@@ -20,13 +20,13 @@ If the `orientation` is set an [`InstantGradient1D`](@ref) is returned, otherwis
...
@@ -20,13 +20,13 @@ If the `orientation` is set an [`InstantGradient1D`](@ref) is returned, otherwis
"""
"""
abstract type
InstantGradient
{
N
}
<:
EventComponent
end
abstract type
InstantGradient
{
N
}
<:
EventComponent
end
function
(::
Type
{
InstantGradient
})(;
orientation
=
nothing
,
group
=
nothing
,
qval
=
nothing
,
variables
...
)
function
(::
Type
{
InstantGradient
})(;
orientation
=
nothing
,
group
=
nothing
,
variables
...
)
if
isnothing
(
orientation
)
if
isnothing
(
orientation
)
res
=
InstantGradient3D
(
get_free_variable
.
(
qval
)
,
group
)
res
=
InstantGradient3D
(
nothing
,
group
)
else
else
res
=
InstantGradient1D
(
get_free_variable
(
qval
)
,
orientation
,
group
)
res
=
InstantGradient1D
(
nothing
,
orientation
,
group
)
if
!
(
res
.
qv
al
isa
Number
)
if
!
(
res
.
qv
ec
isa
Number
)
@constraint
global_model
()
res
.
qv
al
>=
0
@constraint
global_model
()
res
.
qv
ec
>=
0
end
end
end
end
set_simple_constraints!
(
res
,
variables
)
set_simple_constraints!
(
res
,
variables
)
...
@@ -52,11 +52,11 @@ struct InstantGradient3D <: InstantGradient{3}
...
@@ -52,11 +52,11 @@ struct InstantGradient3D <: InstantGradient{3}
group
::
Union
{
Nothing
,
Symbol
}
group
::
Union
{
Nothing
,
Symbol
}
end
end
function
InstantGradient3D
(;
qv
al
=
[
nothing
,
nothing
,
nothing
],
group
=
nothing
,
variables
...
)
function
InstantGradient3D
(;
qv
ec
=
nothing
,
group
=
nothing
,
variables
...
)
if
isnothing
(
qv
al
)
if
isnothing
(
qv
ec
)
qv
al
=
[
nothing
,
nothing
,
nothing
]
qv
ec
=
[
nothing
,
nothing
,
nothing
]
end
end
res
=
InstantGradient3D
(
get_free_variable
.
(
qv
al
),
group
)
res
=
InstantGradient3D
(
get_free_variable
.
(
qv
ec
),
group
)
set_simple_constraints!
(
res
,
variables
)
set_simple_constraints!
(
res
,
variables
)
return
res
return
res
end
end
...
...
This diff is collapsed.
Click to expand it.
src/parts/epi_readouts.jl
+
1
−
1
View file @
68916b6c
...
@@ -55,7 +55,7 @@ function EPIReadout(; resolution::AbstractVector{<:Integer}, recenter=false, gro
...
@@ -55,7 +55,7 @@ function EPIReadout(; resolution::AbstractVector{<:Integer}, recenter=false, gro
apply_simple_constraint!
(
variables
.
qvec
(
res
.
recenter_gradient
),
VariableType
[
sign
*
variables
.
qvec
(
pos
)[
1
]
/
2
,
-
ky_lines
[
end
]
*
res
.
ky_step
,
0.
])
apply_simple_constraint!
(
variables
.
qvec
(
res
.
recenter_gradient
),
VariableType
[
sign
*
variables
.
qvec
(
pos
)[
1
]
/
2
,
-
ky_lines
[
end
]
*
res
.
ky_step
,
0.
])
end
end
for
shift
in
unique
(
ky_lines
[
2
:
end
]
-
ky_lines
[
1
:
end
-
1
])
for
shift
in
unique
(
ky_lines
[
2
:
end
]
-
ky_lines
[
1
:
end
-
1
])
res
.
blips
[
shift
]
=
Trapezoid
(
orientation
=
[
0
,
shift
>
0
?
1
:
-
1
,
0
],
group
=
group
,
qval
=
abs
(
shift
)
*
res
.
ky_step
)
res
.
blips
[
shift
]
=
Trapezoid
(
qvec
=
[
0
.
,
shift
*
res
.
ky_step
,
0
.
],
group
=
group
)
end
end
set_simple_constraints!
(
res
,
vars
)
set_simple_constraints!
(
res
,
vars
)
return
res
return
res
...
...
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