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

Add usage examples

parent 2502d642
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,52 @@ When reading the help, you will notice that there are two type of expected input ...@@ -10,6 +10,52 @@ When reading the help, you will notice that there are two type of expected input
- `Parameters`: these define the type of components that will be includes, e.g., the shape of the excitation pulse or the readout strategy. These parameters have to be set to certain fixed values. If unset, they will be determined by their default value as defined in the documentation. - `Parameters`: these define the type of components that will be includes, e.g., the shape of the excitation pulse or the readout strategy. These parameters have to be set to certain fixed values. If unset, they will be determined by their default value as defined in the documentation.
- `Variables`: These are a special type of parameters. In addition to being set to a fixed value, they can also be set to `:min` or `:max` to minimise or maximise the variable. If they are unset, they will be determined based on the other variables. For more details, see the section on [sequence optimisation](@ref sequence_optimisation). - `Variables`: These are a special type of parameters. In addition to being set to a fixed value, they can also be set to `:min` or `:max` to minimise or maximise the variable. If they are unset, they will be determined based on the other variables. For more details, see the section on [sequence optimisation](@ref sequence_optimisation).
As an example, the following creates and plots a [`DiffusionSpinEcho`](@ref) that has a b-value of 1, a minimal echo time, and a slice thickness of 2 mm:
```@example
using MRIBuilder
using CairoMakie
sequence = DiffusionSpinEcho(bval=1., TE=:min, slice_thickness=2)
plot(sequence)
save("dwi_1_min_2.png") # hide
nothing # hide
```
![DWI sequence diagram](dwi_1_min_2.png)
If we want a specific [`diffusion_time`](@ref), we can just add it to the constraints, and the rest of the sequence will adapt as needed:
```@example
using MRIBuilder # hide
using CairoMakie # hide
sequence = DiffusionSpinEcho(bval=1., diffusion_time=80, TE=:min, slice_thickness=2)
plot(sequence)
save("dwi_1_80_min_2.png") # hide
nothing # hide
```
![DWI sequence diagram with fixed diffusion time](dwi_1_80_min_2.png)
We can even directly set some aspect of one of the sequence components, such as slowing down the gradient [`rise_time`](@ref)
and the additional constraint will just be included in the [sequence optimisation](@ref sequence_optimisation):
```@example
using MRIBuilder # hide
using CairoMakie # hide
sequence = DiffusionSpinEcho(bval=1., diffusion_time=80, TE=:min, slice_thickness=2, gradient=(rise_time=15, ))
plot(sequence)
save("dwi_1_80_min_2_15.png") # hide
nothing # hide
```
![DWI sequence diagram with fixed diffusion time and rise time](dwi_1_80_min_2_15.png)
Note that the previous sequences do not contain a realistic readout.
Most sequences will only include an instant readout, unless you directly set the [`voxel_size`](@ref) and [`resolution`](@ref).
```@example
using MRIBuilder # hide
using CairoMakie # hide
sequence = DiffusionSpinEcho(bval=1., diffusion_time=80, TE=:min, voxel_size=2, resolution=(20, 20, 20), gradient=(rise_time=15, ))
plot(sequence)
save("dwi_1_80_min_2_15_epi.png") # hide
nothing # hide
```
![DWI sequence diagram with EPI readout](dwi_1_80_min_2_15_epi.png)
## Available sequences ## Available sequences
```@meta ```@meta
CollapsedDocStrings = true CollapsedDocStrings = true
......
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