Skip to content
Snippets Groups Projects
Unverified Commit fcfc5d72 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Remove default definition of TR

parent 359439ca
No related branches found
No related tags found
1 merge request!2Define variables through new @defvar macro
......@@ -5,7 +5,7 @@ In most MR sequence building software, the user will have to set all of these fr
In MRIBuilder the internal free parameters are not set directly.
Instead, they are inferred using a non-linear, constrained optimisation.
For each sequence type, the developer defines how to compute various summary variables from the `BuildingBlock` free parameters, such as [`echo_time`](@ref), [`repetition_time`](@ref), [`resolution`](@ref), [`gradient_strength`](@ref), [`diffusion_time`](@ref), etc.
For each sequence type, the developer defines how to compute various summary variables from the `BuildingBlock` free parameters, such as [`echo_time`](@ref), [`duration`](@ref), [`resolution`](@ref), [`gradient_strength`](@ref), [`diffusion_time`](@ref), etc.
A user can then create a specific instantiation of the sequence by fixing any of these summary variables to their desired values (or setting them to `:min`/`:max` to minimise/maximise them).
In addition to the user-defined constraints, this optimisation will also take into account any [scanner-defined constraints](@ref scanners).
Internally, MRIBuilder will then optimise the `BuildingBlock` free parameters to match any user-defined constraints and/or objectives.
......
......@@ -64,7 +64,7 @@ function start_time(bs::BaseSequence{N}, index::Integer) where {N}
if iszero(nTR)
return base_time
else
return nTR * repetition_time(bs) + base_time
return nTR * duration(bs) + base_time
end
end
......@@ -144,9 +144,6 @@ Defines an MRI sequence from a vector of building blocks.
- numbers/`nothing`/`:min`/`:max` : replaced with a [`Wait`](@ref) block with the appropriate constraint/objective added to its [`duration`](@ref).
- RF pulse or readout: will be embedded within a [`BuildingBlock`](@ref) of the appropriate length
## Variables
- [`repetition_time`](@ref)/[`TR`](@ref): how long between repeats in ms. This is always set to the total length of the sequence. If you want to add some down-time between repeats, you can simply add a [`Wait`](@ref) block of the appropriate length at the end of the sequence.
Specific named sequences might define additional variables.
"""
struct Sequence{S, N} <: BaseSequence{N}
......@@ -173,8 +170,6 @@ nrepeat(::Sequence) = 0
to_block_pair(pair::Pair) = pair[1] => to_block(pair[2])
to_block_pair(other) = nothing => to_block(other)
@defvar repetition_time(seq::Sequence) = duration(seq)
"""
to_block(block_like)
......
......@@ -34,7 +34,7 @@ If image parameters are provided, this will switch to a sinc pulse and EPI reado
## Variables
- [`TE`](@ref)/[`echo_time`](@ref): echo time between excitation pulse and spin echo in ms.
- [`delay`](@ref): delay between the readout and the peak of the spin echo in ms (positive number indicates that readout is after the spin echo). Defaults to zero.
- [`TR`](@ref)/[`repetition_time`](@ref)/[`duration`](@ref): total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.
- [`duration`](@ref): total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.
- [`Δ`](@ref)/[`diffusion_time`](@ref): Time from the start of one diffusion-weighted gradient till the other in ms.
"""
function DiffusionSpinEcho(; delay=0., excitation=(), gradient=(), refocus=(), readout=(), optim=(), spoiler=nothing, resolution=nothing, fov=nothing, voxel_size=nothing, slice_thickness=nothing, scanner=Default_Scanner, variables...)
......
......@@ -26,7 +26,7 @@ If image parameters are provided, this will switch to a sinc pulse and EPI reado
## Variables
- [`TE`](@ref)/[`echo_time`](@ref): echo time between excitation pulse and readout in ms (required).
- [`TR`](@ref)/[`repetition_time`](@ref)/[`duration`](@ref): total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.
- [`duration`](@ref): total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.
"""
function GradientEcho(; excitation=(), readout=(), optim=(), spoiler=nothing, resolution=nothing, fov=nothing, voxel_size=nothing, slice_thickness=nothing, scanner=Default_Scanner, variables...)
build_sequence(scanner; optim...) do
......
......@@ -28,7 +28,7 @@ If image parameters are provided, this will switch to a sinc pulse and EPI reado
## Variables
- [`TE`](@ref)/[`echo_time`](@ref): echo time between excitation pulse and spin echo in ms (required).
- [`delay`](@ref): delay between the readout and the peak of the spin echo in ms (positive number indicates that readout is after the spin echo). Defaults to zero.
- [`TR`](@ref)/[`repetition_time`](@ref)/[`duration`](@ref): total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.
- [`duration`](@ref): total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.
"""
function SpinEcho(; delay=0., excitation=(), refocus=(), readout=(), optim=(), spoiler=nothing, resolution=nothing, fov=nothing, voxel_size=nothing, slice_thickness=nothing, scanner=Default_Scanner, variables...)
build_sequence(scanner; optim...) do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment