diff --git a/docs/src/implemented_sequences.md b/docs/src/implemented_sequences.md index 1861a3a6f2687c3c5a31a2424a2d1e420d0c7d58..2643e912841e99ce1bd22b8ea222435b320f14cf 100644 --- a/docs/src/implemented_sequences.md +++ b/docs/src/implemented_sequences.md @@ -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. - `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 +``` + + +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 +``` + + +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 +``` + + +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 +``` + + ## Available sequences ```@meta CollapsedDocStrings = true