diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 25739b99afdfbc625ba680c17e9208a261755da1..31067f85c755b213354142cd1b0ebbd439127393 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-18T14:27:28","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-18T15:04:00","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/adjust_sequences/index.html b/dev/adjust_sequences/index.html index eaf39984a80f4b63363018e3b24e1a50cfc364d1..fd90ac1a4ac4eefd589d2471e78b25cad897ff0d 100644 --- a/dev/adjust_sequences/index.html +++ b/dev/adjust_sequences/index.html @@ -1,4 +1,4 @@ <!DOCTYPE html> <html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Post-hoc adjustments · MRIBuilder.jl</title><meta name="title" content="Post-hoc adjustments · MRIBuilder.jl"/><meta property="og:title" content="Post-hoc adjustments · MRIBuilder.jl"/><meta property="twitter:title" content="Post-hoc adjustments · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/adjust_sequences/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/adjust_sequences/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/adjust_sequences/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li class="is-active"><a class="tocitem" href>Post-hoc adjustments</a><ul class="internal"><li><a class="tocitem" href="#Post-hoc-adjustments-API"><span>Post-hoc adjustments API</span></a></li></ul></li><li><a class="tocitem" href="../scanners/">Scanners</a></li><li><a class="tocitem" href="../api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Post-hoc adjustments</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Post-hoc adjustments</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/adjust_sequences.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="adjust_sequences"><a class="docs-heading-anchor" href="#adjust_sequences">Post-hoc adjustment of sequences</a><a id="adjust_sequences-1"></a><a class="docs-heading-anchor-permalink" href="#adjust_sequences" title="Permalink"></a></h1><p>Typically a sequence is repeated for multiple <a href="@ref"><code>repetition_time</code></a> (<a href="@ref"><code>TR</code></a>) to allow the acquisition of multiple k-space lines, slice selection, or other sequence parameters (e.g., varying diffusion-weighting parameters for <a href="../implemented_sequences/#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a>). MRIBuilder supports this by allowing the creation of a longer sequence out of multiple repeats of a base sequence with some minor alterations.</p><p>To support post-hoc alterations, each RF pulse or gradient waveform in the sequence can be given a label. Some commonly-used labels in MRIBuilder are:</p><ul><li><code>:diffusion</code> used for diffusion-weighted gradients produced by <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}"><code>dwi_gradients</code></a>.</li><li><code>:FOV</code> used for gradients that should align with the field-of-view (slice-select gradients in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a> or <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>refocus_pulse</code></a> and readout gradients in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>).</li></ul><p>Post-hoc alterations can be applied to gradients or RF pulses with a specific labels (or to all gradients/RF pulses) using <a href="#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a>. Some example usages are:</p><ul><li>Reduce the RF pulse amplitude by 20% (e.g., to model the effect of transmit bias field): <code>adjust(sequence, pulse=(scale=0.8, ))</code></li><li>Repeat sequence 2 times with different diffusion-weighted gradient orientations (x- and y-direction) and gradient strength reduced by 30%: <code>adjust(sequence, diffusion=(orientation=[[1., 0., 0], [0., 1., 0.]], scale=0.7))</code></li><li>Repeat the sequence by shifting the excited slice by the given number of millimetres in the slice-select direction: <code>adjust(sequence, FOV=(shift=[-7.5, -2.5, 2.5, 7.5, -5., 0., 5., 10.]))</code>. These shifts represent an interleaved acquisition scheme, where the acquired slices/bands are 2.5 mm apart.</li><li>Rotations defined using the <a href="https://github.com/JuliaGeometry/Rotations.jl"><code>Rotations.jl</code></a> package can be applied to gradient orientations or the field of view. For example, to rotate the field of view by 45 degrees around the y-axis:</li></ul><pre><code class="language-julia hljs">using Rotations rotation = Rotations.AngleAxis(deg2rad(45), 0., 1., 0.) -adjust(sequence, FOV=(rotation=rotation, ))</code></pre><p>When repeating the same sequence, a spoiler gradient and/or dead time can be added in between each pair of repeats by supplying the appropriate keywords to the <code>merge</code> parameter in <a href="#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a> (e.g., <code>merge=(wait_time=10., )</code>). These parameters are described in more detail in <a href="#MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}"><code>merge_sequences</code></a>.</p><h2 id="Post-hoc-adjustments-API"><a class="docs-heading-anchor" href="#Post-hoc-adjustments-API">Post-hoc adjustments API</a><a id="Post-hoc-adjustments-API-1"></a><a class="docs-heading-anchor-permalink" href="#Post-hoc-adjustments-API" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.PostHoc" href="#MRIBuilder.PostHoc"><code>MRIBuilder.PostHoc</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define post-fitting adjustments of the sequences</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/post_hoc.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}" href="#MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}"><code>MRIBuilder.PostHoc.merge_sequences</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">merge_sequences(sequences...; wait_time=0.)</code></pre><p>Merge multiple sequences together.</p><p>Sequences will be run one after each other with <code>wait_time</code> in between.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/post_hoc.jl#L141-L147">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}" href="#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>MRIBuilder.Variables.adjust</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">adjust(block; kwargs...)</code></pre><p>Generate one or more new sequences/building_blocks/components with some post-fitting adjustments.</p><p>The following adjustments are allowed:</p><ul><li>for MR gradients<ul><li><code>orientation</code>: set the orientation to a given vector.</li><li><code>rotation</code>: rotate the gradient orientations using a rotations from <a href="https://juliageometry.github.io/Rotations.jl/stable/"><code>Rotations.jl</code></a>.</li><li><code>scale</code>: multiply the gradient strength by the given value. Note that if you use a value not between -1 and 1 you might break the scanner's maximum gradient or slew rate.</li></ul></li><li>for RF pulses:<ul><li><code>frequency</code>: shift the off-resonance frequency by the given value (in kHz).</li><li><code>scale</code>: multiply the RF pulse amplitude by the given value (used to model the B1 transmit field).</li></ul></li></ul><p>A vector of multiple values can be passed on to any of these in order to create multiple sequences with different adjustments. The will usually be merged together. You can get the individual sequences by passing on <code>merge=false</code>. The time between these repeated sequences can be adjusted using the keywords described in <a href="#MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}"><code>merge_sequences</code></a> passed on to the merge keyword: e.g., <code>merge=(wait_time=10, )</code> adds a wait time of 10 ms between each repeated sequence.</p><p>Specific sequence components that can be adjusted are identified by their <code>group</code> name. For example, <code>adjust(sequence, diffusion=(orientation=[0, 1, 0], ))</code> will set any gradient in the group <code>:diffusion</code> to point in the y-direction.</p><p>To affect all gradients or pulses, use <code>gradient=</code> or <code>pulse</code>, e.g. <code>adjust(sequence, pulse=(scale=0.5, ))</code> will divide the amplitude of all RV pulses by two.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/post_hoc.jl#L12-L37">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../defining_sequence/">« Defining sequences</a><a class="docs-footer-nextpage" href="../scanners/">Scanners »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> +adjust(sequence, FOV=(rotation=rotation, ))</code></pre><p>When repeating the same sequence, a spoiler gradient and/or dead time can be added in between each pair of repeats by supplying the appropriate keywords to the <code>merge</code> parameter in <a href="#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a> (e.g., <code>merge=(wait_time=10., )</code>). These parameters are described in more detail in <a href="#MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}"><code>merge_sequences</code></a>.</p><h2 id="Post-hoc-adjustments-API"><a class="docs-heading-anchor" href="#Post-hoc-adjustments-API">Post-hoc adjustments API</a><a id="Post-hoc-adjustments-API-1"></a><a class="docs-heading-anchor-permalink" href="#Post-hoc-adjustments-API" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.PostHoc" href="#MRIBuilder.PostHoc"><code>MRIBuilder.PostHoc</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define post-fitting adjustments of the sequences</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/post_hoc.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}" href="#MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}"><code>MRIBuilder.PostHoc.merge_sequences</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">merge_sequences(sequences...; wait_time=0.)</code></pre><p>Merge multiple sequences together.</p><p>Sequences will be run one after each other with <code>wait_time</code> in between.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/post_hoc.jl#L141-L147">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}" href="#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>MRIBuilder.Variables.adjust</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">adjust(block; kwargs...)</code></pre><p>Generate one or more new sequences/building_blocks/components with some post-fitting adjustments.</p><p>The following adjustments are allowed:</p><ul><li>for MR gradients<ul><li><code>orientation</code>: set the orientation to a given vector.</li><li><code>rotation</code>: rotate the gradient orientations using a rotations from <a href="https://juliageometry.github.io/Rotations.jl/stable/"><code>Rotations.jl</code></a>.</li><li><code>scale</code>: multiply the gradient strength by the given value. Note that if you use a value not between -1 and 1 you might break the scanner's maximum gradient or slew rate.</li></ul></li><li>for RF pulses:<ul><li><code>frequency</code>: shift the off-resonance frequency by the given value (in kHz).</li><li><code>scale</code>: multiply the RF pulse amplitude by the given value (used to model the B1 transmit field).</li></ul></li></ul><p>A vector of multiple values can be passed on to any of these in order to create multiple sequences with different adjustments. The will usually be merged together. You can get the individual sequences by passing on <code>merge=false</code>. The time between these repeated sequences can be adjusted using the keywords described in <a href="#MRIBuilder.PostHoc.merge_sequences-Tuple{Vararg{Sequence}}"><code>merge_sequences</code></a> passed on to the merge keyword: e.g., <code>merge=(wait_time=10, )</code> adds a wait time of 10 ms between each repeated sequence.</p><p>Specific sequence components that can be adjusted are identified by their <code>group</code> name. For example, <code>adjust(sequence, diffusion=(orientation=[0, 1, 0], ))</code> will set any gradient in the group <code>:diffusion</code> to point in the y-direction.</p><p>To affect all gradients or pulses, use <code>gradient=</code> or <code>pulse</code>, e.g. <code>adjust(sequence, pulse=(scale=0.5, ))</code> will divide the amplitude of all RV pulses by two.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/post_hoc.jl#L12-L37">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../defining_sequence/">« Defining sequences</a><a class="docs-footer-nextpage" href="../scanners/">Scanners »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:04">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> diff --git a/dev/api/index.html b/dev/api/index.html index 403cbddfa8e1f92619dbbf217b4fa7a64d1d6eef..25c20ae4da78a3bf2131a0f9496ee901b4b2dac9 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Internal API · MRIBuilder.jl</title><meta name="title" content="Internal API · MRIBuilder.jl"/><meta property="og:title" content="Internal API · MRIBuilder.jl"/><meta property="twitter:title" content="Internal API · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/api/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/api/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/api/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="../adjust_sequences/">Post-hoc adjustments</a></li><li><a class="tocitem" href="../scanners/">Scanners</a></li><li class="is-active"><a class="tocitem" href>Internal API</a><ul class="internal"><li><a class="tocitem" href="#Type-diagram"><span>Type diagram</span></a></li><li><a class="tocitem" href="#Sequence-components"><span>Sequence components</span></a></li><li><a class="tocitem" href="#Containers-for-sequence-components"><span>Containers for sequence components</span></a></li><li><a class="tocitem" href="#Pre-defined-sequence-parts"><span>Pre-defined sequence parts</span></a></li><li><a class="tocitem" href="#Sequence-I/O"><span>Sequence I/O</span></a></li><li><a class="tocitem" href="#Plot"><span>Plot</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Internal API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Internal API</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/api.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="MRIBuilder.jl-internal-API"><a class="docs-heading-anchor" href="#MRIBuilder.jl-internal-API">MRIBuilder.jl internal API</a><a id="MRIBuilder.jl-internal-API-1"></a><a class="docs-heading-anchor-permalink" href="#MRIBuilder.jl-internal-API" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder" href="#MRIBuilder"><code>MRIBuilder</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Builds and optimises NMR/MRI sequences.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/MRIBuilder.jl#L1-L3">source</a></section></article><h2 id="Type-diagram"><a class="docs-heading-anchor" href="#Type-diagram">Type diagram</a><a id="Type-diagram-1"></a><a class="docs-heading-anchor-permalink" href="#Type-diagram" title="Permalink"></a></h2><pre><code class="nohighlight hljs">AbstractBlock +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Internal API · MRIBuilder.jl</title><meta name="title" content="Internal API · MRIBuilder.jl"/><meta property="og:title" content="Internal API · MRIBuilder.jl"/><meta property="twitter:title" content="Internal API · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/api/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/api/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/api/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="../adjust_sequences/">Post-hoc adjustments</a></li><li><a class="tocitem" href="../scanners/">Scanners</a></li><li class="is-active"><a class="tocitem" href>Internal API</a><ul class="internal"><li><a class="tocitem" href="#Type-diagram"><span>Type diagram</span></a></li><li><a class="tocitem" href="#Sequence-components"><span>Sequence components</span></a></li><li><a class="tocitem" href="#Containers-for-sequence-components"><span>Containers for sequence components</span></a></li><li><a class="tocitem" href="#Pre-defined-sequence-parts"><span>Pre-defined sequence parts</span></a></li><li><a class="tocitem" href="#Sequence-I/O"><span>Sequence I/O</span></a></li><li><a class="tocitem" href="#Plot"><span>Plot</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Internal API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Internal API</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/api.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="MRIBuilder.jl-internal-API"><a class="docs-heading-anchor" href="#MRIBuilder.jl-internal-API">MRIBuilder.jl internal API</a><a id="MRIBuilder.jl-internal-API-1"></a><a class="docs-heading-anchor-permalink" href="#MRIBuilder.jl-internal-API" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder" href="#MRIBuilder"><code>MRIBuilder</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Builds and optimises NMR/MRI sequences.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/MRIBuilder.jl#L1-L3">source</a></section></article><h2 id="Type-diagram"><a class="docs-heading-anchor" href="#Type-diagram">Type diagram</a><a id="Type-diagram-1"></a><a class="docs-heading-anchor-permalink" href="#Type-diagram" title="Permalink"></a></h2><pre><code class="nohighlight hljs">AbstractBlock ├─ ContainerBlock │ ├─ AbstractAlternativeBlocks │ │ └─ AlternativeBlocks @@ -40,13 +40,13 @@ │ │ ├─ ConstantGradient1D │ │ └─ ConstantGradient3D │ └─ NoGradient -└─ Pathway</code></pre><h2 id="Sequence-components"><a class="docs-heading-anchor" href="#Sequence-components">Sequence components</a><a id="Sequence-components-1"></a><a class="docs-heading-anchor-permalink" href="#Sequence-components" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.BaseComponent" href="#MRIBuilder.Components.AbstractTypes.BaseComponent"><code>MRIBuilder.Components.AbstractTypes.BaseComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for all individual components that form an MRI sequence (i.e., RF pulse, gradient waveform, or readout event).</p><p>RF pulses, instant gradients, and readouts are grouped together into <a href="#MRIBuilder.Components.AbstractTypes.EventComponent"><code>EventComponent</code></a>.</p><p>These all should have a <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a> in addition to any other relevant <a href="../sequence_optimisation/#variables"><code>variables</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L4-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.EventComponent" href="#MRIBuilder.Components.AbstractTypes.EventComponent"><code>MRIBuilder.Components.AbstractTypes.EventComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for all RF pulses, instant gradients and readouts that might play out during a gradient waveform.</p><p>These all have an <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a>, which should quantify at what single time one can approximate the RF pulse or readout to have taken place.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L39-L43">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.GradientWaveform" href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>MRIBuilder.Components.AbstractTypes.GradientWaveform</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for all parts of a gradient waveform.</p><p>N should be 1 for a 1D gradient waveform or 3 for a 3D one.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.RFPulseComponent" href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>MRIBuilder.Components.AbstractTypes.RFPulseComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super type for all RF pulses.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L46-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.ReadoutComponent" href="#MRIBuilder.Components.AbstractTypes.ReadoutComponent"><code>MRIBuilder.Components.AbstractTypes.ReadoutComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super type for all readout events.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L93-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.edge_times-Tuple{MRIBuilder.Components.AbstractTypes.BaseComponent}" href="#MRIBuilder.Components.AbstractTypes.edge_times-Tuple{MRIBuilder.Components.AbstractTypes.BaseComponent}"><code>MRIBuilder.Components.AbstractTypes.edge_times</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">edge_times(container/component; tol=1e-6)</code></pre><p>Returns all the edge times during a sequence in ms.</p><p>Edges are defined as any time, when:</p><ul><li>the edge of a building block</li><li>the slope of the gradient profile changes suddenly</li><li>an RF pulse starts or ends</li></ul><p>Edges that are within <code>tol</code> ms of each other are considered to be one edge (default: 1 ns).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L118-L129">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.split_timestep-Tuple{Tuple{Number, MRIBuilder.Components.AbstractTypes.EventComponent}, Number}" href="#MRIBuilder.Components.AbstractTypes.split_timestep-Tuple{Tuple{Number, MRIBuilder.Components.AbstractTypes.EventComponent}, Number}"><code>MRIBuilder.Components.AbstractTypes.split_timestep</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">split_timestep(component, precision)</code></pre><p>Indicates the maximum timestep that a component can be linearised with and still achieve the required <code>precision</code>.</p><p>Typically, this will be determined by the maximum second derivative:</p><p><span>$\sqrt{\frac{2 \epsilon}{max(|d^2y/dx^2|)}}$</span></p><p>It should be infinite if the component is linear.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L99-L109">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.amplitude" href="#MRIBuilder.Variables.variables.amplitude"><code>MRIBuilder.Variables.variables.amplitude</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">amplitude(pulse)</code></pre><p>Return the amplitude of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L65-L69">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bandwidth" href="#MRIBuilder.Variables.variables.bandwidth"><code>MRIBuilder.Variables.variables.bandwidth</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bandwidth(pulse)</code></pre><p>Return the bandwidth of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L86-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flip_angle" href="#MRIBuilder.Variables.variables.flip_angle"><code>MRIBuilder.Variables.variables.flip_angle</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flip_angle(pulse)</code></pre><p>Return the flip angle of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.frequency" href="#MRIBuilder.Variables.variables.frequency"><code>MRIBuilder.Variables.variables.frequency</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">frequency(pulse)</code></pre><p>Return the off-resonance frequency of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L72-L76">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.gradient_strength" href="#MRIBuilder.Variables.variables.gradient_strength"><code>MRIBuilder.Variables.variables.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(gradient)</code></pre><p>Maximum 3D gradient strength of the gradient in kHz/um.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L32-L36">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.phase" href="#MRIBuilder.Variables.variables.phase"><code>MRIBuilder.Variables.variables.phase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">phase(pulse)</code></pre><p>Return the phase of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L58-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slew_rate" href="#MRIBuilder.Variables.variables.slew_rate"><code>MRIBuilder.Variables.variables.slew_rate</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate(gradient)</code></pre><p>Maximum 3D slew rate of the gradient in kHz/um/ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L25-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms" href="#MRIBuilder.Components.GradientWaveforms"><code>MRIBuilder.Components.GradientWaveforms</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Module defining sub-types of the <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a>.</p><p>There are only three types of [<code>GradientBlock</code>] objects:</p><ul><li><a href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient"><code>ChangingGradient</code></a>: any gradient changing linearly in strength.</li><li><a href="#MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient"><code>ConstantGradient</code></a>: any gradient staying constant in strength. These can overlap with a pulse (<code>SliceSelectPulse</code>).</li><li><a href="#MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient"><code>NoGradient</code></a>: any part of the gradient waveform when no gradient is active.</li></ul><p>These parts are combined into a full gradient waveform in a <code>BuildingBlock</code>.</p><p>Each part of this gradient waveform can compute:</p><ul><li><code>gradient_strength</code>: maximum gradient strength in each dimension.</li><li><code>slew_rate</code>: maximum slew rate in each dimension.</li><li><code>qval</code>/<code>qvec</code>: area under curve</li><li><code>bmat_gradient</code>: diffusion weighting (scalar in 1D or matrix in 3D).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/gradient_waveforms/gradient_waveforms.jl#L1-L16">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient" href="#MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient"><code>MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">NoGradient(duration)</code></pre><p>Part of a gradient waveform when there is no gradient active.</p><p>Usually, you do not want to create this object directly, use a <code>BuildingBlock</code> instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/gradient_waveforms/no_gradient_blocks.jl#L7-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient" href="#MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient"><code>MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ConstantGradient(gradient_strength_vector, duration, group=nothing) -ConstantGradient(gradient_strength_scalar, orientation, duration, group=nothing)</code></pre><p>Underlying type for any flat part in a 3D (first constructor) or 3D (second constructor) gradient waveform.</p><p>Usually, you do not want to create this object directly, use a <code>BuildingBlock</code> instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/gradient_waveforms/constant_gradient_blocks.jl#L7-L14">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient" href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient"><code>MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ChangingGradient(grad1_scalar, slew_rate_scalar, orientation, duration, group=nothing) -ChangingGradient(grad1_vec, slew_rate_vec, duration, group=nothing)</code></pre><p>Underlying type for any linearly changing part in a 1D (first constructor) or 3D (second constructor) gradient waveform.</p><p>Usually, you do not want to create this object directly, use a <code>BuildingBlock</code> instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/gradient_waveforms/changing_gradient_blocks.jl#L9-L16">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.split_gradient-Tuple{MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient, Vararg{Union{Number, JuMP.AbstractJuMPScalar}}}" href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.split_gradient-Tuple{MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient, Vararg{Union{Number, JuMP.AbstractJuMPScalar}}}"><code>MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.split_gradient</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">split_gradient(constant/changing_gradient_block, times...)</code></pre><p>Split a single gradient at a given times.</p><p>All times are relative to the start of the gradient block (in ms). Times are assumed to be in increasing order and between 0 and the duration of the gradient block.</p><p>For N times this returns a vector with the N+1 replacement <a href="@ref"><code>ConstantGradient</code></a> or <a href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient"><code>ChangingGradient</code></a> objects.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/gradient_waveforms/changing_gradient_blocks.jl#L93-L102">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.InstantGradients.InstantGradient" href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>MRIBuilder.Components.InstantGradients.InstantGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">InstantGradient(; orientation=nothing, group=nothing, variables...)</code></pre><p>If the <code>orientation</code> is set an <a href="#MRIBuilder.Components.InstantGradients.InstantGradient1D"><code>InstantGradient1D</code></a> is returned, otherwise an <a href="#MRIBuilder.Components.InstantGradients.InstantGradient3D"><code>InstantGradient3D</code></a>.</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code> sets the gradient orientation as a length-3 vector. If not set, the gradient can be in any direction.</li><li><code>group</code>: name of the group to which this gradient belongs (used for scaling and rotating).</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>: Spatial frequency on which spins will be dephased due to this pulsed gradient in rad/um.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.spoiler-sequence_optimisation"><code>variables.spoiler</code></a>: Length-scale on which spins will be dephased by exactly 2Ï€ in mm.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/instant_gradients.jl#L7-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.InstantGradients.InstantGradient1D" href="#MRIBuilder.Components.InstantGradients.InstantGradient1D"><code>MRIBuilder.Components.InstantGradients.InstantGradient1D</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>An <a href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> with a fixed orientation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/instant_gradients.jl#L37-L39">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.InstantGradients.InstantGradient3D" href="#MRIBuilder.Components.InstantGradients.InstantGradient3D"><code>MRIBuilder.Components.InstantGradients.InstantGradient3D</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>An <a href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> with a variable orientation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/instant_gradients.jl#L48-L50">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.GenericPulses.GenericPulse" href="#MRIBuilder.Components.Pulses.GenericPulses.GenericPulse"><code>MRIBuilder.Components.Pulses.GenericPulses.GenericPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">GenericPulse(time, amplitude, phase, effective_time=<halfway>) -GenericPulse(time, amplitude; phase=0., frequency=0., effective_time=<halfway>)</code></pre><p>Create a Pulse profile that has been fully defined by N control point.</p><p>All arguments should be arrays of the same length N defining these control points.</p><p>This pulse has no free variables.</p><ul><li><code>time</code>: time since the start of this <a href="@ref"><code>BuildingBlock</code></a> in ms.</li><li><code>amplitude</code>: amplitude of the RF pulse at every timepoint in kHz.</li><li><code>phase</code>: phase of the RF pulse at every timpoint in degrees. If not set explicitly it will be determined by the provided starting <code>phase</code> (degrees) and the <code>frequency</code> (kHz).</li><li><code>effective_time</code>: the time that the RF pulse should be considered to have taken place when computing a <code>Pathway</code> (defaults: whenever half of the final flip angle has been achieved for on-resonance spins).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/generic_pulses.jl#L8-L22">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.GenericPulses.GenericPulse-Tuple{GenericPulse, Number, Number}" href="#MRIBuilder.Components.Pulses.GenericPulses.GenericPulse-Tuple{GenericPulse, Number, Number}"><code>MRIBuilder.Components.Pulses.GenericPulses.GenericPulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">GenericPulse(pulse, t1, t2)</code></pre><p>Creates a new <a href="#MRIBuilder.Components.Pulses.GenericPulses.GenericPulse"><code>GenericPulse</code></a> by slicing another pulse between <code>t1</code> and <code>t2</code></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/generic_pulses.jl#L44-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.InstantPulses.InstantPulse" href="#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>MRIBuilder.Components.Pulses.InstantPulses.InstantPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">InstantPulse(; flip_angle=nothing, phase=nothing, group=nothing)</code></pre><p>Return an instant RF pulse that rotates all spins by <code>flip_angle</code> around an axis that has an angle of <code>phase</code> with the X-Y plane.</p><p><strong>Parameters</strong></p><ul><li><code>group</code>: name of the group to which this pulse belongs. This is used for scaling or adding phases/off-resonance frequencies.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a>: angle by which spins are rotated in degrees.</li><li><a href="#MRIBuilder.Variables.variables.phase"><code>variables.phase</code></a>: angle of axis around which spins are rotated in degrees.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/instant_pulses.jl#L6-L17">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse" href="#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ConstantPulse(; variables...)</code></pre><p>Represents an radio-frequency pulse with a constant amplitude and frequency (i.e., a rectangular function).</p><p><strong>Parameters</strong></p><ul><li><code>group</code>: name of the group to which this pulse belongs. This is used for scaling or adding phases/off-resonance frequencies.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a>: rotation expected for on-resonance spins in degrees.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: duration of the RF pulse in ms.</li><li><a href="#MRIBuilder.Variables.variables.amplitude"><code>variables.amplitude</code></a>: amplitude of the RF pulse in kHz.</li><li><a href="#MRIBuilder.Variables.variables.phase"><code>variables.phase</code></a>: phase at the start of the RF pulse in degrees.</li><li><a href="#MRIBuilder.Variables.variables.frequency"><code>variables.frequency</code></a>: frequency of the RF pulse relative to the Larmor frequency (in kHz).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/constant_pulses.jl#L7-L21">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.SincPulses.SincPulse" href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>MRIBuilder.Components.Pulses.SincPulses.SincPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SincPulse(; Nzeros=3, apodise=true, variables...)</code></pre><p>Represents a radio-frequency pulse with a sinc-like amplitude and constant frequency.</p><p><strong>Parameters</strong></p><ul><li><code>Nzeros</code>: Number of zero-crossings on each side of the sinc pulse. Can be set to a tuple with two values to have a different number of zero crossings on the left and the right of the sinc pulse.</li><li><code>apodise</code>: if true (default) applies a Hanning apodising window to the sinc pulse.</li><li><code>group</code>: name of the group to which this pulse belongs. This is used for scaling or adding phases/off-resonance frequencies.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a>: rotation expected for on-resonance spins in degrees.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: duration of the RF pulse in ms.</li><li><a href="#MRIBuilder.Variables.variables.amplitude"><code>variables.amplitude</code></a>: amplitude of the RF pulse in kHz.</li><li><a href="#MRIBuilder.Variables.variables.phase"><code>variables.phase</code></a>: phase at the start of the RF pulse in degrees.</li><li><a href="#MRIBuilder.Variables.variables.frequency"><code>variables.frequency</code></a>: frequency of the RF pulse relative to the Larmor frequency (in kHz).</li><li><a href="#MRIBuilder.Variables.variables.bandwidth"><code>variables.bandwidth</code></a>: width of the rectangular function in frequency space (in kHz). If the <code>duration</code> is short (compared with 1/<code>bandwidth</code>), this bandwidth will only be approximate.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L8-L25">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_left" href="#MRIBuilder.Variables.variables.N_left"><code>MRIBuilder.Variables.variables.N_left</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> before the maximum.</p><p>Also, see <a href="#MRIBuilder.Variables.variables.N_right"><code>variables.N_right</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L89-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_right" href="#MRIBuilder.Variables.variables.N_right"><code>MRIBuilder.Variables.variables.N_right</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> after the maximum.</p><p>Also, see <a href="#MRIBuilder.Variables.variables.N_left"><code>variables.N_left</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L98-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.lobe_duration" href="#MRIBuilder.Variables.variables.lobe_duration"><code>MRIBuilder.Variables.variables.lobe_duration</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">lobe_duration(sinc_pulse)</code></pre><p>Time between two zero-crossings of a <a href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.CompositePulses.CompositePulse" href="#MRIBuilder.Components.Pulses.CompositePulses.CompositePulse"><code>MRIBuilder.Components.Pulses.CompositePulses.CompositePulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">CompositePulse(; base_pulse, nweights, variables...)</code></pre><p>A composite RF pulse formed by repeating a base RF pulse.</p><p><strong>Parameters</strong></p><ul><li><code>base_pulse</code>: The base RF pulse that will be repeated.</li><li><code>nweights</code>: The number of repeated pulses. This will be ignored if a vector of <code>weights</code> is explicitly provided.</li></ul><p><strong>Variables</strong></p><ul><li><code>weights</code>: The weight of each of the base RF pulses.</li><li><code>interpulse_delay</code>: Time between the center of the RF pulses. If not otherwise constrained, it will be minimised.</li><li><code>scale_amplitude</code>: How strongly one should scale the amplitude versus the duration to achieve the desired weights. If set to 1 only the RF pulse amplitude will be scaled. If set to 0 only the RF pulse duration will be scaled.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/composite_pulses.jl#L7-L20">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.CompositePulses.BinomialPulse-Tuple{}" href="#MRIBuilder.Components.Pulses.CompositePulses.BinomialPulse-Tuple{}"><code>MRIBuilder.Components.Pulses.CompositePulses.BinomialPulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BinomialPulse(; base_pulse, npulses, flip=true, variables...)</code></pre><p>Creates a <a href="#MRIBuilder.Components.Pulses.CompositePulses.CompositePulse"><code>CompositePulse</code></a> of <code>npulses</code> repeats of <code>base_pulse</code>, where the <code>weights</code> are set by the biomial distribution.</p><p>If <code>flip</code> is true (default) every other pulse will be flipped (so that the total excitation is canceled). The <code>variables</code> are defined in <a href="#MRIBuilder.Components.Pulses.CompositePulses.CompositePulse"><code>CompositePulse</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/composite_pulses.jl#L146-L153">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Readouts.ADCs.ADC" href="#MRIBuilder.Components.Readouts.ADCs.ADC"><code>MRIBuilder.Components.Readouts.ADCs.ADC</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ADC(; center_halfway=true, oversample=1, variables...)</code></pre><p>Adds a readout event.</p><p><strong>Parameters</strong></p><ul><li><code>center_halfway</code>: by default the <code>time_to_center</code> is assumed to be half of the <code>duration</code>. Set this to false to disable this assumption.</li><li><code>oversample</code>: by how much the ADC should oversample (minimum of 1).</li></ul><p><strong>Variables</strong></p><ul><li><code>resolution</code>: number of voxels in the readout direction. This can be a non-integer value during optimisation.</li><li><code>nsamples</code>: number of samples in the readout. This can be a non-integer value during optimisation.</li><li><code>dwell_time</code>: Time between each readout sample in ms.</li><li><code>duration</code>: Total duration of the ADC event in ms.</li><li><code>time_to_center</code>: time till the center of k-space from start of ADC in ms.</li><li><code>effective_time</code>: same as <code>time_to_center</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L8-L24">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.dwell_time" href="#MRIBuilder.Variables.variables.dwell_time"><code>MRIBuilder.Variables.variables.dwell_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">dwell_time(adc)</code></pre><p>The dwell time of the ADC readout in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.nsamples" href="#MRIBuilder.Variables.variables.nsamples"><code>MRIBuilder.Variables.variables.nsamples</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nsamples(adc)</code></pre><p>Number of samples in an ADC.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L89-L93">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.oversample" href="#MRIBuilder.Variables.variables.oversample"><code>MRIBuilder.Variables.variables.oversample</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">oversample(adc)</code></pre><p>The oversampling rate of the ADC readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L59-L63">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.resolution" href="#MRIBuilder.Variables.variables.resolution"><code>MRIBuilder.Variables.variables.resolution</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">resolution(readout)</code></pre><p>Resolution of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L80-L84">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.time_to_center" href="#MRIBuilder.Variables.variables.time_to_center"><code>MRIBuilder.Variables.variables.time_to_center</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">time_to_center(adc)</code></pre><p>The time of the ADC readout to reach the center of k-space.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L73-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout" href="#MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout"><code>MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SingleReadout()</code></pre><p>Represents an instantaneous <code>Readout</code> of the signal.</p><p>It has no parameters or variables to set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/single_readouts.jl#L7-L13">source</a></section></article><h2 id="Containers-for-sequence-components"><a class="docs-heading-anchor" href="#Containers-for-sequence-components">Containers for sequence components</a><a id="Containers-for-sequence-components-1"></a><a class="docs-heading-anchor-permalink" href="#Containers-for-sequence-components" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.ContainerBlock" href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>MRIBuilder.Containers.Abstract.ContainerBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for <code>BuildingBlock</code> or <code>BaseSequence</code>, i.e., any building block that contains other MRI components/blocks.</p><p>Iterate over them to get the individual components.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.amplitude" href="#MRIBuilder.Containers.Abstract.amplitude"><code>MRIBuilder.Containers.Abstract.amplitude</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">amplitude(sequence, time)</code></pre><p>Returns the RF amplitude at a particular time within the sequence in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L61-L65">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}" href="#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>MRIBuilder.Containers.Abstract.end_time</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">end_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>Also see <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>start_time</code></a>, and <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L25-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.frequency" href="#MRIBuilder.Containers.Abstract.frequency"><code>MRIBuilder.Containers.Abstract.frequency</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">frequency(sequence, time)</code></pre><p>Returns the RF frequency at a particular time within the sequence in kHz.</p><p>NaN is returned if there is no pulse activate at that <code>time</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L78-L84">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.gradient_strength" href="#MRIBuilder.Containers.Abstract.gradient_strength"><code>MRIBuilder.Containers.Abstract.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(sequence, time)</code></pre><p>Returns the gradient strength at a particular time within the sequence.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L53-L57">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter-Tuple{ContainerBlock, Val}" href="#MRIBuilder.Containers.Abstract.iter-Tuple{ContainerBlock, Val}"><code>MRIBuilder.Containers.Abstract.iter</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter(sequence, get_type)</code></pre><p>Helper functions for any <code>iter_*</code> functions.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L87-L91">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter_blocks-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.Abstract.iter_blocks-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.Abstract.iter_blocks</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter_blocks(sequence)</code></pre><p>Returns all the building blocks in the sequence with the time they will start</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L99-L103">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter_instant_gradients-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.Abstract.iter_instant_gradients-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.Abstract.iter_instant_gradients</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter_instant_gradients(sequence)</code></pre><p>Returns all the <a href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> within the sequence with their timings</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L114-L118">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter_instant_pulses-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.Abstract.iter_instant_pulses-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.Abstract.iter_instant_pulses</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter_instant_pulses(sequence)</code></pre><p>Returns all the <a href="#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a> within the sequence with their timings</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L106-L110">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.phase" href="#MRIBuilder.Containers.Abstract.phase"><code>MRIBuilder.Containers.Abstract.phase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">phase(sequence, time)</code></pre><p>Returns the RF phase at a particular time within the sequence in degrees.</p><p>NaN is returned if there is no pulse activate at that <code>time</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L69-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}" href="#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>MRIBuilder.Containers.Abstract.start_time</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">start_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>Also see <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>end_time</code></a>, and <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_gradient" href="#MRIBuilder.Variables.get_gradient"><code>MRIBuilder.Variables.get_gradient</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_gradient(container, time)</code></pre><p>Gets the gradient running at a particular <code>time</code> (in ms) during a sequence of building block.</p><p>This function will return a tuple with 2 elements:</p><ol><li>The <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> itself (which could be a <a href="#MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient"><code>NoGradient</code></a> object).</li><li>The time since the start of the gradient</li></ol></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L134-L142">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_pulse" href="#MRIBuilder.Variables.get_pulse"><code>MRIBuilder.Variables.get_pulse</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_pulse(container, time)</code></pre><p>Gets the pulse running at a particular <code>time</code> (in ms) during a sequence of building block.</p><p>If there is a RF pulse, this function will return a tuple with 2 elements:</p><ol><li>The <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> itself</li><li>The time since the start of the pulse</li></ol><p>If there is no active RF pulse, <code>nothing</code> is returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L122-L131">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.effective_time" href="#MRIBuilder.Variables.variables.effective_time"><code>MRIBuilder.Variables.variables.effective_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">effective_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>This will crash if the component does not have an <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a> (e.g., if it is (part of) a gradient waveform).</p><p>Also see <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>start_time</code></a>, and <a href="#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>end_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L41-L49">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.readout_times" href="#MRIBuilder.Variables.variables.readout_times"><code>MRIBuilder.Variables.variables.readout_times</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">readout_times(sequence)</code></pre><p>Returns all the times that the sequence will readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L146-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks" href="#MRIBuilder.Containers.BuildingBlocks"><code>MRIBuilder.Containers.BuildingBlocks</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a>, <a href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a> and <a href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>Wait</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock" href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Basic BuildingBlock, which can consist of a gradient waveforms with any number of RF pulses/readouts overlaid</p><p>Main interface:</p><ul><li>iteration will give the gradient waveforms interspersed by RF pulses/readouts.<ul><li>Indiviual indices can be accessed using <code>keys(building_block)</code></li></ul></li><li><a href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}"><code>waveform_sequence</code></a> returns just the gradient waveform as a sequence of <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> objects.</li><li><a href="#MRIBuilder.Containers.BuildingBlocks.waveform-Tuple{BaseBuildingBlock}"><code>waveform</code></a> returns just the gradient waveform as a sequence of (time, gradient_strength) tuples.</li><li><a href="#MRIBuilder.Containers.BuildingBlocks.events-Tuple{BaseBuildingBlock}"><code>events</code></a> returns the RF pulses and readouts.</li><li><a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> returns area under curve for (part of) the gradient waveform.</li></ul><p>Sub-types need to implement:</p><ul><li><code>Base.keys</code>: returns sequence of keys to all the components.</li><li><code>Base.getindex</code>: returns the actual component for each key. For <code>events</code> (readout/pulses) this should return a tuple with <code>(time delay till start, event)</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L12-L26">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.BuildingBlock" href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>MRIBuilder.Containers.BuildingBlocks.BuildingBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BuildingBlock(waveform, events; duration=nothing, orientation=nothing, group)</code></pre><p>Generic <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a> that can capture any overlapping gradients, RF pulses, and/or readouts. The gradients cannot contain any free variables.</p><p>Scanner constraints are automatically applied.</p><p><strong>Arguments</strong></p><ul><li><code>waveform</code>: Sequence of 2-element tuples with (time, (Gx, Gy, Gz)). If <code>orientation</code> is set then the tuple is expected to look like (time, G). This cannot contain any free variables.</li><li><code>events</code>: Sequence of 2-element tuples with (time, pulse/readout). The <code>time</code> is the start time of the pulse/readout.</li><li><code>duration</code>: duration of this <code>BuildingBlock</code>. If not set then it will be assumed to be the time of the last element in <code>waveform</code>.</li><li><code>orientation</code>: orientation of the gradients in the waveform. If not set, then the full gradient vector should be given explicitly.</li><li><code>group</code>: group of the gradient waveform</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L307-L321">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.BuildingBlock-Tuple{MRIBuilder.Components.AbstractTypes.EventComponent}" href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock-Tuple{MRIBuilder.Components.AbstractTypes.EventComponent}"><code>MRIBuilder.Containers.BuildingBlocks.BuildingBlock</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BuildingBlock(pulse/readout)</code></pre><p>Creates a <code>BuildingBlock</code> with no gradients and just the single [<code>EventComponent</code>]@(ref).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L362-L366">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.Wait" href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>MRIBuilder.Containers.BuildingBlocks.Wait</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>An empty BuildingBlock representing dead time.</p><p>It only has a single variable, namely its <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L406-L410">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.events-Tuple{BaseBuildingBlock}" href="#MRIBuilder.Containers.BuildingBlocks.events-Tuple{BaseBuildingBlock}"><code>MRIBuilder.Containers.BuildingBlocks.events</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">events(building_block)</code></pre><p>Returns just the non-gradient (i.e., RF pulses/readouts) events as a sequence of <a href="#MRIBuilder.Components.AbstractTypes.EventComponent"><code>EventComponent</code></a> objects (with their keys).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L38-L42">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.waveform-Tuple{BaseBuildingBlock}" href="#MRIBuilder.Containers.BuildingBlocks.waveform-Tuple{BaseBuildingBlock}"><code>MRIBuilder.Containers.BuildingBlocks.waveform</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">waveform(building_block)</code></pre><p>Returns the gradient waveform of any <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a> as a sequence of control points.</p><p>Each control point is stored as a tuple with the time in ms and the gradient as a length-3 vector. The gradient is linearly interpolated between these points (see <a href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}"><code>waveform_sequence</code></a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L84-L91">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}" href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}"><code>MRIBuilder.Containers.BuildingBlocks.waveform_sequence</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">waveform_sequence(building_block, first, last)</code></pre><p>Gets the sequence of <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> from the event with key <code>first</code> till the event with key <code>last</code>.</p><p>Setting <code>first</code> to nothing indicates to start from the beginning of the <code>building_block</code>. Similarly, setting <code>last</code> to nothing indicates to continue till the end of the <code>building_block</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L154-L161">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock}" href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock}"><code>MRIBuilder.Containers.BuildingBlocks.waveform_sequence</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">waveform_sequence(building_block)</code></pre><p>Returns just the gradient waveform as a sequence of <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> objects (with their keys).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat_gradient" href="#MRIBuilder.Variables.variables.bmat_gradient"><code>MRIBuilder.Variables.variables.bmat_gradient</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat_gradient(overlapping, qstart[, first_event, last_event])</code></pre><p>Computes the addition to the <a href="../defining_sequence/#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a> contributed by a specific building block or gradient.</p><p><code>qstart</code> represents the <a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> at the start of this component.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L243-L252">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.qvec" href="#MRIBuilder.Variables.variables.qvec"><code>MRIBuilder.Variables.variables.qvec</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">qvec(overlapping[, first_event, last_event])</code></pre><p>Computes the area under the curve for the gradient waveform in <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a>.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L233-L240">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences" href="#MRIBuilder.Containers.BaseSequences"><code>MRIBuilder.Containers.BaseSequences</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a> and <a href="#MRIBuilder.Containers.BaseSequences.Sequence"><code>Sequence</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/base_sequences.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.BaseSequence" href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>MRIBuilder.Containers.BaseSequences.BaseSequence</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type of any sequence of non-overlapping building blocks that should be played after each other.</p><p>It contains <code>N</code> <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> objects (e.g., building blocks or other sequences).</p><p>Main interface:</p><ul><li>Acts as an iterable containing the blocks and sequences.<ul><li>Indiviual blocks/sequences can be obtained using indexing.</li><li>If there is a finite number of repeats, the iteration will continue over all repeats.</li></ul></li></ul><p>Sub-types need to implement:</p><ul><li><code>get_index_single_TR</code>: return the index assuming it is between 1 and N</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/base_sequences.jl#L14-L26">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.Sequence" href="#MRIBuilder.Containers.BaseSequences.Sequence"><code>MRIBuilder.Containers.BaseSequences.Sequence</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Sequence(blocks; name=:Sequence, variables...) -Sequence(blocks...; name=:Sequence, variables...)</code></pre><p>Defines an MRI sequence from a vector of building blocks.</p><p><strong>Arguments</strong></p><ul><li><code>blocks</code>: The actual building blocks that will be played in sequence. All the building blocks must be of type <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>, which means that they cannot only contain actual <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a> objects, but also other <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a> objects. Objects of a different type are converted into a <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> internally:<ul><li>numbers/<code>nothing</code>/<code>:min</code>/<code>:max</code> : replaced with a <a href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>Wait</code></a> block with the appropriate constraint/objective added to its <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>.</li><li>RF pulse or readout: will be embedded within a <a href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a> of the appropriate length</li></ul></li></ul><p>Specific named sequences might define additional variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/base_sequences.jl#L137-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.get_index_single_TR-Tuple{BaseSequence, Integer}" href="#MRIBuilder.Containers.BaseSequences.get_index_single_TR-Tuple{BaseSequence, Integer}"><code>MRIBuilder.Containers.BaseSequences.get_index_single_TR</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_index_single_TR(sequence, index)</code></pre><p>Used internally by any <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a> to get a specific block. The <code>index</code> should be between 1 and N. It should be implemented for any sub-classes of <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/base_sequences.jl#L88-L94">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.nrepeat-Tuple{BaseSequence}" href="#MRIBuilder.Containers.BaseSequences.nrepeat-Tuple{BaseSequence}"><code>MRIBuilder.Containers.BaseSequences.nrepeat</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nrepeat(sequence)</code></pre><p>How often sequence should be repeated. </p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/base_sequences.jl#L98-L102">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.to_block-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.BaseSequences.to_block-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.BaseSequences.to_block</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">to_block(block_like)</code></pre><p>Converst object into something that can be included in the sequence:</p><ul><li>:min/:max/number/variable/nothing => <a href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>Wait</code></a>.</li><li><code>building_block</code> or <code>sequence</code> => no change.</li><li>RF pulse/readout => will be embedded within a <a href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/base_sequences.jl#L201-L208">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks" href="#MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks"><code>MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for all blocks that can take different MR sequence components between multiple repetitions of the sequence.</p><p>They can be extended into their individual components using <code>adjust(<name>=:all)</code>.</p><p>Each subtype of <a href="@ref"><code>AbstractAlternativeBlock</code></a> needs to implement two methods:</p><ul><li><a href="#MRIBuilder.Containers.Alternatives.get_alternatives_name-Tuple{AlternativeBlocks}"><code>get_alternatives_name</code></a>: returns the <code>name</code> used to identify this block in <code>adjust</code></li><li><a href="#MRIBuilder.Containers.Alternatives.get_alternatives_options-Tuple{AlternativeBlocks}"><code>get_alternatives_options</code></a>: returns a dictionary mapping the name of the different options to a <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> with the actual sequence building block.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/alternatives.jl#L7-L15">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.AlternativeBlocks" href="#MRIBuilder.Containers.Alternatives.AlternativeBlocks"><code>MRIBuilder.Containers.Alternatives.AlternativeBlocks</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">AlternativeBlocks(name, blocks)</code></pre><p>Represents a part of the sequence where there are multiple possible alternatives.</p><p>Variables can be matched across these alternatives using <a href="#MRIBuilder.Containers.Alternatives.match_blocks!-Tuple{AbstractAlternativeBlocks, Any}"><code>match_blocks!</code></a>.</p><p>The <code>name</code> is a symbol that is used to identify this <code>AlternativeBlocks</code> in the broader sequence (as in <code>adjust</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/alternatives.jl#L18-L26">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.get_alternatives_name-Tuple{AlternativeBlocks}" href="#MRIBuilder.Containers.Alternatives.get_alternatives_name-Tuple{AlternativeBlocks}"><code>MRIBuilder.Containers.Alternatives.get_alternatives_name</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_alternatives_name(alternative_block)</code></pre><p>Get the name with which any <a href="#MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks"><code>AbstractAlternativeBlocks</code></a> will be identified in a call to <code>adjust</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/alternatives.jl#L34-L38">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.get_alternatives_options-Tuple{AlternativeBlocks}" href="#MRIBuilder.Containers.Alternatives.get_alternatives_options-Tuple{AlternativeBlocks}"><code>MRIBuilder.Containers.Alternatives.get_alternatives_options</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_alternatives_options(alternative_block)</code></pre><p>Get the options available for a <a href="#MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks"><code>AbstractAlternativeBlocks</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/alternatives.jl#L41-L45">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.match_blocks!-Tuple{AbstractAlternativeBlocks, Any}" href="#MRIBuilder.Containers.Alternatives.match_blocks!-Tuple{AbstractAlternativeBlocks, Any}"><code>MRIBuilder.Containers.Alternatives.match_blocks!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">match_blocks!(alternatives, function)</code></pre><p>Matches the outcome of given <code>function</code> on each of the building blocks in <a href="#MRIBuilder.Containers.Alternatives.AlternativeBlocks"><code>AlternativeBlocks</code></a>.</p><p>For example, <code>match_blocks!(alternatives, duration)</code> will ensure that all the alternative building blocks have the same duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/alternatives.jl#L55-L61">source</a></section></article><h2 id="Pre-defined-sequence-parts"><a class="docs-heading-anchor" href="#Pre-defined-sequence-parts">Pre-defined sequence parts</a><a id="Pre-defined-sequence-parts-1"></a><a class="docs-heading-anchor-permalink" href="#Pre-defined-sequence-parts" title="Permalink"></a></h2><p>There are <a href="../defining_sequence/#helper_functions">helper functions</a> available to actually add these to a sequence.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids" href="#MRIBuilder.Parts.Trapezoids"><code>MRIBuilder.Parts.Trapezoids</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines a set of different options for MRI gradients.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.BaseTrapezoid" href="#MRIBuilder.Parts.Trapezoids.BaseTrapezoid"><code>MRIBuilder.Parts.Trapezoids.BaseTrapezoid</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for any <code>BuildingBlock</code> that has a trapezoidal gradient waveform.</p><p>Sub-types:</p><ul><li><a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a></li><li><a href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a></li><li><a href="#MRIBuilder.Parts.Trapezoids.LineReadout"><code>LineReadout</code></a></li></ul><p>The <code>N</code> indicates whether the gradient has a fixed orientation (N=1) or is free (N=3).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L14-L23">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.LineReadout" href="#MRIBuilder.Parts.Trapezoids.LineReadout"><code>MRIBuilder.Parts.Trapezoids.LineReadout</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">LineReadout(adc; ramp_overlap=1., orientation=nothing, group=nothing, variables...)</code></pre><p>Defines a trapezoidal gradient with an ADC readout overlaid.</p><p>Parameters and variables are identical as for <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> with the addition of:</p><p><strong>Parameters</strong></p><ul><li><code>adc</code>: <a href="#MRIBuilder.Components.Readouts.ADCs.ADC"><code>ADC</code></a> object that describes the readout.</li><li><code>ramp_overlap</code>: how much the gradient ramp should overlap with the ADC. 0 for no overlap, 1 for full overlap (default: 1). Can be set to <code>nothing</code> to become a free variable.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>: FOV of the output image along this single k-space line in mm.</li><li><a href="#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>: size of each voxel along this single k-space line in mm.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L239-L253">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.SliceSelect" href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>MRIBuilder.Parts.Trapezoids.SliceSelect</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SliceSelect(pulse; orientation=nothing, group=nothing, variables...)</code></pre><p>Defines a trapezoidal gradient with a pulse played out during the flat time.</p><p>Parameters and variables are identical as for <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> with the addition of:</p><p><strong>Parameters</strong></p><ul><li><code>pulse</code>: sub-type of <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> that describes the RF pulse.</li></ul><p><strong>Variables</strong></p><ul><li><code>slice_thickness</code>: thickness of the selected slice in mm</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L179-L191">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.Trapezoid" href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>MRIBuilder.Parts.Trapezoids.Trapezoid</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Trapezoid(; orientation=nothing, group=nothing, variables...)</code></pre><p>Defines a trapezoidal pulsed gradient</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code> sets the gradient orientation (completely free by default). Can be set to a vector for a fixed orientation.</li><li><code>group</code>: assign the trapezoidal gradient to a specific group. This group will be used to scale or rotate the gradients after optimisation.</li></ul><p><strong>Variables</strong></p><p>Variables can be set during construction or afterwards as an attribute. If not set, they will be determined during the sequence optimisation.</p><p><strong>Timing variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.rise_time"><code>variables.rise_time</code></a>: Time of the gradient to reach from 0 to maximum in ms. If explicitly set to 0, the scanner slew rate will be ignored.</li><li><a href="#MRIBuilder.Variables.variables.flat_time"><code>variables.flat_time</code></a>: Time that the gradient stays at maximum strength in ms.</li><li><a href="#MRIBuilder.Variables.variables.δ"><code>variables.δ</code></a>: effective pulse duration (<code>rise_time</code> + <code>flat_time</code>) in ms.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total pulse duration (2 * <code>rise_time</code> + <code>flat_time</code>) in ms.</li></ul><p><strong>Gradient variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>: Maximum gradient strength achieved during the pulse in kHz/um</li><li><a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>: Spatial scale on which spins will be dephased due to this pulsed gradient in rad/um (given by <code>δ</code> * <code>gradient_strength</code>).</li></ul><p>The <code>bvalue</code> can be constrained for multiple gradient pulses by creating a <code>Pathway</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L26-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.opposite_kspace_lines-Tuple{}" href="#MRIBuilder.Parts.Trapezoids.opposite_kspace_lines-Tuple{}"><code>MRIBuilder.Parts.Trapezoids.opposite_kspace_lines</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">opposite_kspace_lines(; orientation=[1, 0, 0], kwargs...)</code></pre><p>Return a positive and negative readout of a k-space line.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L314-L318">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flat_time" href="#MRIBuilder.Variables.variables.flat_time"><code>MRIBuilder.Variables.variables.flat_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flat_time(trapezoid)</code></pre><p>Returns the flat time of a <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L124-L128">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.fov" href="#MRIBuilder.Variables.variables.fov"><code>MRIBuilder.Variables.variables.fov</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fov(readout)</code></pre><p>Defines the field of view of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L288-L292">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.ramp_overlap" href="#MRIBuilder.Variables.variables.ramp_overlap"><code>MRIBuilder.Variables.variables.ramp_overlap</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ramp_overlap(line_readout)</code></pre><p>Return the fraction of the gradient ramp that overlaps with the ADC readout.</p><p>Set to 0 to ensure that the ADC is only active during the flat time of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L302-L308">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.rise_time" href="#MRIBuilder.Variables.variables.rise_time"><code>MRIBuilder.Variables.variables.rise_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">rise_time(trapezoid)</code></pre><p>Returns the rise time of a <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L117-L121">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slice_thickness" href="#MRIBuilder.Variables.variables.slice_thickness"><code>MRIBuilder.Variables.variables.slice_thickness</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slice_thickness(slice_select)</code></pre><p>Defines the slice thickness for a RF pulse with an active gradient in mm (e.g., <a href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a>).</p><p>Defines as <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation"><code>variables.gradient_strength_norm</code></a>(gradient) / <a href="#MRIBuilder.Variables.variables.bandwidth"><code>variables.bandwidth</code></a>(pulse)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L213-L219">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.voxel_size" href="#MRIBuilder.Variables.variables.voxel_size"><code>MRIBuilder.Variables.variables.voxel_size</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">voxel_size(readout)</code></pre><p>Defines the voxel size of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L295-L299">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.δ" href="#MRIBuilder.Variables.variables.δ"><code>MRIBuilder.Variables.variables.δ</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">δ(trapezoid)</code></pre><p>Returns the effective duration of a <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p><p>Defined as <a href="#MRIBuilder.Variables.variables.rise_time"><code>variables.rise_time</code></a> + <a href="#MRIBuilder.Variables.variables.flat_time"><code>variables.flat_time</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L136-L142">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect" href="#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SpoiltSliceSelect(pulse; parameters..., variables...)</code></pre><p>Adds slice selection to the <code>pulse</code> and surrounds it with spoiler gradients.</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code>: vector with orientation of the slice selection and the spoilers (default: [0, 0, 1])</li><li><code>group</code>: name of the group of the gradient. This will be used to scale and rotate the gradients after optimisation. Scaling is not recommended as this might ruin the spoiling.</li></ul><p><strong>Variables</strong></p><ul><li><code>duration</code>: total duration of the block in ms.</li><li><code>slice_thickness</code>: slice thickness in mm.</li><li><code>spoiler</code>: length scale on which the spoilers achieve 2Ï€ dephasing in mm. This sets the minimum spoiling. If this spoiling level is not achieved by the slice-select gradient alone, then there will be additional gradients added.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/spoilt_slice_selects.jl#L12-L25">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.all_gradient_strengths" href="#MRIBuilder.Variables.variables.all_gradient_strengths"><code>MRIBuilder.Variables.variables.all_gradient_strengths</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">all_gradient_strengths(spoilt_slice_select)</code></pre><p>Returns the gradient strength before, during, and after the pulse in <a href="#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>SpoiltSliceSelect</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/spoilt_slice_selects.jl#L127-L131">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.fall_time" href="#MRIBuilder.Variables.variables.fall_time"><code>MRIBuilder.Variables.variables.fall_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fall_time(spoilt_slice_select)</code></pre><p>Returns the time of the <a href="#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>SpoiltSliceSelect</code></a> to return to zero.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/spoilt_slice_selects.jl#L135-L139">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.SliceSelectRephases.SliceSelectRephase" href="#MRIBuilder.Parts.SliceSelectRephases.SliceSelectRephase"><code>MRIBuilder.Parts.SliceSelectRephases.SliceSelectRephase</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SliceSelectRephase(pulse; kwargs...)</code></pre><p>Creates an excitatory RF pulse with slice selection and a rephasing gradient.</p><p>Parameters are the same as for <a href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/slice_select_rephases.jl#L7-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.EPIReadouts.EPIReadout" href="#MRIBuilder.Parts.EPIReadouts.EPIReadout"><code>MRIBuilder.Parts.EPIReadouts.EPIReadout</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">EPIReadout(; resolution, ky_lines=-resolution[2]:resolution[2], recenter=false, group=:FOV, variables...)</code></pre><p>Defines an (accelerated) EPI readout.</p><p><strong>Parameters</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>: Resolution of the final image in the frequency- and phase-encode directions.</li><li><code>recenter</code>: if true, the signal will be recentred in k-space after the EPI readout.</li><li><code>group</code>: name of the group used to rotate the readout gradients (default: :FOV).</li></ul><p><strong>Variables:</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>: size of the voxel in the frequency- and phase-encode directions.</li><li><a href="#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>: size of the FOV in the frequency- and phase-encode directions.</li><li><a href="#MRIBuilder.Variables.variables.ramp_overlap"><code>variables.ramp_overlap</code></a>: what fraction of the gradient ramp should overlap with the readout.</li><li><a href="#MRIBuilder.Variables.variables.oversample"><code>variables.oversample</code></a>: by how much to oversample in the frequency-encode direcion.</li><li><a href="#MRIBuilder.Variables.variables.dwell_time"><code>variables.dwell_time</code></a>: dwell time in the frequency-encode direction</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/epi_readouts.jl#L8-L24">source</a></section></article><h2 id="Sequence-I/O"><a class="docs-heading-anchor" href="#Sequence-I/O">Sequence I/O</a><a id="Sequence-I/O-1"></a><a class="docs-heading-anchor-permalink" href="#Sequence-I/O" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.Pulseq" href="#MRIBuilder.SequenceIO.Pulseq"><code>MRIBuilder.SequenceIO.Pulseq</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Module converting MRIBuilder sequences to and from sequences recognised by <a href="@ref"><code>PulseqIO</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO" href="#MRIBuilder.SequenceIO.PulseqIO"><code>MRIBuilder.SequenceIO.PulseqIO</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Stand-alone module that reads/writes Pulseq files.</p><p>The pulseq files are read into or written from a set of types that closely match the Pulseq file format. The translation of these types into MRIBuilder types is defined in "../pulseq.jl" (i.e., <code>MRIBuilder.SequenceIO.Pulseq</code>)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/pulseq_io.jl#L1-L6">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.read_pulseq-Tuple{IO}" href="#MRIBuilder.SequenceIO.PulseqIO.read_pulseq-Tuple{IO}"><code>MRIBuilder.SequenceIO.PulseqIO.read_pulseq</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">read_pulseq(IO)</code></pre><p>Reads a sequence from a pulseq file (http://pulseq.github.io/). Pulseq files can be produced using matlab (http://pulseq.github.io/) or python (https://pypulseq.readthedocs.io/en/master/).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/pulseq_io.jl#L20-L25">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.write_pulseq-Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence}" href="#MRIBuilder.SequenceIO.PulseqIO.write_pulseq-Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence}"><code>MRIBuilder.SequenceIO.PulseqIO.write_pulseq</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">write_pulseq(IO, sequence)</code></pre><p>Writes a sequence to an output IO file.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/pulseq_io.jl#L31-L35">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types" href="#MRIBuilder.SequenceIO.PulseqIO.Types"><code>MRIBuilder.SequenceIO.PulseqIO.Types</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define the main types forming a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p><p>Extensions and sections types are defined in their own modules.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L1-L5">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqComponent" href="#MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqComponent"><code>MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for any RF pulses/gradients/ADC/extensions that can play out during a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock"><code>PulseqBlock</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L26-L28">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqGradient" href="#MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqGradient"><code>MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type of Pulseq gradients:</p><ul><li><a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient"><code>PulseqGradient</code></a></li><li><a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid"><code>PulseqTrapezoid</code></a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqADC" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqADC"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqADC</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqADC(num::Int, dwell::Float64, delay::Int, frequency::Number, phase::Number)</code></pre><p>A trapezoidal gradient pulse defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqBlock(duration::Int, rf::PulseqRFPulse, gx::AnyPulseqGradient, gy::AnyPulseqGradient, gz::AnyPulseqGradient, adc::PulseqADC, ext)</code></pre><p>Defines a Building Block with the Pulseq sequence (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p><p>The RF pulse, gradients, and ADC can be set to <code>nothing</code>.</p><p>The <code>ext</code> is a sequence of extension blocks that will be played out. Set this to a sequence of zero length to not have any extensions.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L111-L120">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtension" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtension"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtension</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqExtension(definition::PulseqExtensionDefinition, id::Int)</code></pre><p>Reference to a specific implementation of a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition"><code>PulseqExtensionDefinition</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L101-L105">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqExtensionDefinition(name, content)</code></pre><p>Abstract definition of an unknown Pulseq extension.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L92-L96">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqGradient(amplitude::Number, shape::PulseqShape, time::PulseqShape, delay::int)</code></pre><p>A generic gradient waveform defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L54-L58">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqRFPulse(amplitude::Number, magnitude::PulseqShape, phase::PulseqShape, time::PulseqShape, delay::Int, frequency::Number, phase_offset::Number)</code></pre><p>An RF pulse defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L32-L36">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqSection(:<title>)(lines)</code></pre><p>Represents a section in the pulseq file format.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L8-L12">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqSequence(version::VersionNumber, definitions::NamedTuple, blocks::Vector{PulseqBlock})</code></pre><p>A full sequence defined according to the Pulseq <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L131-L135">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqShape(samples)</code></pre><p>Define the shape of a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse"><code>PulseqRFPulse</code></a> or <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient"><code>PulseqGradient</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L17-L21">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqTrapezoid(amplitude::Number, rise::Int, flat::Int, fall::Int, delay::Int)</code></pre><p>A trapezoidal gradient pulse defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/types.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section" href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section"><code>MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gen_section(sequence, Val(:<title>))</code></pre><p>Creates a specific <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a>{<title>} from a part of the PulseqSequence.</p><p>This is the opposite of <a href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section"><code>parse_section</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/parsers/parsers.jl#L16-L22">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section" href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section"><code>MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_section(section)</code></pre><p>Parses any <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a> and return the appropriate type.</p><p>The opposite is <a href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section"><code>gen_section</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/parsers/parsers.jl#L6-L12">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_dict-Tuple{Any, Any, Any}" href="#MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_dict-Tuple{Any, Any, Any}"><code>MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_dict</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_pulseq_dict(line, names, dtypes)</code></pre><p>Parse a line of integers/floats with known names and dtypes.</p><p>This is useful to parse most of the columnar data in Pulseq, such as in BLOCKS, RF, GRADIENTS, etc.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/basic_parsers.jl#L3-L9">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_properties-Tuple{Vector{<:AbstractString}}" href="#MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_properties-Tuple{Vector{<:AbstractString}}"><code>MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_properties</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_pulseq_properties(lines)</code></pre><p>Parse any <code>pulseq</code> section formatted as:</p><pre><code class="nohighlight hljs"><name> <value> +└─ Pathway</code></pre><h2 id="Sequence-components"><a class="docs-heading-anchor" href="#Sequence-components">Sequence components</a><a id="Sequence-components-1"></a><a class="docs-heading-anchor-permalink" href="#Sequence-components" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.BaseComponent" href="#MRIBuilder.Components.AbstractTypes.BaseComponent"><code>MRIBuilder.Components.AbstractTypes.BaseComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for all individual components that form an MRI sequence (i.e., RF pulse, gradient waveform, or readout event).</p><p>RF pulses, instant gradients, and readouts are grouped together into <a href="#MRIBuilder.Components.AbstractTypes.EventComponent"><code>EventComponent</code></a>.</p><p>These all should have a <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a> in addition to any other relevant <a href="../sequence_optimisation/#variables"><code>variables</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L4-L10">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.EventComponent" href="#MRIBuilder.Components.AbstractTypes.EventComponent"><code>MRIBuilder.Components.AbstractTypes.EventComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for all RF pulses, instant gradients and readouts that might play out during a gradient waveform.</p><p>These all have an <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a>, which should quantify at what single time one can approximate the RF pulse or readout to have taken place.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L39-L43">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.GradientWaveform" href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>MRIBuilder.Components.AbstractTypes.GradientWaveform</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for all parts of a gradient waveform.</p><p>N should be 1 for a 1D gradient waveform or 3 for a 3D one.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.RFPulseComponent" href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>MRIBuilder.Components.AbstractTypes.RFPulseComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super type for all RF pulses.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L46-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.ReadoutComponent" href="#MRIBuilder.Components.AbstractTypes.ReadoutComponent"><code>MRIBuilder.Components.AbstractTypes.ReadoutComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super type for all readout events.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L93-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.edge_times-Tuple{MRIBuilder.Components.AbstractTypes.BaseComponent}" href="#MRIBuilder.Components.AbstractTypes.edge_times-Tuple{MRIBuilder.Components.AbstractTypes.BaseComponent}"><code>MRIBuilder.Components.AbstractTypes.edge_times</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">edge_times(container/component; tol=1e-6)</code></pre><p>Returns all the edge times during a sequence in ms.</p><p>Edges are defined as any time, when:</p><ul><li>the edge of a building block</li><li>the slope of the gradient profile changes suddenly</li><li>an RF pulse starts or ends</li></ul><p>Edges that are within <code>tol</code> ms of each other are considered to be one edge (default: 1 ns).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L118-L129">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.AbstractTypes.split_timestep-Tuple{Tuple{Number, MRIBuilder.Components.AbstractTypes.EventComponent}, Number}" href="#MRIBuilder.Components.AbstractTypes.split_timestep-Tuple{Tuple{Number, MRIBuilder.Components.AbstractTypes.EventComponent}, Number}"><code>MRIBuilder.Components.AbstractTypes.split_timestep</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">split_timestep(component, precision)</code></pre><p>Indicates the maximum timestep that a component can be linearised with and still achieve the required <code>precision</code>.</p><p>Typically, this will be determined by the maximum second derivative:</p><p><span>$\sqrt{\frac{2 \epsilon}{max(|d^2y/dx^2|)}}$</span></p><p>It should be infinite if the component is linear.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L99-L109">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.amplitude" href="#MRIBuilder.Variables.variables.amplitude"><code>MRIBuilder.Variables.variables.amplitude</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">amplitude(pulse)</code></pre><p>Return the amplitude of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L65-L69">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bandwidth" href="#MRIBuilder.Variables.variables.bandwidth"><code>MRIBuilder.Variables.variables.bandwidth</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bandwidth(pulse)</code></pre><p>Return the bandwidth of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L86-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flip_angle" href="#MRIBuilder.Variables.variables.flip_angle"><code>MRIBuilder.Variables.variables.flip_angle</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flip_angle(pulse)</code></pre><p>Return the flip angle of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.frequency" href="#MRIBuilder.Variables.variables.frequency"><code>MRIBuilder.Variables.variables.frequency</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">frequency(pulse)</code></pre><p>Return the off-resonance frequency of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L72-L76">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.gradient_strength" href="#MRIBuilder.Variables.variables.gradient_strength"><code>MRIBuilder.Variables.variables.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(gradient)</code></pre><p>Maximum 3D gradient strength of the gradient in kHz/um.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L32-L36">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.phase" href="#MRIBuilder.Variables.variables.phase"><code>MRIBuilder.Variables.variables.phase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">phase(pulse)</code></pre><p>Return the phase of an <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L58-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slew_rate" href="#MRIBuilder.Variables.variables.slew_rate"><code>MRIBuilder.Variables.variables.slew_rate</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate(gradient)</code></pre><p>Maximum 3D slew rate of the gradient in kHz/um/ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L25-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms" href="#MRIBuilder.Components.GradientWaveforms"><code>MRIBuilder.Components.GradientWaveforms</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Module defining sub-types of the <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a>.</p><p>There are only three types of [<code>GradientBlock</code>] objects:</p><ul><li><a href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient"><code>ChangingGradient</code></a>: any gradient changing linearly in strength.</li><li><a href="#MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient"><code>ConstantGradient</code></a>: any gradient staying constant in strength. These can overlap with a pulse (<code>SliceSelectPulse</code>).</li><li><a href="#MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient"><code>NoGradient</code></a>: any part of the gradient waveform when no gradient is active.</li></ul><p>These parts are combined into a full gradient waveform in a <code>BuildingBlock</code>.</p><p>Each part of this gradient waveform can compute:</p><ul><li><code>gradient_strength</code>: maximum gradient strength in each dimension.</li><li><code>slew_rate</code>: maximum slew rate in each dimension.</li><li><code>qval</code>/<code>qvec</code>: area under curve</li><li><code>bmat_gradient</code>: diffusion weighting (scalar in 1D or matrix in 3D).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/gradient_waveforms/gradient_waveforms.jl#L1-L16">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient" href="#MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient"><code>MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">NoGradient(duration)</code></pre><p>Part of a gradient waveform when there is no gradient active.</p><p>Usually, you do not want to create this object directly, use a <code>BuildingBlock</code> instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/gradient_waveforms/no_gradient_blocks.jl#L7-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient" href="#MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient"><code>MRIBuilder.Components.GradientWaveforms.ConstantGradientBlocks.ConstantGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ConstantGradient(gradient_strength_vector, duration, group=nothing) +ConstantGradient(gradient_strength_scalar, orientation, duration, group=nothing)</code></pre><p>Underlying type for any flat part in a 3D (first constructor) or 3D (second constructor) gradient waveform.</p><p>Usually, you do not want to create this object directly, use a <code>BuildingBlock</code> instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/gradient_waveforms/constant_gradient_blocks.jl#L7-L14">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient" href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient"><code>MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ChangingGradient(grad1_scalar, slew_rate_scalar, orientation, duration, group=nothing) +ChangingGradient(grad1_vec, slew_rate_vec, duration, group=nothing)</code></pre><p>Underlying type for any linearly changing part in a 1D (first constructor) or 3D (second constructor) gradient waveform.</p><p>Usually, you do not want to create this object directly, use a <code>BuildingBlock</code> instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/gradient_waveforms/changing_gradient_blocks.jl#L9-L16">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.split_gradient-Tuple{MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient, Vararg{Union{Number, JuMP.AbstractJuMPScalar}}}" href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.split_gradient-Tuple{MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient, Vararg{Union{Number, JuMP.AbstractJuMPScalar}}}"><code>MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.split_gradient</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">split_gradient(constant/changing_gradient_block, times...)</code></pre><p>Split a single gradient at a given times.</p><p>All times are relative to the start of the gradient block (in ms). Times are assumed to be in increasing order and between 0 and the duration of the gradient block.</p><p>For N times this returns a vector with the N+1 replacement <a href="@ref"><code>ConstantGradient</code></a> or <a href="#MRIBuilder.Components.GradientWaveforms.ChangingGradientBlocks.ChangingGradient"><code>ChangingGradient</code></a> objects.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/gradient_waveforms/changing_gradient_blocks.jl#L93-L102">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.InstantGradients.InstantGradient" href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>MRIBuilder.Components.InstantGradients.InstantGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">InstantGradient(; orientation=nothing, group=nothing, variables...)</code></pre><p>If the <code>orientation</code> is set an <a href="#MRIBuilder.Components.InstantGradients.InstantGradient1D"><code>InstantGradient1D</code></a> is returned, otherwise an <a href="#MRIBuilder.Components.InstantGradients.InstantGradient3D"><code>InstantGradient3D</code></a>.</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code> sets the gradient orientation as a length-3 vector. If not set, the gradient can be in any direction.</li><li><code>group</code>: name of the group to which this gradient belongs (used for scaling and rotating).</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>: Spatial frequency on which spins will be dephased due to this pulsed gradient in rad/um.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.spoiler-sequence_optimisation"><code>variables.spoiler</code></a>: Length-scale on which spins will be dephased by exactly 2Ï€ in mm.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/instant_gradients.jl#L7-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.InstantGradients.InstantGradient1D" href="#MRIBuilder.Components.InstantGradients.InstantGradient1D"><code>MRIBuilder.Components.InstantGradients.InstantGradient1D</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>An <a href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> with a fixed orientation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/instant_gradients.jl#L37-L39">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.InstantGradients.InstantGradient3D" href="#MRIBuilder.Components.InstantGradients.InstantGradient3D"><code>MRIBuilder.Components.InstantGradients.InstantGradient3D</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>An <a href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> with a variable orientation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/instant_gradients.jl#L48-L50">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.GenericPulses.GenericPulse" href="#MRIBuilder.Components.Pulses.GenericPulses.GenericPulse"><code>MRIBuilder.Components.Pulses.GenericPulses.GenericPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">GenericPulse(time, amplitude, phase, effective_time=<halfway>) +GenericPulse(time, amplitude; phase=0., frequency=0., effective_time=<halfway>)</code></pre><p>Create a Pulse profile that has been fully defined by N control point.</p><p>All arguments should be arrays of the same length N defining these control points.</p><p>This pulse has no free variables.</p><ul><li><code>time</code>: time since the start of this <a href="@ref"><code>BuildingBlock</code></a> in ms.</li><li><code>amplitude</code>: amplitude of the RF pulse at every timepoint in kHz.</li><li><code>phase</code>: phase of the RF pulse at every timpoint in degrees. If not set explicitly it will be determined by the provided starting <code>phase</code> (degrees) and the <code>frequency</code> (kHz).</li><li><code>effective_time</code>: the time that the RF pulse should be considered to have taken place when computing a <code>Pathway</code> (defaults: whenever half of the final flip angle has been achieved for on-resonance spins).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/generic_pulses.jl#L8-L22">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.GenericPulses.GenericPulse-Tuple{GenericPulse, Number, Number}" href="#MRIBuilder.Components.Pulses.GenericPulses.GenericPulse-Tuple{GenericPulse, Number, Number}"><code>MRIBuilder.Components.Pulses.GenericPulses.GenericPulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">GenericPulse(pulse, t1, t2)</code></pre><p>Creates a new <a href="#MRIBuilder.Components.Pulses.GenericPulses.GenericPulse"><code>GenericPulse</code></a> by slicing another pulse between <code>t1</code> and <code>t2</code></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/generic_pulses.jl#L44-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.InstantPulses.InstantPulse" href="#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>MRIBuilder.Components.Pulses.InstantPulses.InstantPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">InstantPulse(; flip_angle=nothing, phase=nothing, group=nothing)</code></pre><p>Return an instant RF pulse that rotates all spins by <code>flip_angle</code> around an axis that has an angle of <code>phase</code> with the X-Y plane.</p><p><strong>Parameters</strong></p><ul><li><code>group</code>: name of the group to which this pulse belongs. This is used for scaling or adding phases/off-resonance frequencies.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a>: angle by which spins are rotated in degrees.</li><li><a href="#MRIBuilder.Variables.variables.phase"><code>variables.phase</code></a>: angle of axis around which spins are rotated in degrees.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/instant_pulses.jl#L6-L17">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse" href="#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ConstantPulse(; variables...)</code></pre><p>Represents an radio-frequency pulse with a constant amplitude and frequency (i.e., a rectangular function).</p><p><strong>Parameters</strong></p><ul><li><code>group</code>: name of the group to which this pulse belongs. This is used for scaling or adding phases/off-resonance frequencies.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a>: rotation expected for on-resonance spins in degrees.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: duration of the RF pulse in ms.</li><li><a href="#MRIBuilder.Variables.variables.amplitude"><code>variables.amplitude</code></a>: amplitude of the RF pulse in kHz.</li><li><a href="#MRIBuilder.Variables.variables.phase"><code>variables.phase</code></a>: phase at the start of the RF pulse in degrees.</li><li><a href="#MRIBuilder.Variables.variables.frequency"><code>variables.frequency</code></a>: frequency of the RF pulse relative to the Larmor frequency (in kHz).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/constant_pulses.jl#L7-L21">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.SincPulses.SincPulse" href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>MRIBuilder.Components.Pulses.SincPulses.SincPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SincPulse(; Nzeros=3, apodise=true, variables...)</code></pre><p>Represents a radio-frequency pulse with a sinc-like amplitude and constant frequency.</p><p><strong>Parameters</strong></p><ul><li><code>Nzeros</code>: Number of zero-crossings on each side of the sinc pulse. Can be set to a tuple with two values to have a different number of zero crossings on the left and the right of the sinc pulse.</li><li><code>apodise</code>: if true (default) applies a Hanning apodising window to the sinc pulse.</li><li><code>group</code>: name of the group to which this pulse belongs. This is used for scaling or adding phases/off-resonance frequencies.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a>: rotation expected for on-resonance spins in degrees.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: duration of the RF pulse in ms.</li><li><a href="#MRIBuilder.Variables.variables.amplitude"><code>variables.amplitude</code></a>: amplitude of the RF pulse in kHz.</li><li><a href="#MRIBuilder.Variables.variables.phase"><code>variables.phase</code></a>: phase at the start of the RF pulse in degrees.</li><li><a href="#MRIBuilder.Variables.variables.frequency"><code>variables.frequency</code></a>: frequency of the RF pulse relative to the Larmor frequency (in kHz).</li><li><a href="#MRIBuilder.Variables.variables.bandwidth"><code>variables.bandwidth</code></a>: width of the rectangular function in frequency space (in kHz). If the <code>duration</code> is short (compared with 1/<code>bandwidth</code>), this bandwidth will only be approximate.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L8-L25">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_left" href="#MRIBuilder.Variables.variables.N_left"><code>MRIBuilder.Variables.variables.N_left</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> before the maximum.</p><p>Also, see <a href="#MRIBuilder.Variables.variables.N_right"><code>variables.N_right</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L89-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_right" href="#MRIBuilder.Variables.variables.N_right"><code>MRIBuilder.Variables.variables.N_right</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> after the maximum.</p><p>Also, see <a href="#MRIBuilder.Variables.variables.N_left"><code>variables.N_left</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L98-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.lobe_duration" href="#MRIBuilder.Variables.variables.lobe_duration"><code>MRIBuilder.Variables.variables.lobe_duration</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">lobe_duration(sinc_pulse)</code></pre><p>Time between two zero-crossings of a <a href="#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.CompositePulses.CompositePulse" href="#MRIBuilder.Components.Pulses.CompositePulses.CompositePulse"><code>MRIBuilder.Components.Pulses.CompositePulses.CompositePulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">CompositePulse(; base_pulse, nweights, variables...)</code></pre><p>A composite RF pulse formed by repeating a base RF pulse.</p><p><strong>Parameters</strong></p><ul><li><code>base_pulse</code>: The base RF pulse that will be repeated.</li><li><code>nweights</code>: The number of repeated pulses. This will be ignored if a vector of <code>weights</code> is explicitly provided.</li></ul><p><strong>Variables</strong></p><ul><li><code>weights</code>: The weight of each of the base RF pulses.</li><li><code>interpulse_delay</code>: Time between the center of the RF pulses. If not otherwise constrained, it will be minimised.</li><li><code>scale_amplitude</code>: How strongly one should scale the amplitude versus the duration to achieve the desired weights. If set to 1 only the RF pulse amplitude will be scaled. If set to 0 only the RF pulse duration will be scaled.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/composite_pulses.jl#L7-L20">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Pulses.CompositePulses.BinomialPulse-Tuple{}" href="#MRIBuilder.Components.Pulses.CompositePulses.BinomialPulse-Tuple{}"><code>MRIBuilder.Components.Pulses.CompositePulses.BinomialPulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BinomialPulse(; base_pulse, npulses, flip=true, variables...)</code></pre><p>Creates a <a href="#MRIBuilder.Components.Pulses.CompositePulses.CompositePulse"><code>CompositePulse</code></a> of <code>npulses</code> repeats of <code>base_pulse</code>, where the <code>weights</code> are set by the biomial distribution.</p><p>If <code>flip</code> is true (default) every other pulse will be flipped (so that the total excitation is canceled). The <code>variables</code> are defined in <a href="#MRIBuilder.Components.Pulses.CompositePulses.CompositePulse"><code>CompositePulse</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/composite_pulses.jl#L146-L153">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Readouts.ADCs.ADC" href="#MRIBuilder.Components.Readouts.ADCs.ADC"><code>MRIBuilder.Components.Readouts.ADCs.ADC</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ADC(; center_halfway=true, oversample=1, variables...)</code></pre><p>Adds a readout event.</p><p><strong>Parameters</strong></p><ul><li><code>center_halfway</code>: by default the <code>time_to_center</code> is assumed to be half of the <code>duration</code>. Set this to false to disable this assumption.</li><li><code>oversample</code>: by how much the ADC should oversample (minimum of 1).</li></ul><p><strong>Variables</strong></p><ul><li><code>resolution</code>: number of voxels in the readout direction. This can be a non-integer value during optimisation.</li><li><code>nsamples</code>: number of samples in the readout. This can be a non-integer value during optimisation.</li><li><code>dwell_time</code>: Time between each readout sample in ms.</li><li><code>duration</code>: Total duration of the ADC event in ms.</li><li><code>time_to_center</code>: time till the center of k-space from start of ADC in ms.</li><li><code>effective_time</code>: same as <code>time_to_center</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L8-L24">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.dwell_time" href="#MRIBuilder.Variables.variables.dwell_time"><code>MRIBuilder.Variables.variables.dwell_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">dwell_time(adc)</code></pre><p>The dwell time of the ADC readout in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.nsamples" href="#MRIBuilder.Variables.variables.nsamples"><code>MRIBuilder.Variables.variables.nsamples</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nsamples(adc)</code></pre><p>Number of samples in an ADC.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L89-L93">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.oversample" href="#MRIBuilder.Variables.variables.oversample"><code>MRIBuilder.Variables.variables.oversample</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">oversample(adc)</code></pre><p>The oversampling rate of the ADC readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L59-L63">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.resolution" href="#MRIBuilder.Variables.variables.resolution"><code>MRIBuilder.Variables.variables.resolution</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">resolution(readout)</code></pre><p>Resolution of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L80-L84">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.time_to_center" href="#MRIBuilder.Variables.variables.time_to_center"><code>MRIBuilder.Variables.variables.time_to_center</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">time_to_center(adc)</code></pre><p>The time of the ADC readout to reach the center of k-space.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L73-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout" href="#MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout"><code>MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SingleReadout()</code></pre><p>Represents an instantaneous <code>Readout</code> of the signal.</p><p>It has no parameters or variables to set.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/single_readouts.jl#L7-L13">source</a></section></article><h2 id="Containers-for-sequence-components"><a class="docs-heading-anchor" href="#Containers-for-sequence-components">Containers for sequence components</a><a id="Containers-for-sequence-components-1"></a><a class="docs-heading-anchor-permalink" href="#Containers-for-sequence-components" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.ContainerBlock" href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>MRIBuilder.Containers.Abstract.ContainerBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for <code>BuildingBlock</code> or <code>BaseSequence</code>, i.e., any building block that contains other MRI components/blocks.</p><p>Iterate over them to get the individual components.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.amplitude" href="#MRIBuilder.Containers.Abstract.amplitude"><code>MRIBuilder.Containers.Abstract.amplitude</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">amplitude(sequence, time)</code></pre><p>Returns the RF amplitude at a particular time within the sequence in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L61-L65">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}" href="#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>MRIBuilder.Containers.Abstract.end_time</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">end_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>Also see <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>start_time</code></a>, and <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L25-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.frequency" href="#MRIBuilder.Containers.Abstract.frequency"><code>MRIBuilder.Containers.Abstract.frequency</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">frequency(sequence, time)</code></pre><p>Returns the RF frequency at a particular time within the sequence in kHz.</p><p>NaN is returned if there is no pulse activate at that <code>time</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L78-L84">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.gradient_strength" href="#MRIBuilder.Containers.Abstract.gradient_strength"><code>MRIBuilder.Containers.Abstract.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(sequence, time)</code></pre><p>Returns the gradient strength at a particular time within the sequence.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L53-L57">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter-Tuple{ContainerBlock, Val}" href="#MRIBuilder.Containers.Abstract.iter-Tuple{ContainerBlock, Val}"><code>MRIBuilder.Containers.Abstract.iter</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter(sequence, get_type)</code></pre><p>Helper functions for any <code>iter_*</code> functions.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L87-L91">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter_blocks-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.Abstract.iter_blocks-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.Abstract.iter_blocks</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter_blocks(sequence)</code></pre><p>Returns all the building blocks in the sequence with the time they will start</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L99-L103">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter_instant_gradients-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.Abstract.iter_instant_gradients-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.Abstract.iter_instant_gradients</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter_instant_gradients(sequence)</code></pre><p>Returns all the <a href="#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> within the sequence with their timings</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L114-L118">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.iter_instant_pulses-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.Abstract.iter_instant_pulses-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.Abstract.iter_instant_pulses</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iter_instant_pulses(sequence)</code></pre><p>Returns all the <a href="#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a> within the sequence with their timings</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L106-L110">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.phase" href="#MRIBuilder.Containers.Abstract.phase"><code>MRIBuilder.Containers.Abstract.phase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">phase(sequence, time)</code></pre><p>Returns the RF phase at a particular time within the sequence in degrees.</p><p>NaN is returned if there is no pulse activate at that <code>time</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L69-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}" href="#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>MRIBuilder.Containers.Abstract.start_time</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">start_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>Also see <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>end_time</code></a>, and <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L13-L19">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_gradient" href="#MRIBuilder.Variables.get_gradient"><code>MRIBuilder.Variables.get_gradient</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_gradient(container, time)</code></pre><p>Gets the gradient running at a particular <code>time</code> (in ms) during a sequence of building block.</p><p>This function will return a tuple with 2 elements:</p><ol><li>The <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> itself (which could be a <a href="#MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient"><code>NoGradient</code></a> object).</li><li>The time since the start of the gradient</li></ol></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L134-L142">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_pulse" href="#MRIBuilder.Variables.get_pulse"><code>MRIBuilder.Variables.get_pulse</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_pulse(container, time)</code></pre><p>Gets the pulse running at a particular <code>time</code> (in ms) during a sequence of building block.</p><p>If there is a RF pulse, this function will return a tuple with 2 elements:</p><ol><li>The <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> itself</li><li>The time since the start of the pulse</li></ol><p>If there is no active RF pulse, <code>nothing</code> is returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L122-L131">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.effective_time" href="#MRIBuilder.Variables.variables.effective_time"><code>MRIBuilder.Variables.variables.effective_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">effective_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>This will crash if the component does not have an <a href="#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a> (e.g., if it is (part of) a gradient waveform).</p><p>Also see <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>start_time</code></a>, and <a href="#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>end_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L41-L49">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.readout_times" href="#MRIBuilder.Variables.variables.readout_times"><code>MRIBuilder.Variables.variables.readout_times</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">readout_times(sequence)</code></pre><p>Returns all the times that the sequence will readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L146-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks" href="#MRIBuilder.Containers.BuildingBlocks"><code>MRIBuilder.Containers.BuildingBlocks</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a>, <a href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a> and <a href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>Wait</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock" href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Basic BuildingBlock, which can consist of a gradient waveforms with any number of RF pulses/readouts overlaid</p><p>Main interface:</p><ul><li>iteration will give the gradient waveforms interspersed by RF pulses/readouts.<ul><li>Indiviual indices can be accessed using <code>keys(building_block)</code></li></ul></li><li><a href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}"><code>waveform_sequence</code></a> returns just the gradient waveform as a sequence of <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> objects.</li><li><a href="#MRIBuilder.Containers.BuildingBlocks.waveform-Tuple{BaseBuildingBlock}"><code>waveform</code></a> returns just the gradient waveform as a sequence of (time, gradient_strength) tuples.</li><li><a href="#MRIBuilder.Containers.BuildingBlocks.events-Tuple{BaseBuildingBlock}"><code>events</code></a> returns the RF pulses and readouts.</li><li><a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> returns area under curve for (part of) the gradient waveform.</li></ul><p>Sub-types need to implement:</p><ul><li><code>Base.keys</code>: returns sequence of keys to all the components.</li><li><code>Base.getindex</code>: returns the actual component for each key. For <code>events</code> (readout/pulses) this should return a tuple with <code>(time delay till start, event)</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L12-L26">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.BuildingBlock" href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>MRIBuilder.Containers.BuildingBlocks.BuildingBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BuildingBlock(waveform, events; duration=nothing, orientation=nothing, group)</code></pre><p>Generic <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a> that can capture any overlapping gradients, RF pulses, and/or readouts. The gradients cannot contain any free variables.</p><p>Scanner constraints are automatically applied.</p><p><strong>Arguments</strong></p><ul><li><code>waveform</code>: Sequence of 2-element tuples with (time, (Gx, Gy, Gz)). If <code>orientation</code> is set then the tuple is expected to look like (time, G). This cannot contain any free variables.</li><li><code>events</code>: Sequence of 2-element tuples with (time, pulse/readout). The <code>time</code> is the start time of the pulse/readout.</li><li><code>duration</code>: duration of this <code>BuildingBlock</code>. If not set then it will be assumed to be the time of the last element in <code>waveform</code>.</li><li><code>orientation</code>: orientation of the gradients in the waveform. If not set, then the full gradient vector should be given explicitly.</li><li><code>group</code>: group of the gradient waveform</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L307-L321">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.BuildingBlock-Tuple{MRIBuilder.Components.AbstractTypes.EventComponent}" href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock-Tuple{MRIBuilder.Components.AbstractTypes.EventComponent}"><code>MRIBuilder.Containers.BuildingBlocks.BuildingBlock</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">BuildingBlock(pulse/readout)</code></pre><p>Creates a <code>BuildingBlock</code> with no gradients and just the single [<code>EventComponent</code>]@(ref).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L362-L366">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.Wait" href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>MRIBuilder.Containers.BuildingBlocks.Wait</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>An empty BuildingBlock representing dead time.</p><p>It only has a single variable, namely its <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L406-L410">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.events-Tuple{BaseBuildingBlock}" href="#MRIBuilder.Containers.BuildingBlocks.events-Tuple{BaseBuildingBlock}"><code>MRIBuilder.Containers.BuildingBlocks.events</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">events(building_block)</code></pre><p>Returns just the non-gradient (i.e., RF pulses/readouts) events as a sequence of <a href="#MRIBuilder.Components.AbstractTypes.EventComponent"><code>EventComponent</code></a> objects (with their keys).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L38-L42">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.waveform-Tuple{BaseBuildingBlock}" href="#MRIBuilder.Containers.BuildingBlocks.waveform-Tuple{BaseBuildingBlock}"><code>MRIBuilder.Containers.BuildingBlocks.waveform</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">waveform(building_block)</code></pre><p>Returns the gradient waveform of any <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a> as a sequence of control points.</p><p>Each control point is stored as a tuple with the time in ms and the gradient as a length-3 vector. The gradient is linearly interpolated between these points (see <a href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}"><code>waveform_sequence</code></a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L84-L91">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}" href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock, Any, Any}"><code>MRIBuilder.Containers.BuildingBlocks.waveform_sequence</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">waveform_sequence(building_block, first, last)</code></pre><p>Gets the sequence of <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> from the event with key <code>first</code> till the event with key <code>last</code>.</p><p>Setting <code>first</code> to nothing indicates to start from the beginning of the <code>building_block</code>. Similarly, setting <code>last</code> to nothing indicates to continue till the end of the <code>building_block</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L154-L161">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock}" href="#MRIBuilder.Containers.BuildingBlocks.waveform_sequence-Tuple{BaseBuildingBlock}"><code>MRIBuilder.Containers.BuildingBlocks.waveform_sequence</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">waveform_sequence(building_block)</code></pre><p>Returns just the gradient waveform as a sequence of <a href="#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a> objects (with their keys).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat_gradient" href="#MRIBuilder.Variables.variables.bmat_gradient"><code>MRIBuilder.Variables.variables.bmat_gradient</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat_gradient(overlapping, qstart[, first_event, last_event])</code></pre><p>Computes the addition to the <a href="../defining_sequence/#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a> contributed by a specific building block or gradient.</p><p><code>qstart</code> represents the <a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> at the start of this component.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L243-L252">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.qvec" href="#MRIBuilder.Variables.variables.qvec"><code>MRIBuilder.Variables.variables.qvec</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">qvec(overlapping[, first_event, last_event])</code></pre><p>Computes the area under the curve for the gradient waveform in <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a>.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L233-L240">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences" href="#MRIBuilder.Containers.BaseSequences"><code>MRIBuilder.Containers.BaseSequences</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a> and <a href="#MRIBuilder.Containers.BaseSequences.Sequence"><code>Sequence</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/base_sequences.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.BaseSequence" href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>MRIBuilder.Containers.BaseSequences.BaseSequence</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type of any sequence of non-overlapping building blocks that should be played after each other.</p><p>It contains <code>N</code> <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> objects (e.g., building blocks or other sequences).</p><p>Main interface:</p><ul><li>Acts as an iterable containing the blocks and sequences.<ul><li>Indiviual blocks/sequences can be obtained using indexing.</li><li>If there is a finite number of repeats, the iteration will continue over all repeats.</li></ul></li></ul><p>Sub-types need to implement:</p><ul><li><code>get_index_single_TR</code>: return the index assuming it is between 1 and N</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/base_sequences.jl#L14-L26">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.Sequence" href="#MRIBuilder.Containers.BaseSequences.Sequence"><code>MRIBuilder.Containers.BaseSequences.Sequence</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Sequence(blocks; name=:Sequence, variables...) +Sequence(blocks...; name=:Sequence, variables...)</code></pre><p>Defines an MRI sequence from a vector of building blocks.</p><p><strong>Arguments</strong></p><ul><li><code>blocks</code>: The actual building blocks that will be played in sequence. All the building blocks must be of type <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>, which means that they cannot only contain actual <a href="#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a> objects, but also other <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a> objects. Objects of a different type are converted into a <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> internally:<ul><li>numbers/<code>nothing</code>/<code>:min</code>/<code>:max</code> : replaced with a <a href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>Wait</code></a> block with the appropriate constraint/objective added to its <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>.</li><li>RF pulse or readout: will be embedded within a <a href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a> of the appropriate length</li></ul></li></ul><p>Specific named sequences might define additional variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/base_sequences.jl#L137-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.get_index_single_TR-Tuple{BaseSequence, Integer}" href="#MRIBuilder.Containers.BaseSequences.get_index_single_TR-Tuple{BaseSequence, Integer}"><code>MRIBuilder.Containers.BaseSequences.get_index_single_TR</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_index_single_TR(sequence, index)</code></pre><p>Used internally by any <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a> to get a specific block. The <code>index</code> should be between 1 and N. It should be implemented for any sub-classes of <a href="#MRIBuilder.Containers.BaseSequences.BaseSequence"><code>BaseSequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/base_sequences.jl#L88-L94">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.nrepeat-Tuple{BaseSequence}" href="#MRIBuilder.Containers.BaseSequences.nrepeat-Tuple{BaseSequence}"><code>MRIBuilder.Containers.BaseSequences.nrepeat</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nrepeat(sequence)</code></pre><p>How often sequence should be repeated. </p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/base_sequences.jl#L98-L102">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.BaseSequences.to_block-Tuple{ContainerBlock}" href="#MRIBuilder.Containers.BaseSequences.to_block-Tuple{ContainerBlock}"><code>MRIBuilder.Containers.BaseSequences.to_block</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">to_block(block_like)</code></pre><p>Converst object into something that can be included in the sequence:</p><ul><li>:min/:max/number/variable/nothing => <a href="#MRIBuilder.Containers.BuildingBlocks.Wait"><code>Wait</code></a>.</li><li><code>building_block</code> or <code>sequence</code> => no change.</li><li>RF pulse/readout => will be embedded within a <a href="#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/base_sequences.jl#L201-L208">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks" href="#MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks"><code>MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for all blocks that can take different MR sequence components between multiple repetitions of the sequence.</p><p>They can be extended into their individual components using <code>adjust(<name>=:all)</code>.</p><p>Each subtype of <a href="@ref"><code>AbstractAlternativeBlock</code></a> needs to implement two methods:</p><ul><li><a href="#MRIBuilder.Containers.Alternatives.get_alternatives_name-Tuple{AlternativeBlocks}"><code>get_alternatives_name</code></a>: returns the <code>name</code> used to identify this block in <code>adjust</code></li><li><a href="#MRIBuilder.Containers.Alternatives.get_alternatives_options-Tuple{AlternativeBlocks}"><code>get_alternatives_options</code></a>: returns a dictionary mapping the name of the different options to a <a href="#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> with the actual sequence building block.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/alternatives.jl#L7-L15">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.AlternativeBlocks" href="#MRIBuilder.Containers.Alternatives.AlternativeBlocks"><code>MRIBuilder.Containers.Alternatives.AlternativeBlocks</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">AlternativeBlocks(name, blocks)</code></pre><p>Represents a part of the sequence where there are multiple possible alternatives.</p><p>Variables can be matched across these alternatives using <a href="#MRIBuilder.Containers.Alternatives.match_blocks!-Tuple{AbstractAlternativeBlocks, Any}"><code>match_blocks!</code></a>.</p><p>The <code>name</code> is a symbol that is used to identify this <code>AlternativeBlocks</code> in the broader sequence (as in <code>adjust</code>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/alternatives.jl#L18-L26">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.get_alternatives_name-Tuple{AlternativeBlocks}" href="#MRIBuilder.Containers.Alternatives.get_alternatives_name-Tuple{AlternativeBlocks}"><code>MRIBuilder.Containers.Alternatives.get_alternatives_name</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_alternatives_name(alternative_block)</code></pre><p>Get the name with which any <a href="#MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks"><code>AbstractAlternativeBlocks</code></a> will be identified in a call to <code>adjust</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/alternatives.jl#L34-L38">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.get_alternatives_options-Tuple{AlternativeBlocks}" href="#MRIBuilder.Containers.Alternatives.get_alternatives_options-Tuple{AlternativeBlocks}"><code>MRIBuilder.Containers.Alternatives.get_alternatives_options</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_alternatives_options(alternative_block)</code></pre><p>Get the options available for a <a href="#MRIBuilder.Containers.Alternatives.AbstractAlternativeBlocks"><code>AbstractAlternativeBlocks</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/alternatives.jl#L41-L45">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Containers.Alternatives.match_blocks!-Tuple{AbstractAlternativeBlocks, Any}" href="#MRIBuilder.Containers.Alternatives.match_blocks!-Tuple{AbstractAlternativeBlocks, Any}"><code>MRIBuilder.Containers.Alternatives.match_blocks!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">match_blocks!(alternatives, function)</code></pre><p>Matches the outcome of given <code>function</code> on each of the building blocks in <a href="#MRIBuilder.Containers.Alternatives.AlternativeBlocks"><code>AlternativeBlocks</code></a>.</p><p>For example, <code>match_blocks!(alternatives, duration)</code> will ensure that all the alternative building blocks have the same duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/alternatives.jl#L55-L61">source</a></section></article><h2 id="Pre-defined-sequence-parts"><a class="docs-heading-anchor" href="#Pre-defined-sequence-parts">Pre-defined sequence parts</a><a id="Pre-defined-sequence-parts-1"></a><a class="docs-heading-anchor-permalink" href="#Pre-defined-sequence-parts" title="Permalink"></a></h2><p>There are <a href="../defining_sequence/#helper_functions">helper functions</a> available to actually add these to a sequence.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids" href="#MRIBuilder.Parts.Trapezoids"><code>MRIBuilder.Parts.Trapezoids</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines a set of different options for MRI gradients.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.BaseTrapezoid" href="#MRIBuilder.Parts.Trapezoids.BaseTrapezoid"><code>MRIBuilder.Parts.Trapezoids.BaseTrapezoid</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for any <code>BuildingBlock</code> that has a trapezoidal gradient waveform.</p><p>Sub-types:</p><ul><li><a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a></li><li><a href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a></li><li><a href="#MRIBuilder.Parts.Trapezoids.LineReadout"><code>LineReadout</code></a></li></ul><p>The <code>N</code> indicates whether the gradient has a fixed orientation (N=1) or is free (N=3).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L14-L23">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.LineReadout" href="#MRIBuilder.Parts.Trapezoids.LineReadout"><code>MRIBuilder.Parts.Trapezoids.LineReadout</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">LineReadout(adc; ramp_overlap=1., orientation=nothing, group=nothing, variables...)</code></pre><p>Defines a trapezoidal gradient with an ADC readout overlaid.</p><p>Parameters and variables are identical as for <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> with the addition of:</p><p><strong>Parameters</strong></p><ul><li><code>adc</code>: <a href="#MRIBuilder.Components.Readouts.ADCs.ADC"><code>ADC</code></a> object that describes the readout.</li><li><code>ramp_overlap</code>: how much the gradient ramp should overlap with the ADC. 0 for no overlap, 1 for full overlap (default: 1). Can be set to <code>nothing</code> to become a free variable.</li></ul><p><strong>Variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>: FOV of the output image along this single k-space line in mm.</li><li><a href="#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>: size of each voxel along this single k-space line in mm.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L239-L253">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.SliceSelect" href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>MRIBuilder.Parts.Trapezoids.SliceSelect</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SliceSelect(pulse; orientation=nothing, group=nothing, variables...)</code></pre><p>Defines a trapezoidal gradient with a pulse played out during the flat time.</p><p>Parameters and variables are identical as for <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> with the addition of:</p><p><strong>Parameters</strong></p><ul><li><code>pulse</code>: sub-type of <a href="#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> that describes the RF pulse.</li></ul><p><strong>Variables</strong></p><ul><li><code>slice_thickness</code>: thickness of the selected slice in mm</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L179-L191">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.Trapezoid" href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>MRIBuilder.Parts.Trapezoids.Trapezoid</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Trapezoid(; orientation=nothing, group=nothing, variables...)</code></pre><p>Defines a trapezoidal pulsed gradient</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code> sets the gradient orientation (completely free by default). Can be set to a vector for a fixed orientation.</li><li><code>group</code>: assign the trapezoidal gradient to a specific group. This group will be used to scale or rotate the gradients after optimisation.</li></ul><p><strong>Variables</strong></p><p>Variables can be set during construction or afterwards as an attribute. If not set, they will be determined during the sequence optimisation.</p><p><strong>Timing variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.rise_time"><code>variables.rise_time</code></a>: Time of the gradient to reach from 0 to maximum in ms. If explicitly set to 0, the scanner slew rate will be ignored.</li><li><a href="#MRIBuilder.Variables.variables.flat_time"><code>variables.flat_time</code></a>: Time that the gradient stays at maximum strength in ms.</li><li><a href="#MRIBuilder.Variables.variables.δ"><code>variables.δ</code></a>: effective pulse duration (<code>rise_time</code> + <code>flat_time</code>) in ms.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total pulse duration (2 * <code>rise_time</code> + <code>flat_time</code>) in ms.</li></ul><p><strong>Gradient variables</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>: Maximum gradient strength achieved during the pulse in kHz/um</li><li><a href="#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>: Spatial scale on which spins will be dephased due to this pulsed gradient in rad/um (given by <code>δ</code> * <code>gradient_strength</code>).</li></ul><p>The <code>bvalue</code> can be constrained for multiple gradient pulses by creating a <code>Pathway</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L26-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.Trapezoids.opposite_kspace_lines-Tuple{}" href="#MRIBuilder.Parts.Trapezoids.opposite_kspace_lines-Tuple{}"><code>MRIBuilder.Parts.Trapezoids.opposite_kspace_lines</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">opposite_kspace_lines(; orientation=[1, 0, 0], kwargs...)</code></pre><p>Return a positive and negative readout of a k-space line.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L314-L318">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flat_time" href="#MRIBuilder.Variables.variables.flat_time"><code>MRIBuilder.Variables.variables.flat_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flat_time(trapezoid)</code></pre><p>Returns the flat time of a <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L124-L128">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.fov" href="#MRIBuilder.Variables.variables.fov"><code>MRIBuilder.Variables.variables.fov</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fov(readout)</code></pre><p>Defines the field of view of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L288-L292">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.ramp_overlap" href="#MRIBuilder.Variables.variables.ramp_overlap"><code>MRIBuilder.Variables.variables.ramp_overlap</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ramp_overlap(line_readout)</code></pre><p>Return the fraction of the gradient ramp that overlaps with the ADC readout.</p><p>Set to 0 to ensure that the ADC is only active during the flat time of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L302-L308">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.rise_time" href="#MRIBuilder.Variables.variables.rise_time"><code>MRIBuilder.Variables.variables.rise_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">rise_time(trapezoid)</code></pre><p>Returns the rise time of a <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L117-L121">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slice_thickness" href="#MRIBuilder.Variables.variables.slice_thickness"><code>MRIBuilder.Variables.variables.slice_thickness</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slice_thickness(slice_select)</code></pre><p>Defines the slice thickness for a RF pulse with an active gradient in mm (e.g., <a href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a>).</p><p>Defines as <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation"><code>variables.gradient_strength_norm</code></a>(gradient) / <a href="#MRIBuilder.Variables.variables.bandwidth"><code>variables.bandwidth</code></a>(pulse)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L213-L219">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.voxel_size" href="#MRIBuilder.Variables.variables.voxel_size"><code>MRIBuilder.Variables.variables.voxel_size</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">voxel_size(readout)</code></pre><p>Defines the voxel size of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L295-L299">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.δ" href="#MRIBuilder.Variables.variables.δ"><code>MRIBuilder.Variables.variables.δ</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">δ(trapezoid)</code></pre><p>Returns the effective duration of a <a href="#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p><p>Defined as <a href="#MRIBuilder.Variables.variables.rise_time"><code>variables.rise_time</code></a> + <a href="#MRIBuilder.Variables.variables.flat_time"><code>variables.flat_time</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L136-L142">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect" href="#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SpoiltSliceSelect(pulse; parameters..., variables...)</code></pre><p>Adds slice selection to the <code>pulse</code> and surrounds it with spoiler gradients.</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code>: vector with orientation of the slice selection and the spoilers (default: [0, 0, 1])</li><li><code>group</code>: name of the group of the gradient. This will be used to scale and rotate the gradients after optimisation. Scaling is not recommended as this might ruin the spoiling.</li></ul><p><strong>Variables</strong></p><ul><li><code>duration</code>: total duration of the block in ms.</li><li><code>slice_thickness</code>: slice thickness in mm.</li><li><code>spoiler</code>: length scale on which the spoilers achieve 2Ï€ dephasing in mm. This sets the minimum spoiling. If this spoiling level is not achieved by the slice-select gradient alone, then there will be additional gradients added.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/spoilt_slice_selects.jl#L12-L25">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.all_gradient_strengths" href="#MRIBuilder.Variables.variables.all_gradient_strengths"><code>MRIBuilder.Variables.variables.all_gradient_strengths</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">all_gradient_strengths(spoilt_slice_select)</code></pre><p>Returns the gradient strength before, during, and after the pulse in <a href="#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>SpoiltSliceSelect</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/spoilt_slice_selects.jl#L127-L131">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.fall_time" href="#MRIBuilder.Variables.variables.fall_time"><code>MRIBuilder.Variables.variables.fall_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fall_time(spoilt_slice_select)</code></pre><p>Returns the time of the <a href="#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>SpoiltSliceSelect</code></a> to return to zero.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/spoilt_slice_selects.jl#L135-L139">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.SliceSelectRephases.SliceSelectRephase" href="#MRIBuilder.Parts.SliceSelectRephases.SliceSelectRephase"><code>MRIBuilder.Parts.SliceSelectRephases.SliceSelectRephase</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SliceSelectRephase(pulse; kwargs...)</code></pre><p>Creates an excitatory RF pulse with slice selection and a rephasing gradient.</p><p>Parameters are the same as for <a href="#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/slice_select_rephases.jl#L7-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.EPIReadouts.EPIReadout" href="#MRIBuilder.Parts.EPIReadouts.EPIReadout"><code>MRIBuilder.Parts.EPIReadouts.EPIReadout</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">EPIReadout(; resolution, ky_lines=-resolution[2]:resolution[2], recenter=false, group=:FOV, variables...)</code></pre><p>Defines an (accelerated) EPI readout.</p><p><strong>Parameters</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>: Resolution of the final image in the frequency- and phase-encode directions.</li><li><code>recenter</code>: if true, the signal will be recentred in k-space after the EPI readout.</li><li><code>group</code>: name of the group used to rotate the readout gradients (default: :FOV).</li></ul><p><strong>Variables:</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>: size of the voxel in the frequency- and phase-encode directions.</li><li><a href="#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>: size of the FOV in the frequency- and phase-encode directions.</li><li><a href="#MRIBuilder.Variables.variables.ramp_overlap"><code>variables.ramp_overlap</code></a>: what fraction of the gradient ramp should overlap with the readout.</li><li><a href="#MRIBuilder.Variables.variables.oversample"><code>variables.oversample</code></a>: by how much to oversample in the frequency-encode direcion.</li><li><a href="#MRIBuilder.Variables.variables.dwell_time"><code>variables.dwell_time</code></a>: dwell time in the frequency-encode direction</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/epi_readouts.jl#L8-L24">source</a></section></article><h2 id="Sequence-I/O"><a class="docs-heading-anchor" href="#Sequence-I/O">Sequence I/O</a><a id="Sequence-I/O-1"></a><a class="docs-heading-anchor-permalink" href="#Sequence-I/O" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.Pulseq" href="#MRIBuilder.SequenceIO.Pulseq"><code>MRIBuilder.SequenceIO.Pulseq</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Module converting MRIBuilder sequences to and from sequences recognised by <a href="@ref"><code>PulseqIO</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO" href="#MRIBuilder.SequenceIO.PulseqIO"><code>MRIBuilder.SequenceIO.PulseqIO</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Stand-alone module that reads/writes Pulseq files.</p><p>The pulseq files are read into or written from a set of types that closely match the Pulseq file format. The translation of these types into MRIBuilder types is defined in "../pulseq.jl" (i.e., <code>MRIBuilder.SequenceIO.Pulseq</code>)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/pulseq_io.jl#L1-L6">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.read_pulseq-Tuple{IO}" href="#MRIBuilder.SequenceIO.PulseqIO.read_pulseq-Tuple{IO}"><code>MRIBuilder.SequenceIO.PulseqIO.read_pulseq</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">read_pulseq(IO)</code></pre><p>Reads a sequence from a pulseq file (http://pulseq.github.io/). Pulseq files can be produced using matlab (http://pulseq.github.io/) or python (https://pypulseq.readthedocs.io/en/master/).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/pulseq_io.jl#L20-L25">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.write_pulseq-Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence}" href="#MRIBuilder.SequenceIO.PulseqIO.write_pulseq-Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence}"><code>MRIBuilder.SequenceIO.PulseqIO.write_pulseq</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">write_pulseq(IO, sequence)</code></pre><p>Writes a sequence to an output IO file.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/pulseq_io.jl#L31-L35">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types" href="#MRIBuilder.SequenceIO.PulseqIO.Types"><code>MRIBuilder.SequenceIO.PulseqIO.Types</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define the main types forming a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p><p>Extensions and sections types are defined in their own modules.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L1-L5">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqComponent" href="#MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqComponent"><code>MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqComponent</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type for any RF pulses/gradients/ADC/extensions that can play out during a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock"><code>PulseqBlock</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L26-L28">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqGradient" href="#MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqGradient"><code>MRIBuilder.SequenceIO.PulseqIO.Types.AnyPulseqGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Super-type of Pulseq gradients:</p><ul><li><a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient"><code>PulseqGradient</code></a></li><li><a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid"><code>PulseqTrapezoid</code></a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqADC" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqADC"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqADC</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqADC(num::Int, dwell::Float64, delay::Int, frequency::Number, phase::Number)</code></pre><p>A trapezoidal gradient pulse defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqBlock(duration::Int, rf::PulseqRFPulse, gx::AnyPulseqGradient, gy::AnyPulseqGradient, gz::AnyPulseqGradient, adc::PulseqADC, ext)</code></pre><p>Defines a Building Block with the Pulseq sequence (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p><p>The RF pulse, gradients, and ADC can be set to <code>nothing</code>.</p><p>The <code>ext</code> is a sequence of extension blocks that will be played out. Set this to a sequence of zero length to not have any extensions.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L111-L120">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtension" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtension"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtension</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqExtension(definition::PulseqExtensionDefinition, id::Int)</code></pre><p>Reference to a specific implementation of a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition"><code>PulseqExtensionDefinition</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L101-L105">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqExtensionDefinition</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqExtensionDefinition(name, content)</code></pre><p>Abstract definition of an unknown Pulseq extension.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L92-L96">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqGradient(amplitude::Number, shape::PulseqShape, time::PulseqShape, delay::int)</code></pre><p>A generic gradient waveform defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L54-L58">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqRFPulse(amplitude::Number, magnitude::PulseqShape, phase::PulseqShape, time::PulseqShape, delay::Int, frequency::Number, phase_offset::Number)</code></pre><p>An RF pulse defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L32-L36">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqSection(:<title>)(lines)</code></pre><p>Represents a section in the pulseq file format.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L8-L12">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqSequence(version::VersionNumber, definitions::NamedTuple, blocks::Vector{PulseqBlock})</code></pre><p>A full sequence defined according to the Pulseq <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L131-L135">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqShape(samples)</code></pre><p>Define the shape of a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqRFPulse"><code>PulseqRFPulse</code></a> or <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqGradient"><code>PulseqGradient</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L17-L21">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid" href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid"><code>MRIBuilder.SequenceIO.PulseqIO.Types.PulseqTrapezoid</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqTrapezoid(amplitude::Number, rise::Int, flat::Int, fall::Int, delay::Int)</code></pre><p>A trapezoidal gradient pulse defined in Pulseq (see <a href="https://raw.githubusercontent.com/pulseq/pulseq/master/doc/specification.pdf">specification</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/types.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section" href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section"><code>MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gen_section(sequence, Val(:<title>))</code></pre><p>Creates a specific <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a>{<title>} from a part of the PulseqSequence.</p><p>This is the opposite of <a href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section"><code>parse_section</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/parsers/parsers.jl#L16-L22">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section" href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section"><code>MRIBuilder.SequenceIO.PulseqIO.Parsers.parse_section</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_section(section)</code></pre><p>Parses any <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a> and return the appropriate type.</p><p>The opposite is <a href="#MRIBuilder.SequenceIO.PulseqIO.Parsers.gen_section"><code>gen_section</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/parsers/parsers.jl#L6-L12">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_dict-Tuple{Any, Any, Any}" href="#MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_dict-Tuple{Any, Any, Any}"><code>MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_dict</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_pulseq_dict(line, names, dtypes)</code></pre><p>Parse a line of integers/floats with known names and dtypes.</p><p>This is useful to parse most of the columnar data in Pulseq, such as in BLOCKS, RF, GRADIENTS, etc.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/basic_parsers.jl#L3-L9">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_properties-Tuple{Vector{<:AbstractString}}" href="#MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_properties-Tuple{Vector{<:AbstractString}}"><code>MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_pulseq_properties</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_pulseq_properties(lines)</code></pre><p>Parse any <code>pulseq</code> section formatted as:</p><pre><code class="nohighlight hljs"><name> <value> <name2> <value2> -...</code></pre><p>This includes the VERSION, DEFINITIONS, and part of the SHAPES</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/basic_parsers.jl#L18-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_value-Tuple{AbstractString}" href="#MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_value-Tuple{AbstractString}"><code>MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_value</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_value(string)</code></pre><p>Tries to value the <code>string</code> as a number of sequence of numbers. If that does not work, the <code>string</code> is returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/basic_parsers.jl#L39-L44">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components" href="#MRIBuilder.SequenceIO.PulseqIO.Components"><code>MRIBuilder.SequenceIO.PulseqIO.Components</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define a list of all the <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape"><code>PulseqShape</code></a> and <a href="@ref"><code>PulseqComponent</code></a> that are used in a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/components.jl#L1">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents" href="#MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents"><code>MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqComponents(shapes, pulses, grads, adcs, extensions)</code></pre><p>All the shapes, pulses, grads, adcs, and extensions used in a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p><p>They can be provided as a dictionary from the integer ID to the object or as a vector.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/components.jl#L6-L12">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.add_components!-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Dict{Int64}, Nothing}" href="#MRIBuilder.SequenceIO.PulseqIO.Components.add_components!-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Dict{Int64}, Nothing}"><code>MRIBuilder.SequenceIO.PulseqIO.Components.add_components!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_components(comp::PulseqComponents, search_vec::Vector, component) -add_components(comp::PulseqComponents, shape::PulseqShape)</code></pre><p>Adds a component to the <a href="@ref"><code>search_vec</code></a>, which is assumed to be the appropriate vector within the <code>comp</code>.</p><p>It will check whether the <code>component</code> is already part of the <code>search_vec</code> before adding it. The integer ID of the position of the <code>component</code> in <code>search_vec</code> is returned.</p><p>0 is returned if <code>component</code> is <code>nothing</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/components.jl#L38-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.same_component-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Any, Any}" href="#MRIBuilder.SequenceIO.PulseqIO.Components.same_component-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Any, Any}"><code>MRIBuilder.SequenceIO.PulseqIO.Components.same_component</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">same_component(comp::PulseqComponents, a, b)</code></pre><p>Check whether components <code>a</code> and <code>b</code> are the same when using the shapes represented in <code>comp</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/components.jl#L60-L64">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.same_shape-Tuple{MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape}" href="#MRIBuilder.SequenceIO.PulseqIO.Components.same_shape-Tuple{MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape}"><code>MRIBuilder.SequenceIO.PulseqIO.Components.same_shape</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">same_component(a, b)</code></pre><p>Check whether shapes <code>a</code> and <code>b</code> are the same.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/components.jl#L96-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.SectionsIO" href="#MRIBuilder.SequenceIO.PulseqIO.SectionsIO"><code>MRIBuilder.SequenceIO.PulseqIO.SectionsIO</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define IO for <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/sections_io.jl#L1">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.SectionsIO.parse_pulseq_sections-Tuple{IO}" href="#MRIBuilder.SequenceIO.PulseqIO.SectionsIO.parse_pulseq_sections-Tuple{IO}"><code>MRIBuilder.SequenceIO.PulseqIO.SectionsIO.parse_pulseq_sections</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_pulseq_sections(io)</code></pre><p>Reads a Pulseq file into a dictionary of <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a> objects.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/sections_io.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.SectionsIO.write_pulseq_section-Union{Tuple{T}, Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection{T}}} where T" href="#MRIBuilder.SequenceIO.PulseqIO.SectionsIO.write_pulseq_section-Union{Tuple{T}, Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection{T}}} where T"><code>MRIBuilder.SequenceIO.PulseqIO.SectionsIO.write_pulseq_section</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">write_pulseq_section(io, section::PulseqSection)</code></pre><p>Writes a Pulseq <code>section</code> to the <code>IO</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/sections_io.jl#L31-L35">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.ParseSections" href="#MRIBuilder.SequenceIO.PulseqIO.ParseSections"><code>MRIBuilder.SequenceIO.PulseqIO.ParseSections</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Translate between sets of <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a> objects and <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/parse_sections.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.ParseSections.parse_all_sections-Tuple{Dict{String, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection}}" href="#MRIBuilder.SequenceIO.PulseqIO.ParseSections.parse_all_sections-Tuple{Dict{String, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection}}"><code>MRIBuilder.SequenceIO.PulseqIO.ParseSections.parse_all_sections</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_all_sections(sections)</code></pre><p>Parses the sections read from a Pulseq file.</p><p>Returns a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequence_io/pulseq_io/parse_sections.jl#L10-L16">source</a></section></article><h2 id="Plot"><a class="docs-heading-anchor" href="#Plot">Plot</a><a id="Plot-1"></a><a class="docs-heading-anchor-permalink" href="#Plot" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.SequenceDiagram" href="#MRIBuilder.Plot.SequenceDiagram"><code>MRIBuilder.Plot.SequenceDiagram</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SequenceDiagram(; RFx, RFy, Gx, Gy, Gz, ADC)</code></pre><p>All the lines forming a sequence diagram.</p><p>Each parameter should be a <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a> if provided. Any parameters not provided will be set to a <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a> with zero amplitude.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/plot.jl#L87-L94">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.SinglePlotLine" href="#MRIBuilder.Plot.SinglePlotLine"><code>MRIBuilder.Plot.SinglePlotLine</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SinglePlotLine(times, amplitudes, event_times, event_amplitudes)</code></pre><p>A single line in a sequence diagram (e.g., RFx, Gy, ADC).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/plot.jl#L7-L11">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.plot_sequence" href="#MRIBuilder.Plot.plot_sequence"><code>MRIBuilder.Plot.plot_sequence</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">plot_sequence(sequence; figure=(), axis=(), attributes...) +...</code></pre><p>This includes the VERSION, DEFINITIONS, and part of the SHAPES</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/basic_parsers.jl#L18-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_value-Tuple{AbstractString}" href="#MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_value-Tuple{AbstractString}"><code>MRIBuilder.SequenceIO.PulseqIO.BasicParsers.parse_value</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_value(string)</code></pre><p>Tries to value the <code>string</code> as a number of sequence of numbers. If that does not work, the <code>string</code> is returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/basic_parsers.jl#L39-L44">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components" href="#MRIBuilder.SequenceIO.PulseqIO.Components"><code>MRIBuilder.SequenceIO.PulseqIO.Components</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define a list of all the <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape"><code>PulseqShape</code></a> and <a href="@ref"><code>PulseqComponent</code></a> that are used in a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/components.jl#L1">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents" href="#MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents"><code>MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">PulseqComponents(shapes, pulses, grads, adcs, extensions)</code></pre><p>All the shapes, pulses, grads, adcs, and extensions used in a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p><p>They can be provided as a dictionary from the integer ID to the object or as a vector.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/components.jl#L6-L12">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.add_components!-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Dict{Int64}, Nothing}" href="#MRIBuilder.SequenceIO.PulseqIO.Components.add_components!-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Dict{Int64}, Nothing}"><code>MRIBuilder.SequenceIO.PulseqIO.Components.add_components!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_components(comp::PulseqComponents, search_vec::Vector, component) +add_components(comp::PulseqComponents, shape::PulseqShape)</code></pre><p>Adds a component to the <a href="@ref"><code>search_vec</code></a>, which is assumed to be the appropriate vector within the <code>comp</code>.</p><p>It will check whether the <code>component</code> is already part of the <code>search_vec</code> before adding it. The integer ID of the position of the <code>component</code> in <code>search_vec</code> is returned.</p><p>0 is returned if <code>component</code> is <code>nothing</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/components.jl#L38-L48">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.same_component-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Any, Any}" href="#MRIBuilder.SequenceIO.PulseqIO.Components.same_component-Tuple{MRIBuilder.SequenceIO.PulseqIO.Components.PulseqComponents, Any, Any}"><code>MRIBuilder.SequenceIO.PulseqIO.Components.same_component</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">same_component(comp::PulseqComponents, a, b)</code></pre><p>Check whether components <code>a</code> and <code>b</code> are the same when using the shapes represented in <code>comp</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/components.jl#L60-L64">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.Components.same_shape-Tuple{MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape}" href="#MRIBuilder.SequenceIO.PulseqIO.Components.same_shape-Tuple{MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqShape}"><code>MRIBuilder.SequenceIO.PulseqIO.Components.same_shape</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">same_component(a, b)</code></pre><p>Check whether shapes <code>a</code> and <code>b</code> are the same.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/components.jl#L96-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.SectionsIO" href="#MRIBuilder.SequenceIO.PulseqIO.SectionsIO"><code>MRIBuilder.SequenceIO.PulseqIO.SectionsIO</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define IO for <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/sections_io.jl#L1">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.SectionsIO.parse_pulseq_sections-Tuple{IO}" href="#MRIBuilder.SequenceIO.PulseqIO.SectionsIO.parse_pulseq_sections-Tuple{IO}"><code>MRIBuilder.SequenceIO.PulseqIO.SectionsIO.parse_pulseq_sections</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_pulseq_sections(io)</code></pre><p>Reads a Pulseq file into a dictionary of <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a> objects.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/sections_io.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.SectionsIO.write_pulseq_section-Union{Tuple{T}, Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection{T}}} where T" href="#MRIBuilder.SequenceIO.PulseqIO.SectionsIO.write_pulseq_section-Union{Tuple{T}, Tuple{IO, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection{T}}} where T"><code>MRIBuilder.SequenceIO.PulseqIO.SectionsIO.write_pulseq_section</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">write_pulseq_section(io, section::PulseqSection)</code></pre><p>Writes a Pulseq <code>section</code> to the <code>IO</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/sections_io.jl#L31-L35">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.ParseSections" href="#MRIBuilder.SequenceIO.PulseqIO.ParseSections"><code>MRIBuilder.SequenceIO.PulseqIO.ParseSections</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Translate between sets of <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection"><code>PulseqSection</code></a> objects and <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/parse_sections.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.SequenceIO.PulseqIO.ParseSections.parse_all_sections-Tuple{Dict{String, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection}}" href="#MRIBuilder.SequenceIO.PulseqIO.ParseSections.parse_all_sections-Tuple{Dict{String, MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSection}}"><code>MRIBuilder.SequenceIO.PulseqIO.ParseSections.parse_all_sections</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">parse_all_sections(sections)</code></pre><p>Parses the sections read from a Pulseq file.</p><p>Returns a <a href="#MRIBuilder.SequenceIO.PulseqIO.Types.PulseqSequence"><code>PulseqSequence</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequence_io/pulseq_io/parse_sections.jl#L10-L16">source</a></section></article><h2 id="Plot"><a class="docs-heading-anchor" href="#Plot">Plot</a><a id="Plot-1"></a><a class="docs-heading-anchor-permalink" href="#Plot" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.SequenceDiagram" href="#MRIBuilder.Plot.SequenceDiagram"><code>MRIBuilder.Plot.SequenceDiagram</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SequenceDiagram(; RFx, RFy, Gx, Gy, Gz, ADC)</code></pre><p>All the lines forming a sequence diagram.</p><p>Each parameter should be a <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a> if provided. Any parameters not provided will be set to a <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a> with zero amplitude.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/plot.jl#L87-L94">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.SinglePlotLine" href="#MRIBuilder.Plot.SinglePlotLine"><code>MRIBuilder.Plot.SinglePlotLine</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SinglePlotLine(times, amplitudes, event_times, event_amplitudes)</code></pre><p>A single line in a sequence diagram (e.g., RFx, Gy, ADC).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/plot.jl#L7-L11">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.plot_sequence" href="#MRIBuilder.Plot.plot_sequence"><code>MRIBuilder.Plot.plot_sequence</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">plot_sequence(sequence; figure=(), axis=(), attributes...) plot(sequence; attributes...) -plot!([scene,] sequence; attributes...)</code></pre><p>Plot the sequence diagram.</p><p>Calling <code>plot_sequence</code> will result in a much cleaner sequence diagram (recommended). However, if you want to combine this diagram with other plots you will have to use <code>plot</code> or <code>plot!</code> instead.</p><p>If called as <code>plot_sequence</code> the user can also supply <code>Makie.Figure</code> (<code>figure=(...)</code>) and <code>Makie.Axis</code> (<code>axis=(...)</code>) keywords. If called using the <code>plot</code> or <code>plot!</code> interface, only the attributes listed below can be supplied</p><p>This function will only work if <a href="https://makie.org"><code>Makie</code></a> is installed and imported.</p><p><strong>Attributes</strong></p><p><strong>Line properties</strong></p><ul><li><code>linecolor</code> sets the color of the lines. If you want to set the text color to the same value, you can also use <code>color=...</code>.</li><li><code>linewidth=1.5</code> sets the width of the lines.</li><li><code>instant_width=3.</code> sets the width of any instant gradients or pulses with respect to the <code>linewidth</code>.</li></ul><p><strong>Text properties</strong></p><ul><li><code>textcolor</code> sets the color of the text. If you want to set the line color to the same value, you can also use <code>color=...</code>.</li><li><code>font</code> sets whether the rendered text is :regular, :bold, or :italic.</li><li><code>fontsize</code>: set the size of each character.</li></ul><p>Base.Docs.DocStr(svec("### Generic attributes\n\n- <code>visible::Bool = true</code> sets whether the plot will be rendered or not.\n- <code>overdraw::Bool = false</code> sets whether the plot will draw over other plots. This specifically means ignoring depth checks in GL backends.\n- <code>transparency::Bool = false</code> adjusts how the plot deals with transparency. In GLMakie <code>transparency = true</code> results in using Order Independent Transparency.\n- <code>fxaa::Bool = true</code> adjusts whether the plot is rendered with fxaa (anti-aliasing).\n- <code>inspectable::Bool = true</code> sets whether this plot should be seen by <code>DataInspector</code>.\n- <code>depth_shift::Float32 = 0f0</code> adjusts the depth value of a plot after all other transformations, i.e. in clip space, where <code>0 <= depth <= 1</code>. This only applies to GLMakie and WGLMakie and can be used to adjust render order (like a tunable overdraw).\n- <code>model::Makie.Mat4f</code> sets a model matrix for the plot. This replaces adjustments made with <code>translate!</code>, <code>rotate!</code> and <code>scale!</code>.\n- <code>space::Symbol = :data</code> sets the transformation space for box encompassing the volume plot. See <code>Makie.spaces()</code> for possible inputs.\n- <code>clip_planes::Vector{Plane3f} = Plane3f[]</code>: allows you to specify up to 8 planes behind which plot objects get clipped (i.e. become invisible). By default clip planes are inherited from the parent plot or scene.\n"), nothing, Dict{Symbol, Any}(:typesig => Tuple{Any}, :module => MakieCore, :linenumber => 4, :binding => MakieCore.generic<em>plot</em>attributes!, :path => "/root/.julia/packages/MakieCore/NeQjl/src/basic_plots.jl"))</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/plot.jl#L220-L248">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.range_event-Tuple{MRIBuilder.Plot.SinglePlotLine}" href="#MRIBuilder.Plot.range_event-Tuple{MRIBuilder.Plot.SinglePlotLine}"><code>MRIBuilder.Plot.range_event</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">range_event(single_plot_line)</code></pre><p>Returns the minimum and maximum amplitude for the events in <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/plot.jl#L63-L67">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.range_line-Tuple{MRIBuilder.Plot.SinglePlotLine}" href="#MRIBuilder.Plot.range_line-Tuple{MRIBuilder.Plot.SinglePlotLine}"><code>MRIBuilder.Plot.range_line</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">range_line(single_plot_line)</code></pre><p>Returns the minimum and maximum amplitude for a <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/plot.jl#L53-L57">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../scanners/">« Scanners</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> +plot!([scene,] sequence; attributes...)</code></pre><p>Plot the sequence diagram.</p><p>Calling <code>plot_sequence</code> will result in a much cleaner sequence diagram (recommended). However, if you want to combine this diagram with other plots you will have to use <code>plot</code> or <code>plot!</code> instead.</p><p>If called as <code>plot_sequence</code> the user can also supply <code>Makie.Figure</code> (<code>figure=(...)</code>) and <code>Makie.Axis</code> (<code>axis=(...)</code>) keywords. If called using the <code>plot</code> or <code>plot!</code> interface, only the attributes listed below can be supplied</p><p>This function will only work if <a href="https://makie.org"><code>Makie</code></a> is installed and imported.</p><p><strong>Attributes</strong></p><p><strong>Line properties</strong></p><ul><li><code>linecolor</code> sets the color of the lines. If you want to set the text color to the same value, you can also use <code>color=...</code>.</li><li><code>linewidth=1.5</code> sets the width of the lines.</li><li><code>instant_width=3.</code> sets the width of any instant gradients or pulses with respect to the <code>linewidth</code>.</li></ul><p><strong>Text properties</strong></p><ul><li><code>textcolor</code> sets the color of the text. If you want to set the line color to the same value, you can also use <code>color=...</code>.</li><li><code>font</code> sets whether the rendered text is :regular, :bold, or :italic.</li><li><code>fontsize</code>: set the size of each character.</li></ul><p>Base.Docs.DocStr(svec("### Generic attributes\n\n- <code>visible::Bool = true</code> sets whether the plot will be rendered or not.\n- <code>overdraw::Bool = false</code> sets whether the plot will draw over other plots. This specifically means ignoring depth checks in GL backends.\n- <code>transparency::Bool = false</code> adjusts how the plot deals with transparency. In GLMakie <code>transparency = true</code> results in using Order Independent Transparency.\n- <code>fxaa::Bool = true</code> adjusts whether the plot is rendered with fxaa (anti-aliasing).\n- <code>inspectable::Bool = true</code> sets whether this plot should be seen by <code>DataInspector</code>.\n- <code>depth_shift::Float32 = 0f0</code> adjusts the depth value of a plot after all other transformations, i.e. in clip space, where <code>0 <= depth <= 1</code>. This only applies to GLMakie and WGLMakie and can be used to adjust render order (like a tunable overdraw).\n- <code>model::Makie.Mat4f</code> sets a model matrix for the plot. This replaces adjustments made with <code>translate!</code>, <code>rotate!</code> and <code>scale!</code>.\n- <code>space::Symbol = :data</code> sets the transformation space for box encompassing the volume plot. See <code>Makie.spaces()</code> for possible inputs.\n- <code>clip_planes::Vector{Plane3f} = Plane3f[]</code>: allows you to specify up to 8 planes behind which plot objects get clipped (i.e. become invisible). By default clip planes are inherited from the parent plot or scene.\n"), nothing, Dict{Symbol, Any}(:typesig => Tuple{Any}, :module => MakieCore, :linenumber => 4, :binding => MakieCore.generic<em>plot</em>attributes!, :path => "/root/.julia/packages/MakieCore/NeQjl/src/basic_plots.jl"))</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/plot.jl#L220-L248">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.range_event-Tuple{MRIBuilder.Plot.SinglePlotLine}" href="#MRIBuilder.Plot.range_event-Tuple{MRIBuilder.Plot.SinglePlotLine}"><code>MRIBuilder.Plot.range_event</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">range_event(single_plot_line)</code></pre><p>Returns the minimum and maximum amplitude for the events in <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/plot.jl#L63-L67">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Plot.range_line-Tuple{MRIBuilder.Plot.SinglePlotLine}" href="#MRIBuilder.Plot.range_line-Tuple{MRIBuilder.Plot.SinglePlotLine}"><code>MRIBuilder.Plot.range_line</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">range_line(single_plot_line)</code></pre><p>Returns the minimum and maximum amplitude for a <a href="#MRIBuilder.Plot.SinglePlotLine"><code>SinglePlotLine</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/plot.jl#L53-L57">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../scanners/">« Scanners</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:03">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> diff --git a/dev/defining_sequence/index.html b/dev/defining_sequence/index.html index 10c6da7c0e9eb10956b1bfb8ca073145057c82de..b600211be7026c403e2d6e79eb9be293de0a4048 100644 --- a/dev/defining_sequence/index.html +++ b/dev/defining_sequence/index.html @@ -35,11 +35,11 @@ end</code></pre><p>For this sequence, we define the <a href="../implemented_sequ get_gradient(seq::DiffusionSpinEcho) = (gradient=seq[:gradient], gradient2=seq[:gradient2]) get_readout(seq::DiffusionSpinEcho) = seq.readout</code></pre><p>Note that we can indicate we are interested in multiple RF pulses/gradients by supplying them as a named tuple (<code>(excitation=..., refocus=...)</code>).</p><p>Setting this allows us to get RF pulse or gradient-specific properties by calling the sequence, for example:</p><pre><code class="language-julia hljs">using MRIBuilder sequence = DiffusionSpinEcho(bval=1., TE=:min, slice_thickness=2.) -variables.flip_angle(sequence)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(excitation = 89.99999999998127, refocus = 180.00000000002387)</code></pre><p>Here we can see that we get the <a href="../api/#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a> for each of the two RF pulses defined using <a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a> above.</p><p>The final component to defining summary variables is to define one or more default coherence pathways using <a href="#MRIBuilder.Variables.get_pathway"><code>get_pathway</code></a>:</p><pre><code class="language-julia hljs">get_pathway(seq::DiffusionSpinEcho) = Pathway(seq, [90, 180], 1, group=:diffusion)</code></pre><p>Here the coherence <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> sets out what a specific set of spins might experience during the sequence. In this case the sequence experiences two RF pulses and is excited by the first pulse and flipped by the second (<code>[90, 180]</code>). It is then observed during the first readout (<code>1</code>). For such a <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> we can compute:</p><ul><li>the time that the spin spends in each longitudinal and transverse direction, which is particularly useful in the transverse direction to compute the amount of T2-weighting (<a href="#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a>) and the amount of time spent dephasing to compute the amount of T2*-weighting (<a href="#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a>).</li><li>the diffusion weighting experienced (<a href="#MRIBuilder.Variables.variables.bval"><code>variables.bval</code></a>, <a href="#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a>, and <a href="#MRIBuilder.Variables.variables.net_dephasing"><code>variables.net_dephasing</code></a>)</li></ul><p>By defining a default pathway for the sequence, the user can now put constraints on any or all of these variables.</p><h2 id="helper_functions"><a class="docs-heading-anchor" href="#helper_functions">Component helper functions</a><a id="helper_functions-1"></a><a class="docs-heading-anchor-permalink" href="#helper_functions" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.dwi_gradients</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">dwi_gradients(; type, optimise=false, refocus=true, orientation=[1, 0, 0], group=:diffusion, variables...)</code></pre><p>Returns two diffusion-weighting gradients that are guaranteed to cancel each other out.</p><p><strong>Parameters</strong></p><ul><li><code>type</code>: A symbol describing the type of gradient. One of:<ul><li><code>:trapezoid</code>: Pulsed trapezoidal gradient profile. See <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> for the relevant <code>variables</code>.</li><li><code>:instant</code>: instantaneous gradient (e.g., to test short-pulse approximations). See <a href="../api/#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> for the relevant <code>variables</code>.</li></ul></li><li><code>optimise</code>: Whether to optimise this readout event in isolation from the rest of the sequence. Use this with caution. It can speed up the optimisation (and for very complicated sequences make it more robust), however the resulting parameters might not represent the optimal solution of any external constraints (which are ignored if the readout is optimised in isolation).</li><li><code>scanner</code>: Used for testing. Do not set this parameter at this level (instead set it for the total sequence using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L181-L192">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.excitation_pulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">excitation_pulse(; parameters...)</code></pre><p>Create an excitation RF pulse.</p><p>By default there is no slice-selective gradient. To enable slice selection <code>min_slice_thickness</code> has to be set to a number or to :min. If <code>min_slice_thickness</code> is not set or is set to <code>:min</code>, then either <code>bandwidth</code> or <code>duration</code> should be set, otherwise the optimisation might be unconstrained (ignore this for <code>shape=:instant</code>).</p><p><strong>Parameters</strong></p><p>For an <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a> (i.e., <code>shape=:instant</code>), only the <code>flip_angle</code>, <code>phase</code>, and <code>group</code> will be used. All other parameters are ignored.</p><ul><li><code>optimise</code>: set to true to optimise this RF pulse separately from the embedding sequence.</li></ul><p><strong>Pulse parameters</strong></p><ul><li><code>shape</code>: The shape of the RF pulse. One of <code>:sinc</code> (for <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>), <code>:constant</code>/<code>:hard</code> (for <a href="../api/#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>ConstantPulse</code></a>), or <code>:instant</code> (for <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a>). Default is :sinc for slice-selective pulses or :instant otherwise.</li><li><code>flip_angle</code>: size of the flip due to the RF pulse in degrees (default: 90).</li><li><code>phase</code>: angle of the RF pulse in the x-y plane in degrees (default: 0).</li><li><code>frequency</code>: frequency of the RF pulse relative to the Larmor frequency in kHz (default: 0).</li><li><code>bandwidth</code>: width of the RF pulse in Fourier space in kHz (default: free variable).</li><li><code>duration</code>: duration of the RF pulse in ms (default: free variable).</li><li><code>Nzeros</code>: sets the number of zero crossings for a <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> (default: 3). Can be set to a tuple of two numbers to set a different number of zero crossings before and after the pulse maximum.</li><li><code>group</code>: name of the group of which the RF pulse is part. This is used to add transformations after the sequence is optimised.</li></ul><p><strong>Slice selection</strong></p><ul><li><code>slice_thickness</code>: minimum slice thickness that should be possible without adjusting the sequence timings in um (not mm!) (default: no slice selection). Can be set to <code>:min</code> to indicate that this should be minimised given the scanner constraints and user values for <code>bandwidth</code> or <code>duration</code>.</li><li><code>rephase</code>: set to false to disable the spin rephasing after the RF pulse.</li><li><code>rotate_grad</code>: name of the parameter with which the slice selection gradient will be rotated after sequence optimisation (default: <code>:FOV</code>).</li><li><code>scanner</code>: overrides the <a href="#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>global_scanner</code></a> for this part of the sequence. Recommended to set only if not part of a larger sequence.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L26-L54">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.gradient_spoiler-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.gradient_spoiler-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.gradient_spoiler</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_spoiler(; optimise=false, orientation=[0, 0, 1], rotate=:FOV, scale=:spoiler, spoiler=1., duration=:min, variables...)</code></pre><p>Returns two DWI gradients that are guaranteed to cancel each other out.</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code>: Orientation of the gradient (default: slice-select direction).</li><li><code>rotate</code>: in which coordinate system is the <code>orientation</code> defined (default: :FOV).</li><li><code>scale</code>: variable controlling how the gradients should be scaled after optimsation (default: :spoiler).</li><li><code>optimise</code>: Whether to optimise this readout event in isolation from the rest of the sequence. Use this with caution. It can speed up the optimisation (and for very complicated sequences make it more robust), however the resulting parameters might not represent the optimal solution of any external constraints (which are ignored if the readout is optimised in isolation).</li><li><code>scanner</code>: Used for testing. Do not set this parameter at this level (instead set it for the total sequence using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>).</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.spoiler-sequence_optimisation"><code>variables.spoiler</code></a>: maximum spoiler scale (before applying any reductions due to <code>scale</code>).</li><li>Any other parameters expected by <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L288-L303">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}" href="#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>MRIBuilder.Parts.HelperFunctions.interpret_image_size</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">interpret_image_size(fov, resolution, voxel_size, slice_thickness)</code></pre><p>Combines the user-provided information of the image size to produce a tuple with:</p><ul><li><code>slice_thickness</code>: if not set explicitly, will be set to the third element of <code>voxel_size</code></li><li><code>resolution_z</code>: number of voxels in the slice-select direction.</li><li>keywords parameters for the <a href="#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a> functions with the <code>fov</code>, <code>resolution</code>, and <code>voxel_size</code> in the x- and y- dimensions.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L236-L243">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.readout_event</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">readout_event(; type, optimise=false, variables...)</code></pre><p>Adds a readout event to the sequence.</p><p><strong>Parameters</strong></p><ul><li><code>type</code>: A symbol describing the type of readout. It will default to <code>:epi</code> if a resolution has been set and <code>:instant</code> otherwise. Can be set to one of the following:<ul><li><code>:epi</code>: EPI readout. See <a href="../api/#MRIBuilder.Parts.EPIReadouts.EPIReadout"><code>EPIReadout</code></a> for the relevant <code>variables</code>.</li><li><code>:instant</code>: single isolated readout event <a href="../api/#MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout"><code>SingleReadout</code></a> (e.g., for NMR). Does not expect any <code>variables</code>.</li></ul></li><li><code>optimise</code>: Whether to optimise this readout event in isolation from the rest of the sequence. Use this with caution. It can speed up the optimisation (and for very complicated sequences make it more robust), however the resulting parameters might not represent the optimal solution of any external constraints (which are ignored if the readout is optimised in isolation).</li><li><code>scanner</code>: Used for testing. Do not set this parameter at this level (instead set it for the total sequence using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L146-L157">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.refocus_pulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">refocus_pulse(; parameters...)</code></pre><p>Create an excitation RF pulse.</p><p>By default there is no slice-selective gradient. To enable slice selection <code>slice_thickness</code> has to be set to a number or to :min. If <code>slice_thickness</code> is not set or is set to <code>:min</code>, then either <code>bandwidth</code> or <code>duration</code> should be set, otherwise the optimisation might be unconstrained (ignore this for <code>shape=:instant</code>).</p><p><strong>Parameters</strong></p><ul><li><code>optimise</code>: set to true to optimise this RF pulse separately from the embedding sequence.</li></ul><p><strong>Pulse parameters</strong></p><p>For an <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a> (i.e., <code>shape=:instant</code>), only the <code>flip_angle</code>, <code>phase</code>, and <code>group</code> will be used. All other parameters are ignored.</p><ul><li><code>shape</code>: The shape of the RF pulse. One of <code>:sinc</code> (for <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>), <code>:constant</code>/<code>:hard</code> (for <a href="../api/#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>ConstantPulse</code></a>), or <code>:instant</code> (for <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a>). Default is :sinc for slice-selective pulses or :instant otherwise.</li><li><code>flip_angle</code>: size of the flip due to the RF pulse in degrees (default: 180).</li><li><code>phase</code>: angle of the RF pulse in the x-y plane in degrees (default: 0).</li><li><code>frequency</code>: frequency of the RF pulse relative to the Larmor frequency in kHz (default: 0).</li><li><code>bandwidth</code>: width of the RF pulse in Fourier space in kHz (default: free variable).</li><li><code>duration</code>: duration of the RF pulse in ms (default: free variable).</li><li><code>Nzeros</code>: sets the number of zero crossings for a <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> (default: 3). Can be set to a tuple of two numbers to set a different number of zero crossings before and after the pulse maximum.</li><li><code>group</code>: name of the group of which the RF pulse is part. This is used to add transformations after the sequence is optimised.</li></ul><p><strong>Slice selection and spoilers</strong></p><ul><li><code>slice_thickness</code>: minimum slice thickness that should be possible without adjusting the sequence timings in um (not mm!) (default: no slice selection). Can be set to <code>:min</code> to indicate that this should be minimised given the scanner constraints and user values for <code>bandwidth</code> or <code>duration</code>.</li><li><code>spoiler</code>: set to the spatial scale on which the spins should be dephased in mm. For rotating spoilers, this does include the contribution from the slice select gradient as well.</li><li><code>rotate_grad</code>: name of the parameter with which the slice selection and spoiler gradient will be rotated after sequence optimisation (default: <code>:FOV</code>).</li><li><code>scanner</code>: overrides the <a href="#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>global_scanner</code></a> for this part of the sequence. Recommended to set only if not part of a larger sequence.</li><li><code>orientation</code>: vector with orientation of slice select gradient and pulses (defaults: z-direction).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L86-L115">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.saturation_pulse-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.saturation_pulse-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.saturation_pulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">saturation_pulse(; pulse=(), binomial_order=1, variables...)</code></pre><p>Creates a saturation pulse consisting of repeating instances of <code>pulse_type</code>.</p><p><strong>Parameters</strong></p><ul><li><code>pulse</code>: Parameters/variables used to define the basic RF pulse used in the saturation pulse. These can be:<ul><li><code>type</code>: <a href="../api/#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>ConstantPulse</code></a> (default), <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>, <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a>, etc.</li><li>Variables describing that type (e.g., <code>flip_angle</code>, <code>duration</code>, <code>frequency</code>)</li></ul></li><li><code>binomial_order</code>: How many repeats of <code>pulse_type</code> there should be in a single binomial pulse.</li></ul><p><strong>Variables</strong></p><ul><li><code>nrepeat</code>: number of repeats of the binomial pulse. This should typically be set by the user.</li><li><code>interblock_delay</code>: time between the start of each pulse. Should be short compared with the T1, but long enough to limit SAR.</li><li><code>duration</code>: total duration of the saturation pulse.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/helper_functions.jl#L313-L328">source</a></section></article><h2 id="Optimisation-helper-functions"><a class="docs-heading-anchor" href="#Optimisation-helper-functions">Optimisation helper functions</a><a id="Optimisation-helper-functions-1"></a><a class="docs-heading-anchor-permalink" href="#Optimisation-helper-functions" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}" href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>MRIBuilder.BuildSequences.build_sequence</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Wrapper to build a sequence.</p><p>Use as </p><pre><code class="language-julia hljs">build_sequence(scanner;) do +variables.flip_angle(sequence)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(excitation = 89.99999999998374, refocus = 180.00000000001606)</code></pre><p>Here we can see that we get the <a href="../api/#MRIBuilder.Variables.variables.flip_angle"><code>variables.flip_angle</code></a> for each of the two RF pulses defined using <a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a> above.</p><p>The final component to defining summary variables is to define one or more default coherence pathways using <a href="#MRIBuilder.Variables.get_pathway"><code>get_pathway</code></a>:</p><pre><code class="language-julia hljs">get_pathway(seq::DiffusionSpinEcho) = Pathway(seq, [90, 180], 1, group=:diffusion)</code></pre><p>Here the coherence <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> sets out what a specific set of spins might experience during the sequence. In this case the sequence experiences two RF pulses and is excited by the first pulse and flipped by the second (<code>[90, 180]</code>). It is then observed during the first readout (<code>1</code>). For such a <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> we can compute:</p><ul><li>the time that the spin spends in each longitudinal and transverse direction, which is particularly useful in the transverse direction to compute the amount of T2-weighting (<a href="#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a>) and the amount of time spent dephasing to compute the amount of T2*-weighting (<a href="#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a>).</li><li>the diffusion weighting experienced (<a href="#MRIBuilder.Variables.variables.bval"><code>variables.bval</code></a>, <a href="#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a>, and <a href="#MRIBuilder.Variables.variables.net_dephasing"><code>variables.net_dephasing</code></a>)</li></ul><p>By defining a default pathway for the sequence, the user can now put constraints on any or all of these variables.</p><h2 id="helper_functions"><a class="docs-heading-anchor" href="#helper_functions">Component helper functions</a><a id="helper_functions-1"></a><a class="docs-heading-anchor-permalink" href="#helper_functions" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.dwi_gradients</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">dwi_gradients(; type, optimise=false, refocus=true, orientation=[1, 0, 0], group=:diffusion, variables...)</code></pre><p>Returns two diffusion-weighting gradients that are guaranteed to cancel each other out.</p><p><strong>Parameters</strong></p><ul><li><code>type</code>: A symbol describing the type of gradient. One of:<ul><li><code>:trapezoid</code>: Pulsed trapezoidal gradient profile. See <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> for the relevant <code>variables</code>.</li><li><code>:instant</code>: instantaneous gradient (e.g., to test short-pulse approximations). See <a href="../api/#MRIBuilder.Components.InstantGradients.InstantGradient"><code>InstantGradient</code></a> for the relevant <code>variables</code>.</li></ul></li><li><code>optimise</code>: Whether to optimise this readout event in isolation from the rest of the sequence. Use this with caution. It can speed up the optimisation (and for very complicated sequences make it more robust), however the resulting parameters might not represent the optimal solution of any external constraints (which are ignored if the readout is optimised in isolation).</li><li><code>scanner</code>: Used for testing. Do not set this parameter at this level (instead set it for the total sequence using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L181-L192">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.excitation_pulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">excitation_pulse(; parameters...)</code></pre><p>Create an excitation RF pulse.</p><p>By default there is no slice-selective gradient. To enable slice selection <code>min_slice_thickness</code> has to be set to a number or to :min. If <code>min_slice_thickness</code> is not set or is set to <code>:min</code>, then either <code>bandwidth</code> or <code>duration</code> should be set, otherwise the optimisation might be unconstrained (ignore this for <code>shape=:instant</code>).</p><p><strong>Parameters</strong></p><p>For an <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a> (i.e., <code>shape=:instant</code>), only the <code>flip_angle</code>, <code>phase</code>, and <code>group</code> will be used. All other parameters are ignored.</p><ul><li><code>optimise</code>: set to true to optimise this RF pulse separately from the embedding sequence.</li></ul><p><strong>Pulse parameters</strong></p><ul><li><code>shape</code>: The shape of the RF pulse. One of <code>:sinc</code> (for <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>), <code>:constant</code>/<code>:hard</code> (for <a href="../api/#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>ConstantPulse</code></a>), or <code>:instant</code> (for <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a>). Default is :sinc for slice-selective pulses or :instant otherwise.</li><li><code>flip_angle</code>: size of the flip due to the RF pulse in degrees (default: 90).</li><li><code>phase</code>: angle of the RF pulse in the x-y plane in degrees (default: 0).</li><li><code>frequency</code>: frequency of the RF pulse relative to the Larmor frequency in kHz (default: 0).</li><li><code>bandwidth</code>: width of the RF pulse in Fourier space in kHz (default: free variable).</li><li><code>duration</code>: duration of the RF pulse in ms (default: free variable).</li><li><code>Nzeros</code>: sets the number of zero crossings for a <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> (default: 3). Can be set to a tuple of two numbers to set a different number of zero crossings before and after the pulse maximum.</li><li><code>group</code>: name of the group of which the RF pulse is part. This is used to add transformations after the sequence is optimised.</li></ul><p><strong>Slice selection</strong></p><ul><li><code>slice_thickness</code>: minimum slice thickness that should be possible without adjusting the sequence timings in um (not mm!) (default: no slice selection). Can be set to <code>:min</code> to indicate that this should be minimised given the scanner constraints and user values for <code>bandwidth</code> or <code>duration</code>.</li><li><code>rephase</code>: set to false to disable the spin rephasing after the RF pulse.</li><li><code>rotate_grad</code>: name of the parameter with which the slice selection gradient will be rotated after sequence optimisation (default: <code>:FOV</code>).</li><li><code>scanner</code>: overrides the <a href="#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>global_scanner</code></a> for this part of the sequence. Recommended to set only if not part of a larger sequence.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L26-L54">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.gradient_spoiler-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.gradient_spoiler-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.gradient_spoiler</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_spoiler(; optimise=false, orientation=[0, 0, 1], rotate=:FOV, scale=:spoiler, spoiler=1., duration=:min, variables...)</code></pre><p>Returns two DWI gradients that are guaranteed to cancel each other out.</p><p><strong>Parameters</strong></p><ul><li><code>orientation</code>: Orientation of the gradient (default: slice-select direction).</li><li><code>rotate</code>: in which coordinate system is the <code>orientation</code> defined (default: :FOV).</li><li><code>scale</code>: variable controlling how the gradients should be scaled after optimsation (default: :spoiler).</li><li><code>optimise</code>: Whether to optimise this readout event in isolation from the rest of the sequence. Use this with caution. It can speed up the optimisation (and for very complicated sequences make it more robust), however the resulting parameters might not represent the optimal solution of any external constraints (which are ignored if the readout is optimised in isolation).</li><li><code>scanner</code>: Used for testing. Do not set this parameter at this level (instead set it for the total sequence using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>).</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.spoiler-sequence_optimisation"><code>variables.spoiler</code></a>: maximum spoiler scale (before applying any reductions due to <code>scale</code>).</li><li>Any other parameters expected by <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L288-L303">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}" href="#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>MRIBuilder.Parts.HelperFunctions.interpret_image_size</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">interpret_image_size(fov, resolution, voxel_size, slice_thickness)</code></pre><p>Combines the user-provided information of the image size to produce a tuple with:</p><ul><li><code>slice_thickness</code>: if not set explicitly, will be set to the third element of <code>voxel_size</code></li><li><code>resolution_z</code>: number of voxels in the slice-select direction.</li><li>keywords parameters for the <a href="#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a> functions with the <code>fov</code>, <code>resolution</code>, and <code>voxel_size</code> in the x- and y- dimensions.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L236-L243">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.readout_event</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">readout_event(; type, optimise=false, variables...)</code></pre><p>Adds a readout event to the sequence.</p><p><strong>Parameters</strong></p><ul><li><code>type</code>: A symbol describing the type of readout. It will default to <code>:epi</code> if a resolution has been set and <code>:instant</code> otherwise. Can be set to one of the following:<ul><li><code>:epi</code>: EPI readout. See <a href="../api/#MRIBuilder.Parts.EPIReadouts.EPIReadout"><code>EPIReadout</code></a> for the relevant <code>variables</code>.</li><li><code>:instant</code>: single isolated readout event <a href="../api/#MRIBuilder.Components.Readouts.SingleReadouts.SingleReadout"><code>SingleReadout</code></a> (e.g., for NMR). Does not expect any <code>variables</code>.</li></ul></li><li><code>optimise</code>: Whether to optimise this readout event in isolation from the rest of the sequence. Use this with caution. It can speed up the optimisation (and for very complicated sequences make it more robust), however the resulting parameters might not represent the optimal solution of any external constraints (which are ignored if the readout is optimised in isolation).</li><li><code>scanner</code>: Used for testing. Do not set this parameter at this level (instead set it for the total sequence using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L146-L157">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.refocus_pulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">refocus_pulse(; parameters...)</code></pre><p>Create an excitation RF pulse.</p><p>By default there is no slice-selective gradient. To enable slice selection <code>slice_thickness</code> has to be set to a number or to :min. If <code>slice_thickness</code> is not set or is set to <code>:min</code>, then either <code>bandwidth</code> or <code>duration</code> should be set, otherwise the optimisation might be unconstrained (ignore this for <code>shape=:instant</code>).</p><p><strong>Parameters</strong></p><ul><li><code>optimise</code>: set to true to optimise this RF pulse separately from the embedding sequence.</li></ul><p><strong>Pulse parameters</strong></p><p>For an <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a> (i.e., <code>shape=:instant</code>), only the <code>flip_angle</code>, <code>phase</code>, and <code>group</code> will be used. All other parameters are ignored.</p><ul><li><code>shape</code>: The shape of the RF pulse. One of <code>:sinc</code> (for <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>), <code>:constant</code>/<code>:hard</code> (for <a href="../api/#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>ConstantPulse</code></a>), or <code>:instant</code> (for <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a>). Default is :sinc for slice-selective pulses or :instant otherwise.</li><li><code>flip_angle</code>: size of the flip due to the RF pulse in degrees (default: 180).</li><li><code>phase</code>: angle of the RF pulse in the x-y plane in degrees (default: 0).</li><li><code>frequency</code>: frequency of the RF pulse relative to the Larmor frequency in kHz (default: 0).</li><li><code>bandwidth</code>: width of the RF pulse in Fourier space in kHz (default: free variable).</li><li><code>duration</code>: duration of the RF pulse in ms (default: free variable).</li><li><code>Nzeros</code>: sets the number of zero crossings for a <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> (default: 3). Can be set to a tuple of two numbers to set a different number of zero crossings before and after the pulse maximum.</li><li><code>group</code>: name of the group of which the RF pulse is part. This is used to add transformations after the sequence is optimised.</li></ul><p><strong>Slice selection and spoilers</strong></p><ul><li><code>slice_thickness</code>: minimum slice thickness that should be possible without adjusting the sequence timings in um (not mm!) (default: no slice selection). Can be set to <code>:min</code> to indicate that this should be minimised given the scanner constraints and user values for <code>bandwidth</code> or <code>duration</code>.</li><li><code>spoiler</code>: set to the spatial scale on which the spins should be dephased in mm. For rotating spoilers, this does include the contribution from the slice select gradient as well.</li><li><code>rotate_grad</code>: name of the parameter with which the slice selection and spoiler gradient will be rotated after sequence optimisation (default: <code>:FOV</code>).</li><li><code>scanner</code>: overrides the <a href="#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>global_scanner</code></a> for this part of the sequence. Recommended to set only if not part of a larger sequence.</li><li><code>orientation</code>: vector with orientation of slice select gradient and pulses (defaults: z-direction).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L86-L115">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Parts.HelperFunctions.saturation_pulse-Tuple{}" href="#MRIBuilder.Parts.HelperFunctions.saturation_pulse-Tuple{}"><code>MRIBuilder.Parts.HelperFunctions.saturation_pulse</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">saturation_pulse(; pulse=(), binomial_order=1, variables...)</code></pre><p>Creates a saturation pulse consisting of repeating instances of <code>pulse_type</code>.</p><p><strong>Parameters</strong></p><ul><li><code>pulse</code>: Parameters/variables used to define the basic RF pulse used in the saturation pulse. These can be:<ul><li><code>type</code>: <a href="../api/#MRIBuilder.Components.Pulses.ConstantPulses.ConstantPulse"><code>ConstantPulse</code></a> (default), <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>, <a href="../api/#MRIBuilder.Components.Pulses.InstantPulses.InstantPulse"><code>InstantPulse</code></a>, etc.</li><li>Variables describing that type (e.g., <code>flip_angle</code>, <code>duration</code>, <code>frequency</code>)</li></ul></li><li><code>binomial_order</code>: How many repeats of <code>pulse_type</code> there should be in a single binomial pulse.</li></ul><p><strong>Variables</strong></p><ul><li><code>nrepeat</code>: number of repeats of the binomial pulse. This should typically be set by the user.</li><li><code>interblock_delay</code>: time between the start of each pulse. Should be short compared with the T1, but long enough to limit SAR.</li><li><code>duration</code>: total duration of the saturation pulse.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/helper_functions.jl#L313-L328">source</a></section></article><h2 id="Optimisation-helper-functions"><a class="docs-heading-anchor" href="#Optimisation-helper-functions">Optimisation helper functions</a><a id="Optimisation-helper-functions-1"></a><a class="docs-heading-anchor-permalink" href="#Optimisation-helper-functions" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}" href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>MRIBuilder.BuildSequences.build_sequence</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Wrapper to build a sequence.</p><p>Use as </p><pre><code class="language-julia hljs">build_sequence(scanner;) do ... end</code></pre><p>Within the code block you can create one or more sequences, e.g.</p><pre><code class="nohighlight hljs">seq = Sequence( SincPulse(flip_angle=90, phase=0, duration=2., bandwidth=:max) nothing., SingleReadout -)</code></pre><p>You can also add any arbitrary constraints or objectives using one of:</p><ul><li><code>set_simple_constraints!</code></li><li><code>apply_simple_constraint!</code></li><li><code>add_cost_function!</code></li></ul><p>As soon as the code block ends the sequence is optimised (if <code>optimise=true</code>) and returned.</p><p><strong>Parameters</strong></p><ul><li><code>scanner</code>: Set to a <a href="../scanners/#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> to limit the gradient strength and slew rate. When this call to <code>build_sequence</code> is embedded in another, this parameter can be set to <code>nothing</code> to indicate that the same scanner should be used. </li><li><code>optimise</code>: Whether to optimise and fix the sequence as soon as it is returned. This defaults to <code>true</code> if a scanner is provided and <code>false</code> if no scanner is provided.</li><li><code>n_attempts</code>: How many times to restart the optimiser (default: 20)? Decrease if you want to quickly check feasibility of a simple sequence. Increase if convergence fails for a complex sequence.</li><li><code>kwargs...</code>: Other keywords are passed on as attributes to the <code>optimiser_constructor</code> (e.g., set <code>print_level=3</code> to make the Ipopt optimiser quieter).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/build_sequences.jl#L32-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.fixed-Tuple{Any}" href="#MRIBuilder.BuildSequences.fixed-Tuple{Any}"><code>MRIBuilder.BuildSequences.fixed</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fixed(building_block)</code></pre><p>Return an equiavalent <code>BuildingBlock</code> with all free variables replaced by numbers.</p><p>This will only work after calling <code>optimize!</code>(@ref)(<a href="@ref"><code>global_model</code></a>()). It is used internally by <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/build_sequences.jl#L235-L242">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.get_optimiser-Tuple{JuMP.Model}" href="#MRIBuilder.BuildSequences.get_optimiser-Tuple{JuMP.Model}"><code>MRIBuilder.BuildSequences.get_optimiser</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_optimiser(model)</code></pre><p>Returns a JuMP solver (https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers) appropriate for this model.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/build_sequences.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.global_scanner-Tuple{}" href="#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>MRIBuilder.BuildSequences.global_scanner</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">global_scanner()</code></pre><p>Return the currently set <a href="../scanners/#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a>.</p><p>The scanner can be set using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/build_sequences.jl#L220-L226">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.iterate_cost-Tuple{}" href="#MRIBuilder.BuildSequences.iterate_cost-Tuple{}"><code>MRIBuilder.BuildSequences.iterate_cost</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iterate_cost()</code></pre><p>Return a sequence of all the cost functions that should be optimised in order.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/build_sequences.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.model_has_integers-Tuple{JuMP.Model}" href="#MRIBuilder.BuildSequences.model_has_integers-Tuple{JuMP.Model}"><code>MRIBuilder.BuildSequences.model_has_integers</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">model_has_integers(model)</code></pre><p>Returns true if the model contains integer variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/build_sequences.jl#L106-L110">source</a></section></article><h2 id="Pathways-API"><a class="docs-heading-anchor" href="#Pathways-API">Pathways API</a><a id="Pathways-API-1"></a><a class="docs-heading-anchor-permalink" href="#Pathways-API" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.GradientTracker" href="#MRIBuilder.Pathways.GradientTracker"><code>MRIBuilder.Pathways.GradientTracker</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Helper structure for <a href="#MRIBuilder.Pathways.PathwayWalker"><code>PathwayWalker</code></a>, which is itself a helper for <code>Pathway</code>. You are deep down the rabit hole now...</p><p>For documentation, see that structure and <a href="#MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}"><code>walk_pathway!</code></a> and <a href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_gradient!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L222-L226">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.Pathway" href="#MRIBuilder.Pathways.Pathway"><code>MRIBuilder.Pathways.Pathway</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Pathway(sequence::Sequence, pulse_effects::Vector{:Symbol/Number}, readout_index=1; group=nothing)</code></pre><p>Describes how a specific spin/isochromat might experience the sequence.</p><p>Only a single pathway through the RF pulses is considered, so that at every point in time the spins are in one of the following four states:</p><ul><li>+longitudinal: initial relaxed state</li><li>+transverse: excited state. During this time gradients will affect the <a href="#MRIBuilder.Variables.variables.area_under_curve"><code>variables.area_under_curve</code></a> (or <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.qval-sequence_optimisation"><code>variables.qval</code></a>) and <a href="#MRIBuilder.Variables.variables.bval"><code>variables.bval</code></a>.</li><li>-longitudinal: inverse state</li><li>-transverse: inverse excited state. During this time all gradients will have the inverse effect compared with +transverse.</li></ul><p>The RF pulses cause mappings between these different states as described below.</p><p><strong>Parameters</strong></p><ul><li><code>sequence</code>: MRI <a href="../api/#MRIBuilder.Containers.BaseSequences.Sequence"><code>Sequence</code></a> to be considered.</li><li><code>pulse_effects</code>: How each RF pulse affects the spins. This can be one of the following:<ul><li><code>:skip</code>/<code>:ignore</code>/0: This RF pulse leaves the spins unaffected.</li><li><code>:refocus</code>/<code>:invert</code>/180: Flips the sign of the spin state (i.e., +longitudinal <-> -longitudinal, +transverse <-> -transverse)</li><li><code>:excite</code>/90: Takes spin state one step along the following sequence +longitudinal -> +transverse -> -longitudinal -> -transverse -> +longitudinal</li><li><code>:neg_excite</code>/270/-90: Inverse step compared with <code>:excite</code>.</li></ul></li><li><code>readout_index</code>: After encountering the number of pulses as defined in <code>pulse_effects</code>, continue the <code>Pathway</code> until the readout given by <code>index</code> is reached. If set to 0 the <code>Pathway</code> is terminated immediately after the last RF pulse.</li><li><code>group</code>: which gradient grouping to consider for the <code>net_dephasing</code> and <code>bmat</code>. If not set, all gradients will be considered (using their current alignment).</li></ul><p><strong>Attributes</strong></p><p>Over the pathway the following values are computed. Each can be accessed by calling the appropriate function:</p><p><strong>Timings</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.duration_state"><code>variables.duration_state</code></a>: The total amount of time spent in a specific state in this pathway (+longitudinal, +transverse, -longitudinal, or -transverse)</li><li><a href="#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a>: The total amount of time the spins spent in the transverse plane in ms. This can be used to quantify the expected effect of T2-decay.</li><li><a href="#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a>: The total amount of time the spins spent in the +transverse relative to -transverse state in ms. The absolute value of this can be used to quantify the expected effect of T2'-decay.</li></ul><p><strong>Effect of gradients</strong></p><p>The area under curve, q-values, and b-values are computed separately for each group of gradients (depending on the <code>group</code> keyword set during construction).</p><ul><li><a href="#MRIBuilder.Variables.variables.net_dephasing"><code>variables.net_dephasing</code></a>: Net displacement vector in k-space/q-space.</li><li><a href="#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a>: Net diffusion weighting due to gradients along the <code>Pathway</code> in matrix form.</li><li><a href="#MRIBuilder.Variables.variables.bval"><code>variables.bval</code></a>: Net diffusion weighting due to gradients along the <code>Pathway</code> as a single number.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L9-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.PathwayWalker" href="#MRIBuilder.Pathways.PathwayWalker"><code>MRIBuilder.Pathways.PathwayWalker</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Helper structure for <code>Pathway</code>.</p><p>For documentation, see that structure and <a href="#MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}"><code>walk_pathway!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L236-L240">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.duration_state_index-Tuple{Any, Any}" href="#MRIBuilder.Pathways.duration_state_index-Tuple{Any, Any}"><code>MRIBuilder.Pathways.duration_state_index</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_state_index(transverse, positive)</code></pre><p>Returns the index of a specific state in the <code>Pathway.duration_state</code> vector.</p><p>This function is used internally to access that vector.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L492-L498">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.interpret_pulse_effects-Tuple{Number}" href="#MRIBuilder.Pathways.interpret_pulse_effects-Tuple{Number}"><code>MRIBuilder.Pathways.interpret_pulse_effects</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">interpret_pulse_effects(number_or_symbol)</code></pre><p>Interpret the various numbers and symbols that can be passed on to a <code>Pathway</code>.</p><p>The result will be one of:</p><ul><li>:ignore (if input is 0, :ignore, or :skip).</li><li>:excite (if input is 90 or :excite).</li><li>:refocus (if input is 180, :refocus, or :excite).</li><li>:neg_excite (if input is -90, 270, or :negexcite).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L178-L188">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_gradient_tracker_till_time!-Tuple{MRIBuilder.Pathways.PathwayWalker, Union{Nothing, Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}" href="#MRIBuilder.Pathways.update_gradient_tracker_till_time!-Tuple{MRIBuilder.Pathways.PathwayWalker, Union{Nothing, Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}"><code>MRIBuilder.Pathways.update_gradient_tracker_till_time!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_gradient_tracker_till_time!(walker::PathwayWalker, key, new_time) -update_gradient_tracker_till_time!(tracker::GradientTracker, new_time)</code></pre><p>Update the <code>bmat</code> for any time passed since the last update (assuming there will no gradients during that period).</p><p>The <code>bmat</code> is updated with the outer produce of <code>qvec</code> with itself multiplied by the time since the last update.</p><p>When called with the first signature the tracker will be created from scratch if a tracker with that <code>key</code> does not exist.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L373-L382">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}" href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>MRIBuilder.Pathways.update_walker_gradient!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_gradient!(gradient_block::GradientWaveform, walker::PathwayWalker, gradient_start_time::VariableType; overlapping_pulses=[], overlapping_readouts=[])</code></pre><p>Update the walker's <code>qvec</code> and <code>bmat</code> based on the given <code>gradient_block</code>.</p><p>The following steps will be taken:</p><ul><li>Do nothing if <code>walker.is_transverse</code> is false</li><li>increase the appropriate <code>walker.bmat</code> by the outer product of <code>walker.qvec</code> with itself multiplied by the time since the last gradient</li><li>update the appropriate <code>walker.qvec</code> and <code>walker.bmat</code> based on the gradient waveform. This will require appropriate <code>qvec</code>/<code>bmat</code> functions to be defined for the gradient building block.</li><li>update <code>walker.last_gradient_time</code> to the time at the end of the gradient.</li></ul><p>This requires <a href="../api/#MRIBuilder.Variables.variables.bmat_gradient"><code>variables.bmat_gradient</code></a> and <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> to be implemented for the <a href="../api/#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L448-L460">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_instant_gradient!-Union{Tuple{N}, Tuple{InstantGradient{N}, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}} where N" href="#MRIBuilder.Pathways.update_walker_instant_gradient!-Union{Tuple{N}, Tuple{InstantGradient{N}, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}} where N"><code>MRIBuilder.Pathways.update_walker_instant_gradient!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_instant_gradient!(gradient, walker)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L480-L482">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_pulse!-Tuple{MRIBuilder.Pathways.PathwayWalker, AbstractVector{Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}" href="#MRIBuilder.Pathways.update_walker_pulse!-Tuple{MRIBuilder.Pathways.PathwayWalker, AbstractVector{Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}"><code>MRIBuilder.Pathways.update_walker_pulse!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_pulse!(walker::PathwayWalker, pulse_effects::Vector, pulse_time)</code></pre><p>Apply the first element of <code>pulse_effects</code> to the <code>walker</code> at the given <code>pulse_time</code>.</p><p>The following steps will be taken if the first <code>pulse_effect</code> is not <code>:ignore</code></p><ul><li>if <code>walker.is_transverse</code> is true before the pulse, increase the <code>walker.bmat</code> by the outer product of <code>walker.qvec</code> with itself multiplied by the time since the last gradient</li><li>update <code>walker.duration_states</code> with time since last pulse.</li><li>update <code>walker.last_pulse_time</code></li><li>update <code>walker.is_transverse</code>, and <code>walker.is_positive</code> based on the first value in <code>pulse_effects</code>. </li><li>if <code>walker.is_positive</code> changed in the previous step than the <code>walker.qvec</code> needs to be flipped.</li><li>remove the first element from <code>pulse_effects</code>.</li></ul><p>If the first element is <code>:ignore</code> the only effect is that the first element is removed from <code>pulse_effects</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L398-L412">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_till_time!" href="#MRIBuilder.Pathways.update_walker_till_time!"><code>MRIBuilder.Pathways.update_walker_till_time!</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_till_time!(walker::PathwayWalker, new_time[, gradient_group])</code></pre><p>Updates all parts of a <a href="#MRIBuilder.Pathways.PathwayWalker"><code>PathwayWalker</code></a> up to the given time.</p><p>This updates the <code>walker.duration_states</code> and the <code>bmat</code> for each gradient tracker. If <code>gradient_group</code> are provided, then only the gradient tracker matching that group will be updated. If that gradient tracker does not exist, it will be created.</p><p>This function is used to get the <code>walker</code> up to date till the start of a gradient, pulse, or final readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L347-L357">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}" href="#MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}"><code>MRIBuilder.Pathways.walk_pathway!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">walk_pathway!(bb::Sequence/BuildingBlock, walker::PathwayWalker, pulse_effects::Vector, nreadout::Ref{Int}, start_time)</code></pre><p>Computes the effect of a specific <a href="../api/#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> (starting at <code>start_time</code>) on the <a href="#MRIBuilder.Pathways.PathwayWalker"><code>PathwayWalker</code></a>.</p><p>For individual pulses and gradients, the following behaviour is implemented:</p><ul><li>If a pulse is encountered, call <a href="#MRIBuilder.Pathways.update_walker_pulse!-Tuple{MRIBuilder.Pathways.PathwayWalker, AbstractVector{Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_pulse!</code></a><code>(walker, pulse_effects, pulse_effective_time)</code></li><li>If a gradient is encountered, call <a href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_gradient!</code></a>(gradient, walker, gradient<em>start</em>time)</li></ul><p>For overlapping gradients/pulses, one should first encounter the part of the gradient before the <a href="../api/#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a> of the pulse, then apply the pulse, and then the rest of the gradient. This effective time can be passed on to <a href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_gradient!</code></a> to allow part of the gradient waveform to be applied.</p><p>The function should return <code>true</code> if the <code>Pathway</code> has reached its end (i.e., the final readout) and <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L255-L269">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_pathway" href="#MRIBuilder.Variables.get_pathway"><code>MRIBuilder.Variables.get_pathway</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_pathway(sequence)</code></pre><p>Gets the main <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> that spins are expected to experience in the sequence.</p><p>Multiple pathways might be returned as an array or (named)tuple.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L168-L174">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.area_under_curve" href="#MRIBuilder.Variables.variables.area_under_curve"><code>MRIBuilder.Variables.variables.area_under_curve</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">area_under_curve(pathway::Pathway)</code></pre><p>Return net displacement in k-space (i.e., spoiling) experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a>.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>area_under_curve</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L131-L139">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat" href="#MRIBuilder.Variables.variables.bmat"><code>MRIBuilder.Variables.variables.bmat</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat(pathway::Pathway)</code></pre><p>Return 3x3 diffusion-weighted matrix experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>bmat</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L144-L152">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bval" href="#MRIBuilder.Variables.variables.bval"><code>MRIBuilder.Variables.variables.bval</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bval(pathway::Pathway)</code></pre><p>Return size of diffusion-weighting experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane will contribute to the diffusion weighting.</p><p>Returns a NamedTuple with the <code>bval</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L156-L164">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_dephase" href="#MRIBuilder.Variables.variables.duration_dephase"><code>MRIBuilder.Variables.variables.duration_dephase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_dephase(pathway::Pathway)</code></pre><p>Returns the net time that spins following the given <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the +transverse versus the -transverse state. This determines the amount of T2'-weighting as <span>$e^{t/T_2'}$</span>, where <span>$t$</span> is the <code>duration_dephase</code>.</p><p>Also see <a href="#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a> for T2-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L106-L113">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_state" href="#MRIBuilder.Variables.variables.duration_state"><code>MRIBuilder.Variables.variables.duration_state</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_state(pathway::Pathway, transverse::Bool, positive::Bool)</code></pre><p>Returns how long the <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in a specific state.</p><p>The requested state can be set using <code>transverse</code> and <code>positive</code> as follows:</p><ul><li><code>transverse=false</code>, <code>positive=true</code>: +longitudinal</li><li><code>transverse=true</code>, <code>positive=true</code>: +transverse</li><li><code>transverse=false</code>, <code>positive=false</code>: -longitudinal</li><li><code>transverse=true</code>, <code>positive=false</code>: -transverse</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L77-L87">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_transverse" href="#MRIBuilder.Variables.variables.duration_transverse"><code>MRIBuilder.Variables.variables.duration_transverse</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_transverse(pathway::Pathway)</code></pre><p>Returns the total amount of time that spins following the given <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the transverse plane. This determines the amount of T2-weighting as <span>$e^{t/T_2}$</span>, where <span>$t$</span> is the <code>duration_transverse</code>.</p><p>Also see <a href="#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a> for T2'-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L93-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.net_dephasing" href="#MRIBuilder.Variables.variables.net_dephasing"><code>MRIBuilder.Variables.variables.net_dephasing</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">net_dephasing(pathway::Pathway)</code></pre><p>Return net displacement vector in k-space/q-space experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in kHz/um.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>qvec</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L118-L126">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../implemented_sequences/">« Implemented sequences</a><a class="docs-footer-nextpage" href="../adjust_sequences/">Post-hoc adjustments »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> +)</code></pre><p>You can also add any arbitrary constraints or objectives using one of:</p><ul><li><code>set_simple_constraints!</code></li><li><code>apply_simple_constraint!</code></li><li><code>add_cost_function!</code></li></ul><p>As soon as the code block ends the sequence is optimised (if <code>optimise=true</code>) and returned.</p><p><strong>Parameters</strong></p><ul><li><code>scanner</code>: Set to a <a href="../scanners/#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> to limit the gradient strength and slew rate. When this call to <code>build_sequence</code> is embedded in another, this parameter can be set to <code>nothing</code> to indicate that the same scanner should be used. </li><li><code>optimise</code>: Whether to optimise and fix the sequence as soon as it is returned. This defaults to <code>true</code> if a scanner is provided and <code>false</code> if no scanner is provided.</li><li><code>n_attempts</code>: How many times to restart the optimiser (default: 20)? Decrease if you want to quickly check feasibility of a simple sequence. Increase if convergence fails for a complex sequence.</li><li><code>kwargs...</code>: Other keywords are passed on as attributes to the <code>optimiser_constructor</code> (e.g., set <code>print_level=3</code> to make the Ipopt optimiser quieter).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/build_sequences.jl#L32-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.fixed-Tuple{Any}" href="#MRIBuilder.BuildSequences.fixed-Tuple{Any}"><code>MRIBuilder.BuildSequences.fixed</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fixed(building_block)</code></pre><p>Return an equiavalent <code>BuildingBlock</code> with all free variables replaced by numbers.</p><p>This will only work after calling <code>optimize!</code>(@ref)(<a href="@ref"><code>global_model</code></a>()). It is used internally by <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/build_sequences.jl#L235-L242">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.get_optimiser-Tuple{JuMP.Model}" href="#MRIBuilder.BuildSequences.get_optimiser-Tuple{JuMP.Model}"><code>MRIBuilder.BuildSequences.get_optimiser</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_optimiser(model)</code></pre><p>Returns a JuMP solver (https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers) appropriate for this model.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/build_sequences.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.global_scanner-Tuple{}" href="#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>MRIBuilder.BuildSequences.global_scanner</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">global_scanner()</code></pre><p>Return the currently set <a href="../scanners/#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a>.</p><p>The scanner can be set using <a href="#MRIBuilder.BuildSequences.build_sequence-Tuple{Function, Union{Nothing, Scanner}, Tuple, Bool, Int64}"><code>build_sequence</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/build_sequences.jl#L220-L226">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.iterate_cost-Tuple{}" href="#MRIBuilder.BuildSequences.iterate_cost-Tuple{}"><code>MRIBuilder.BuildSequences.iterate_cost</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">iterate_cost()</code></pre><p>Return a sequence of all the cost functions that should be optimised in order.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/build_sequences.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.BuildSequences.model_has_integers-Tuple{JuMP.Model}" href="#MRIBuilder.BuildSequences.model_has_integers-Tuple{JuMP.Model}"><code>MRIBuilder.BuildSequences.model_has_integers</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">model_has_integers(model)</code></pre><p>Returns true if the model contains integer variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/build_sequences.jl#L106-L110">source</a></section></article><h2 id="Pathways-API"><a class="docs-heading-anchor" href="#Pathways-API">Pathways API</a><a id="Pathways-API-1"></a><a class="docs-heading-anchor-permalink" href="#Pathways-API" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.GradientTracker" href="#MRIBuilder.Pathways.GradientTracker"><code>MRIBuilder.Pathways.GradientTracker</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Helper structure for <a href="#MRIBuilder.Pathways.PathwayWalker"><code>PathwayWalker</code></a>, which is itself a helper for <code>Pathway</code>. You are deep down the rabit hole now...</p><p>For documentation, see that structure and <a href="#MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}"><code>walk_pathway!</code></a> and <a href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_gradient!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L222-L226">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.Pathway" href="#MRIBuilder.Pathways.Pathway"><code>MRIBuilder.Pathways.Pathway</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Pathway(sequence::Sequence, pulse_effects::Vector{:Symbol/Number}, readout_index=1; group=nothing)</code></pre><p>Describes how a specific spin/isochromat might experience the sequence.</p><p>Only a single pathway through the RF pulses is considered, so that at every point in time the spins are in one of the following four states:</p><ul><li>+longitudinal: initial relaxed state</li><li>+transverse: excited state. During this time gradients will affect the <a href="#MRIBuilder.Variables.variables.area_under_curve"><code>variables.area_under_curve</code></a> (or <a href="../sequence_optimisation/#MRIBuilder.Variables.variables.qval-sequence_optimisation"><code>variables.qval</code></a>) and <a href="#MRIBuilder.Variables.variables.bval"><code>variables.bval</code></a>.</li><li>-longitudinal: inverse state</li><li>-transverse: inverse excited state. During this time all gradients will have the inverse effect compared with +transverse.</li></ul><p>The RF pulses cause mappings between these different states as described below.</p><p><strong>Parameters</strong></p><ul><li><code>sequence</code>: MRI <a href="../api/#MRIBuilder.Containers.BaseSequences.Sequence"><code>Sequence</code></a> to be considered.</li><li><code>pulse_effects</code>: How each RF pulse affects the spins. This can be one of the following:<ul><li><code>:skip</code>/<code>:ignore</code>/0: This RF pulse leaves the spins unaffected.</li><li><code>:refocus</code>/<code>:invert</code>/180: Flips the sign of the spin state (i.e., +longitudinal <-> -longitudinal, +transverse <-> -transverse)</li><li><code>:excite</code>/90: Takes spin state one step along the following sequence +longitudinal -> +transverse -> -longitudinal -> -transverse -> +longitudinal</li><li><code>:neg_excite</code>/270/-90: Inverse step compared with <code>:excite</code>.</li></ul></li><li><code>readout_index</code>: After encountering the number of pulses as defined in <code>pulse_effects</code>, continue the <code>Pathway</code> until the readout given by <code>index</code> is reached. If set to 0 the <code>Pathway</code> is terminated immediately after the last RF pulse.</li><li><code>group</code>: which gradient grouping to consider for the <code>net_dephasing</code> and <code>bmat</code>. If not set, all gradients will be considered (using their current alignment).</li></ul><p><strong>Attributes</strong></p><p>Over the pathway the following values are computed. Each can be accessed by calling the appropriate function:</p><p><strong>Timings</strong></p><ul><li><a href="#MRIBuilder.Variables.variables.duration_state"><code>variables.duration_state</code></a>: The total amount of time spent in a specific state in this pathway (+longitudinal, +transverse, -longitudinal, or -transverse)</li><li><a href="#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a>: The total amount of time the spins spent in the transverse plane in ms. This can be used to quantify the expected effect of T2-decay.</li><li><a href="#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a>: The total amount of time the spins spent in the +transverse relative to -transverse state in ms. The absolute value of this can be used to quantify the expected effect of T2'-decay.</li></ul><p><strong>Effect of gradients</strong></p><p>The area under curve, q-values, and b-values are computed separately for each group of gradients (depending on the <code>group</code> keyword set during construction).</p><ul><li><a href="#MRIBuilder.Variables.variables.net_dephasing"><code>variables.net_dephasing</code></a>: Net displacement vector in k-space/q-space.</li><li><a href="#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a>: Net diffusion weighting due to gradients along the <code>Pathway</code> in matrix form.</li><li><a href="#MRIBuilder.Variables.variables.bval"><code>variables.bval</code></a>: Net diffusion weighting due to gradients along the <code>Pathway</code> as a single number.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L9-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.PathwayWalker" href="#MRIBuilder.Pathways.PathwayWalker"><code>MRIBuilder.Pathways.PathwayWalker</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Helper structure for <code>Pathway</code>.</p><p>For documentation, see that structure and <a href="#MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}"><code>walk_pathway!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L236-L240">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.duration_state_index-Tuple{Any, Any}" href="#MRIBuilder.Pathways.duration_state_index-Tuple{Any, Any}"><code>MRIBuilder.Pathways.duration_state_index</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_state_index(transverse, positive)</code></pre><p>Returns the index of a specific state in the <code>Pathway.duration_state</code> vector.</p><p>This function is used internally to access that vector.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L492-L498">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.interpret_pulse_effects-Tuple{Number}" href="#MRIBuilder.Pathways.interpret_pulse_effects-Tuple{Number}"><code>MRIBuilder.Pathways.interpret_pulse_effects</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">interpret_pulse_effects(number_or_symbol)</code></pre><p>Interpret the various numbers and symbols that can be passed on to a <code>Pathway</code>.</p><p>The result will be one of:</p><ul><li>:ignore (if input is 0, :ignore, or :skip).</li><li>:excite (if input is 90 or :excite).</li><li>:refocus (if input is 180, :refocus, or :excite).</li><li>:neg_excite (if input is -90, 270, or :negexcite).</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L178-L188">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_gradient_tracker_till_time!-Tuple{MRIBuilder.Pathways.PathwayWalker, Union{Nothing, Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}" href="#MRIBuilder.Pathways.update_gradient_tracker_till_time!-Tuple{MRIBuilder.Pathways.PathwayWalker, Union{Nothing, Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}"><code>MRIBuilder.Pathways.update_gradient_tracker_till_time!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_gradient_tracker_till_time!(walker::PathwayWalker, key, new_time) +update_gradient_tracker_till_time!(tracker::GradientTracker, new_time)</code></pre><p>Update the <code>bmat</code> for any time passed since the last update (assuming there will no gradients during that period).</p><p>The <code>bmat</code> is updated with the outer produce of <code>qvec</code> with itself multiplied by the time since the last update.</p><p>When called with the first signature the tracker will be created from scratch if a tracker with that <code>key</code> does not exist.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L373-L382">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}" href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>MRIBuilder.Pathways.update_walker_gradient!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_gradient!(gradient_block::GradientWaveform, walker::PathwayWalker, gradient_start_time::VariableType; overlapping_pulses=[], overlapping_readouts=[])</code></pre><p>Update the walker's <code>qvec</code> and <code>bmat</code> based on the given <code>gradient_block</code>.</p><p>The following steps will be taken:</p><ul><li>Do nothing if <code>walker.is_transverse</code> is false</li><li>increase the appropriate <code>walker.bmat</code> by the outer product of <code>walker.qvec</code> with itself multiplied by the time since the last gradient</li><li>update the appropriate <code>walker.qvec</code> and <code>walker.bmat</code> based on the gradient waveform. This will require appropriate <code>qvec</code>/<code>bmat</code> functions to be defined for the gradient building block.</li><li>update <code>walker.last_gradient_time</code> to the time at the end of the gradient.</li></ul><p>This requires <a href="../api/#MRIBuilder.Variables.variables.bmat_gradient"><code>variables.bmat_gradient</code></a> and <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> to be implemented for the <a href="../api/#MRIBuilder.Components.AbstractTypes.GradientWaveform"><code>GradientWaveform</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L448-L460">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_instant_gradient!-Union{Tuple{N}, Tuple{InstantGradient{N}, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}} where N" href="#MRIBuilder.Pathways.update_walker_instant_gradient!-Union{Tuple{N}, Tuple{InstantGradient{N}, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}} where N"><code>MRIBuilder.Pathways.update_walker_instant_gradient!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_instant_gradient!(gradient, walker)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L480-L482">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_pulse!-Tuple{MRIBuilder.Pathways.PathwayWalker, AbstractVector{Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}" href="#MRIBuilder.Pathways.update_walker_pulse!-Tuple{MRIBuilder.Pathways.PathwayWalker, AbstractVector{Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}"><code>MRIBuilder.Pathways.update_walker_pulse!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_pulse!(walker::PathwayWalker, pulse_effects::Vector, pulse_time)</code></pre><p>Apply the first element of <code>pulse_effects</code> to the <code>walker</code> at the given <code>pulse_time</code>.</p><p>The following steps will be taken if the first <code>pulse_effect</code> is not <code>:ignore</code></p><ul><li>if <code>walker.is_transverse</code> is true before the pulse, increase the <code>walker.bmat</code> by the outer product of <code>walker.qvec</code> with itself multiplied by the time since the last gradient</li><li>update <code>walker.duration_states</code> with time since last pulse.</li><li>update <code>walker.last_pulse_time</code></li><li>update <code>walker.is_transverse</code>, and <code>walker.is_positive</code> based on the first value in <code>pulse_effects</code>. </li><li>if <code>walker.is_positive</code> changed in the previous step than the <code>walker.qvec</code> needs to be flipped.</li><li>remove the first element from <code>pulse_effects</code>.</li></ul><p>If the first element is <code>:ignore</code> the only effect is that the first element is removed from <code>pulse_effects</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L398-L412">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.update_walker_till_time!" href="#MRIBuilder.Pathways.update_walker_till_time!"><code>MRIBuilder.Pathways.update_walker_till_time!</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">update_walker_till_time!(walker::PathwayWalker, new_time[, gradient_group])</code></pre><p>Updates all parts of a <a href="#MRIBuilder.Pathways.PathwayWalker"><code>PathwayWalker</code></a> up to the given time.</p><p>This updates the <code>walker.duration_states</code> and the <code>bmat</code> for each gradient tracker. If <code>gradient_group</code> are provided, then only the gradient tracker matching that group will be updated. If that gradient tracker does not exist, it will be created.</p><p>This function is used to get the <code>walker</code> up to date till the start of a gradient, pulse, or final readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L347-L357">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}" href="#MRIBuilder.Pathways.walk_pathway!-Tuple{Sequence, MRIBuilder.Pathways.PathwayWalker, Vector{Symbol}, Ref{Int64}}"><code>MRIBuilder.Pathways.walk_pathway!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">walk_pathway!(bb::Sequence/BuildingBlock, walker::PathwayWalker, pulse_effects::Vector, nreadout::Ref{Int}, start_time)</code></pre><p>Computes the effect of a specific <a href="../api/#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a> (starting at <code>start_time</code>) on the <a href="#MRIBuilder.Pathways.PathwayWalker"><code>PathwayWalker</code></a>.</p><p>For individual pulses and gradients, the following behaviour is implemented:</p><ul><li>If a pulse is encountered, call <a href="#MRIBuilder.Pathways.update_walker_pulse!-Tuple{MRIBuilder.Pathways.PathwayWalker, AbstractVector{Symbol}, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_pulse!</code></a><code>(walker, pulse_effects, pulse_effective_time)</code></li><li>If a gradient is encountered, call <a href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_gradient!</code></a>(gradient, walker, gradient<em>start</em>time)</li></ul><p>For overlapping gradients/pulses, one should first encounter the part of the gradient before the <a href="../api/#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a> of the pulse, then apply the pulse, and then the rest of the gradient. This effective time can be passed on to <a href="#MRIBuilder.Pathways.update_walker_gradient!-Tuple{MRIBuilder.Components.GradientWaveforms.NoGradientBlocks.NoGradient, MRIBuilder.Pathways.PathwayWalker, Union{Number, JuMP.AbstractJuMPScalar}}"><code>update_walker_gradient!</code></a> to allow part of the gradient waveform to be applied.</p><p>The function should return <code>true</code> if the <code>Pathway</code> has reached its end (i.e., the final readout) and <code>false</code> otherwise.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L255-L269">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_pathway" href="#MRIBuilder.Variables.get_pathway"><code>MRIBuilder.Variables.get_pathway</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_pathway(sequence)</code></pre><p>Gets the main <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> that spins are expected to experience in the sequence.</p><p>Multiple pathways might be returned as an array or (named)tuple.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L168-L174">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.area_under_curve" href="#MRIBuilder.Variables.variables.area_under_curve"><code>MRIBuilder.Variables.variables.area_under_curve</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">area_under_curve(pathway::Pathway)</code></pre><p>Return net displacement in k-space (i.e., spoiling) experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a>.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>area_under_curve</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L131-L139">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat" href="#MRIBuilder.Variables.variables.bmat"><code>MRIBuilder.Variables.variables.bmat</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat(pathway::Pathway)</code></pre><p>Return 3x3 diffusion-weighted matrix experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>bmat</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L144-L152">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bval" href="#MRIBuilder.Variables.variables.bval"><code>MRIBuilder.Variables.variables.bval</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bval(pathway::Pathway)</code></pre><p>Return size of diffusion-weighting experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane will contribute to the diffusion weighting.</p><p>Returns a NamedTuple with the <code>bval</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L156-L164">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_dephase" href="#MRIBuilder.Variables.variables.duration_dephase"><code>MRIBuilder.Variables.variables.duration_dephase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_dephase(pathway::Pathway)</code></pre><p>Returns the net time that spins following the given <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the +transverse versus the -transverse state. This determines the amount of T2'-weighting as <span>$e^{t/T_2'}$</span>, where <span>$t$</span> is the <code>duration_dephase</code>.</p><p>Also see <a href="#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a> for T2-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L106-L113">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_state" href="#MRIBuilder.Variables.variables.duration_state"><code>MRIBuilder.Variables.variables.duration_state</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_state(pathway::Pathway, transverse::Bool, positive::Bool)</code></pre><p>Returns how long the <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in a specific state.</p><p>The requested state can be set using <code>transverse</code> and <code>positive</code> as follows:</p><ul><li><code>transverse=false</code>, <code>positive=true</code>: +longitudinal</li><li><code>transverse=true</code>, <code>positive=true</code>: +transverse</li><li><code>transverse=false</code>, <code>positive=false</code>: -longitudinal</li><li><code>transverse=true</code>, <code>positive=false</code>: -transverse</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L77-L87">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_transverse" href="#MRIBuilder.Variables.variables.duration_transverse"><code>MRIBuilder.Variables.variables.duration_transverse</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_transverse(pathway::Pathway)</code></pre><p>Returns the total amount of time that spins following the given <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the transverse plane. This determines the amount of T2-weighting as <span>$e^{t/T_2}$</span>, where <span>$t$</span> is the <code>duration_transverse</code>.</p><p>Also see <a href="#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a> for T2'-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L93-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.net_dephasing" href="#MRIBuilder.Variables.variables.net_dephasing"><code>MRIBuilder.Variables.variables.net_dephasing</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">net_dephasing(pathway::Pathway)</code></pre><p>Return net displacement vector in k-space/q-space experienced by the spins following a specific <a href="#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in kHz/um.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>qvec</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L118-L126">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../implemented_sequences/">« Implemented sequences</a><a class="docs-footer-nextpage" href="../adjust_sequences/">Post-hoc adjustments »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:04">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> diff --git a/dev/dwi_1_80_min_2_15.png b/dev/dwi_1_80_min_2_15.png index 9dea1720d4ca87e450bc746491973dec8a59c059..ae655dc3fb5a8f1a33f57c884d040655bdc591fb 100644 Binary files a/dev/dwi_1_80_min_2_15.png and b/dev/dwi_1_80_min_2_15.png differ diff --git a/dev/dwi_1_80_min_2_15_epi.png b/dev/dwi_1_80_min_2_15_epi.png index 5dcae52e82a0eef6645917f79efbf181854130e8..444490f59ab70122ea23b3357f76f89b3dde7919 100644 Binary files a/dev/dwi_1_80_min_2_15_epi.png and b/dev/dwi_1_80_min_2_15_epi.png differ diff --git a/dev/implemented_sequences/index.html b/dev/implemented_sequences/index.html index d963a82c53f28e78b5e0e27c6ebe746c07c2eeb7..88e78caf496199dbfa51f1e70dbf0005847ece72 100644 --- a/dev/implemented_sequences/index.html +++ b/dev/implemented_sequences/index.html @@ -10,4 +10,4 @@ f = plot(sequence) f</code></pre><p><img src="../dwi_1_80_min_2_15.png" alt="DWI sequence diagram with fixed diffusion time and rise time"/></p><p>Note that the previous sequences do not contain a realistic readout. Most sequences will only include an instant readout, unless you directly set the <a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a> and <a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>.</p><pre><code class="language-julia hljs">sequence = DiffusionSpinEcho(bval=1., TE=:min, voxel_size=2, resolution=(20, 20, 20)) f = plot(sequence) f</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">┌ Warning: The relaxation is only almost solved. -â”” @ Juniper ~/.julia/packages/Juniper/HBPrQ/src/model.jl:110</code></pre><p><img src="../dwi_1_80_min_2_15_epi.png" alt="DWI sequence diagram with EPI readout"/></p><h2 id="Available-sequences"><a class="docs-heading-anchor" href="#Available-sequences">Available sequences</a><a id="Available-sequences-1"></a><a class="docs-heading-anchor-permalink" href="#Available-sequences" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Sequences.GradientEchoes.GradientEcho-Tuple{}" href="#MRIBuilder.Sequences.GradientEchoes.GradientEcho-Tuple{}"><code>MRIBuilder.Sequences.GradientEchoes.GradientEcho</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">GradientEcho(; echo_time, excitation=(), readout=(), optim=() resolution/fov/voxel_size/slice_thickness, scanner)</code></pre><p>Defines a gradient echo sequence with a single readout event.</p><p>By default, an instant excitation pulse and readout event are used. If image parameters are provided, this will switch to a sinc pulse and EPI readout.</p><p><strong>Parameters</strong></p><ul><li><code>excitation</code>: properties of the excitation pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a>.</li><li><code>readout</code>: properties of the readout as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>.</li><li>Image parameters (<a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>/<a href="../api/#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>/<a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>/<a href="../api/#MRIBuilder.Variables.variables.slice_thickness"><code>variables.slice_thickness</code></a>): describe the properties of the resulting image. See <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>interpret_image_size</code></a> for details.</li><li><code>optim</code>: parameters to pass on to the Ipopt optimiser (see https://coin-or.github.io/Ipopt/OPTIONS.html).</li><li><code>scanner</code>: Sets the <a href="@ref"><code>Scanner</code></a> used to constraint the gradient parameters. If not set, the <a href="../scanners/#MRIBuilder.Scanners.Default_Scanner"><code>Default_Scanner</code></a> will be used.</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>variables.TE</code></a>/<a href="#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>: echo time between excitation pulse and readout in ms (required).</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total duration of the sequence from start of excitation pulse to end of readout in ms.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/gradient_echoes.jl#L11-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Sequences.SpinEchoes.SpinEcho-Tuple{}" href="#MRIBuilder.Sequences.SpinEchoes.SpinEcho-Tuple{}"><code>MRIBuilder.Sequences.SpinEchoes.SpinEcho</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SpinEcho(; echo_time, delay=0., excitation=(), refocus=(), readout=(), optim=(), resolution/fov/voxel_size/slice_thickness, scanner)</code></pre><p>Defines a gradient echo sequence with a single readout event.</p><p>By default, an instant excitation pulse and readout event are used. If image parameters are provided, this will switch to a sinc pulse and EPI readout.</p><p><strong>Parameters</strong></p><ul><li><a href="@ref"><code>excitation</code></a>: properties of the excitation pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a>.</li><li><a href="@ref"><code>refocus</code></a>: properties of the refocus pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>refocus_pulse</code></a>.</li><li><a href="@ref"><code>readout</code></a>: properties of the readout as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>.</li><li>Image parameters (<a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>/<a href="../api/#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>/<a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>/<a href="../api/#MRIBuilder.Variables.variables.slice_thickness"><code>variables.slice_thickness</code></a>): describe the properties of the resulting image. See <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>interpret_image_size</code></a> for details.</li><li><a href="@ref"><code>optim</code></a>: parameters to pass on to the Ipopt optimiser (see https://coin-or.github.io/Ipopt/OPTIONS.html).</li><li><a href="@ref"><code>scanner</code></a>: Sets the <a href="@ref"><code>Scanner</code></a> used to constraint the gradient parameters. If not set, the <a href="../scanners/#MRIBuilder.Scanners.Default_Scanner"><code>Default_Scanner</code></a> will be used.</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>variables.TE</code></a>/<a href="#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>: echo time between excitation pulse and spin echo in ms (required).</li><li><a href="#MRIBuilder.Variables.variables.delay"><code>variables.delay</code></a>: 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.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/spin_echoes.jl#L11-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.echo_time" href="#MRIBuilder.Variables.variables.echo_time"><code>MRIBuilder.Variables.variables.echo_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Returns the echo time of a sequence in ms.</p><p>This is typically defined as the time between the excitation pulse and the crossing of k=0 during the MRI readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/spin_echoes.jl#L56-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}" href="#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">DiffusionSpinEcho(; echo_time, delay=0., excitation=(), gradient=(), refocus=(), readout=(), optim=(), resolution/fov/voxel_size/slice_thickness, scanner)</code></pre><p>Defines a diffusion-weighted spin echo (Stejskal-Tanner) sequence.</p><p><code>DWI</code>, <code>DW_SE</code>, and <code>DiffusionSpinEcho</code> are all synonyms.</p><p>By default, an instant excitation pulse and readout event are used. If image parameters are provided, this will switch to a sinc pulse and EPI readout.</p><p><strong>Parameters</strong></p><ul><li><code>excitation</code>: properties of the excitation pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a>.</li><li><code>gradient</code>: properties of the diffusion-weighting gradients as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}"><code>dwi_gradients</code></a>.</li><li><code>refocus</code>: properties of the refocus pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>refocus_pulse</code></a>.</li><li><code>readout</code>: properties of the readout as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>.</li><li>Image parameters (<a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>/<a href="../api/#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>/<a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>/<a href="../api/#MRIBuilder.Variables.variables.slice_thickness"><code>variables.slice_thickness</code></a>): describe the properties of the resulting image. See <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>interpret_image_size</code></a> for details.</li><li><code>optim</code>: parameters to pass on to the Ipopt optimiser (see https://coin-or.github.io/Ipopt/OPTIONS.html).</li><li><code>scanner</code>: Sets the <a href="../scanners/#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> used to constraint the gradient parameters. If not set, the <a href="../scanners/#MRIBuilder.Scanners.Default_Scanner"><code>Default_Scanner</code></a> will be used.</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>variables.TE</code></a>/<a href="#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>: echo time between excitation pulse and spin echo in ms.</li><li><a href="#MRIBuilder.Variables.variables.delay"><code>variables.delay</code></a>: 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.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.Δ-sequence_optimisation"><code>variables.Δ</code></a>/<a href="#MRIBuilder.Variables.variables.diffusion_time"><code>variables.diffusion_time</code></a>: Time from the start of one diffusion-weighted gradient till the other in ms.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/diffusion_spin_echoes.jl#L15-L39">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.delay" href="#MRIBuilder.Variables.variables.delay"><code>MRIBuilder.Variables.variables.delay</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">delay(sequence)</code></pre><p>Returns the offset beetween the readout and the spin echo in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/diffusion_spin_echoes.jl#L91-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.diffusion_time" href="#MRIBuilder.Variables.variables.diffusion_time"><code>MRIBuilder.Variables.variables.diffusion_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">diffusion_time(diffusion_sequence)</code></pre><p>Returns the diffusion time of a <a href="#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a> in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/diffusion_spin_echoes.jl#L84-L88">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sequence_optimisation/">« Optimisation</a><a class="docs-footer-nextpage" href="../defining_sequence/">Defining sequences »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> +â”” @ Juniper ~/.julia/packages/Juniper/HBPrQ/src/model.jl:110</code></pre><p><img src="../dwi_1_80_min_2_15_epi.png" alt="DWI sequence diagram with EPI readout"/></p><h2 id="Available-sequences"><a class="docs-heading-anchor" href="#Available-sequences">Available sequences</a><a id="Available-sequences-1"></a><a class="docs-heading-anchor-permalink" href="#Available-sequences" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Sequences.GradientEchoes.GradientEcho-Tuple{}" href="#MRIBuilder.Sequences.GradientEchoes.GradientEcho-Tuple{}"><code>MRIBuilder.Sequences.GradientEchoes.GradientEcho</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">GradientEcho(; echo_time, excitation=(), readout=(), optim=() resolution/fov/voxel_size/slice_thickness, scanner)</code></pre><p>Defines a gradient echo sequence with a single readout event.</p><p>By default, an instant excitation pulse and readout event are used. If image parameters are provided, this will switch to a sinc pulse and EPI readout.</p><p><strong>Parameters</strong></p><ul><li><code>excitation</code>: properties of the excitation pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a>.</li><li><code>readout</code>: properties of the readout as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>.</li><li>Image parameters (<a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>/<a href="../api/#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>/<a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>/<a href="../api/#MRIBuilder.Variables.variables.slice_thickness"><code>variables.slice_thickness</code></a>): describe the properties of the resulting image. See <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>interpret_image_size</code></a> for details.</li><li><code>optim</code>: parameters to pass on to the Ipopt optimiser (see https://coin-or.github.io/Ipopt/OPTIONS.html).</li><li><code>scanner</code>: Sets the <a href="@ref"><code>Scanner</code></a> used to constraint the gradient parameters. If not set, the <a href="../scanners/#MRIBuilder.Scanners.Default_Scanner"><code>Default_Scanner</code></a> will be used.</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>variables.TE</code></a>/<a href="#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>: echo time between excitation pulse and readout in ms (required).</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total duration of the sequence from start of excitation pulse to end of readout in ms.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/gradient_echoes.jl#L11-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Sequences.SpinEchoes.SpinEcho-Tuple{}" href="#MRIBuilder.Sequences.SpinEchoes.SpinEcho-Tuple{}"><code>MRIBuilder.Sequences.SpinEchoes.SpinEcho</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">SpinEcho(; echo_time, delay=0., excitation=(), refocus=(), readout=(), optim=(), resolution/fov/voxel_size/slice_thickness, scanner)</code></pre><p>Defines a gradient echo sequence with a single readout event.</p><p>By default, an instant excitation pulse and readout event are used. If image parameters are provided, this will switch to a sinc pulse and EPI readout.</p><p><strong>Parameters</strong></p><ul><li><a href="@ref"><code>excitation</code></a>: properties of the excitation pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a>.</li><li><a href="@ref"><code>refocus</code></a>: properties of the refocus pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>refocus_pulse</code></a>.</li><li><a href="@ref"><code>readout</code></a>: properties of the readout as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>.</li><li>Image parameters (<a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>/<a href="../api/#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>/<a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>/<a href="../api/#MRIBuilder.Variables.variables.slice_thickness"><code>variables.slice_thickness</code></a>): describe the properties of the resulting image. See <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>interpret_image_size</code></a> for details.</li><li><a href="@ref"><code>optim</code></a>: parameters to pass on to the Ipopt optimiser (see https://coin-or.github.io/Ipopt/OPTIONS.html).</li><li><a href="@ref"><code>scanner</code></a>: Sets the <a href="@ref"><code>Scanner</code></a> used to constraint the gradient parameters. If not set, the <a href="../scanners/#MRIBuilder.Scanners.Default_Scanner"><code>Default_Scanner</code></a> will be used.</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>variables.TE</code></a>/<a href="#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>: echo time between excitation pulse and spin echo in ms (required).</li><li><a href="#MRIBuilder.Variables.variables.delay"><code>variables.delay</code></a>: 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.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/spin_echoes.jl#L11-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.echo_time" href="#MRIBuilder.Variables.variables.echo_time"><code>MRIBuilder.Variables.variables.echo_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Returns the echo time of a sequence in ms.</p><p>This is typically defined as the time between the excitation pulse and the crossing of k=0 during the MRI readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/spin_echoes.jl#L56-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}" href="#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">DiffusionSpinEcho(; echo_time, delay=0., excitation=(), gradient=(), refocus=(), readout=(), optim=(), resolution/fov/voxel_size/slice_thickness, scanner)</code></pre><p>Defines a diffusion-weighted spin echo (Stejskal-Tanner) sequence.</p><p><code>DWI</code>, <code>DW_SE</code>, and <code>DiffusionSpinEcho</code> are all synonyms.</p><p>By default, an instant excitation pulse and readout event are used. If image parameters are provided, this will switch to a sinc pulse and EPI readout.</p><p><strong>Parameters</strong></p><ul><li><code>excitation</code>: properties of the excitation pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.excitation_pulse-Tuple{}"><code>excitation_pulse</code></a>.</li><li><code>gradient</code>: properties of the diffusion-weighting gradients as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.dwi_gradients-Tuple{}"><code>dwi_gradients</code></a>.</li><li><code>refocus</code>: properties of the refocus pulse as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.refocus_pulse-Tuple{}"><code>refocus_pulse</code></a>.</li><li><code>readout</code>: properties of the readout as described in <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.readout_event-Tuple{}"><code>readout_event</code></a>.</li><li>Image parameters (<a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>/<a href="../api/#MRIBuilder.Variables.variables.fov"><code>variables.fov</code></a>/<a href="../api/#MRIBuilder.Variables.variables.voxel_size"><code>variables.voxel_size</code></a>/<a href="../api/#MRIBuilder.Variables.variables.slice_thickness"><code>variables.slice_thickness</code></a>): describe the properties of the resulting image. See <a href="../defining_sequence/#MRIBuilder.Parts.HelperFunctions.interpret_image_size-NTuple{4, Any}"><code>interpret_image_size</code></a> for details.</li><li><code>optim</code>: parameters to pass on to the Ipopt optimiser (see https://coin-or.github.io/Ipopt/OPTIONS.html).</li><li><code>scanner</code>: Sets the <a href="../scanners/#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> used to constraint the gradient parameters. If not set, the <a href="../scanners/#MRIBuilder.Scanners.Default_Scanner"><code>Default_Scanner</code></a> will be used.</li></ul><p><strong>Variables</strong></p><ul><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>variables.TE</code></a>/<a href="#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>: echo time between excitation pulse and spin echo in ms.</li><li><a href="#MRIBuilder.Variables.variables.delay"><code>variables.delay</code></a>: 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.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>: total duration of the sequence from start of excitation pulse to end of readout or spoiler in ms.</li><li><a href="../sequence_optimisation/#MRIBuilder.Variables.variables.Δ-sequence_optimisation"><code>variables.Δ</code></a>/<a href="#MRIBuilder.Variables.variables.diffusion_time"><code>variables.diffusion_time</code></a>: Time from the start of one diffusion-weighted gradient till the other in ms.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/diffusion_spin_echoes.jl#L15-L39">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.delay" href="#MRIBuilder.Variables.variables.delay"><code>MRIBuilder.Variables.variables.delay</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">delay(sequence)</code></pre><p>Returns the offset beetween the readout and the spin echo in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/diffusion_spin_echoes.jl#L91-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.diffusion_time" href="#MRIBuilder.Variables.variables.diffusion_time"><code>MRIBuilder.Variables.variables.diffusion_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">diffusion_time(diffusion_sequence)</code></pre><p>Returns the diffusion time of a <a href="#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a> in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/diffusion_spin_echoes.jl#L84-L88">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sequence_optimisation/">« Optimisation</a><a class="docs-footer-nextpage" href="../defining_sequence/">Defining sequences »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:04">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> diff --git a/dev/index.html b/dev/index.html index 41e07d868b4090c8f90b9b47c7da08b0005a04a3..03989f1286b96c169881d40020abc39ad0f0d1b3 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · MRIBuilder.jl</title><meta name="title" content="Home · MRIBuilder.jl"/><meta property="og:title" content="Home · MRIBuilder.jl"/><meta property="twitter:title" content="Home · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/"/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li></ul></li><li><a class="tocitem" href="sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="adjust_sequences/">Post-hoc adjustments</a></li><li><a class="tocitem" href="scanners/">Scanners</a></li><li><a class="tocitem" href="api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/index.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="MRIBuilder"><a class="docs-heading-anchor" href="#MRIBuilder">MRIBuilder</a><a id="MRIBuilder-1"></a><a class="docs-heading-anchor-permalink" href="#MRIBuilder" title="Permalink"></a></h1><p><a href="https://git.fmrib.ox.ac.uk/ndcn0236/mribuilder.jl">MRIBuilder</a> allows for the creation and optimisation of MRI sequences within <a href="https://julialang.org">Julia</a>.</p><p>Depending on your application, there are several levels at which you can interact with MRIBuilder. The ones lower down require more expertise with Julia and the internals of MRIBuilder:</p><ol><li>Many sequences have already been implemented and can be obtained through a simple function call (see <a href="implemented_sequences/#implemented_sequences">Using implemented sequences</a>).</li><li>New sequences can be created out of pre-defined sequence components and by defining sequence-specific metrics (see <a href="defining_sequence/#defining_sequences">Defining new sequences</a>).</li><li>Finally, one can actually define new sequence components (not documented yet).</li></ol><p>Typically, the resulting sequence will only cover a single repetition time (TR). MRIBuilder enables the concatenation of single-TR sequences into a multi-TR sequence. During these repeats minor adjustments can be made to the single-TR sequence. This can be used to allow different repeats to image different lines in k-space or excite different slices (see <a href="adjust_sequences/#adjust_sequences">Post-hoc adjustment of sequences</a>).</p><p>The signal formation for the resulting sequence can be predicted using <a href="https://open.win.ox.ac.uk/pages/ndcn0236/mcmrsimulator.jl/stable">MCMRSimulator</a> given some representation of the imaged tissue. MRIBuilder can be used to read/write to the <a href="https://pulseq.github.io">pulseq</a> MR sequence file format. This can be used to run the sequence on MRI scanners as described in the <a href="https://pulseq.github.io">pulseq homepage</a>. Rather than just directly running the sequences from this library on the scanner, we strongly recommend to load it using the <a href="https://github.com/pulseq/pulseq">MATLAB pulseq</a> or <a href="https://github.com/imr-framework/pypulseq">python pypulseq</a> first as these libraries run additional checks!</p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>It can be run from the command line using the Julia REPL, from a Julia script, or in a <a href="https://jupyter.org">Jupyter notebook</a>. Like any Julia package, Julia can be installed using the built-in <a href="https://pkgdocs.julialang.org/v1/">Julia package manager</a>:</p><pre><code class="nohighlight hljs">pkg> add https://git.fmrib.ox.ac.uk/ndcn0236/mribuilder.jl.git</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="sequence_optimisation/">Optimisation »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · MRIBuilder.jl</title><meta name="title" content="Home · MRIBuilder.jl"/><meta property="og:title" content="Home · MRIBuilder.jl"/><meta property="twitter:title" content="Home · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/"/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li></ul></li><li><a class="tocitem" href="sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="adjust_sequences/">Post-hoc adjustments</a></li><li><a class="tocitem" href="scanners/">Scanners</a></li><li><a class="tocitem" href="api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/index.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="MRIBuilder"><a class="docs-heading-anchor" href="#MRIBuilder">MRIBuilder</a><a id="MRIBuilder-1"></a><a class="docs-heading-anchor-permalink" href="#MRIBuilder" title="Permalink"></a></h1><p><a href="https://git.fmrib.ox.ac.uk/ndcn0236/mribuilder.jl">MRIBuilder</a> allows for the creation and optimisation of MRI sequences within <a href="https://julialang.org">Julia</a>.</p><p>Depending on your application, there are several levels at which you can interact with MRIBuilder. The ones lower down require more expertise with Julia and the internals of MRIBuilder:</p><ol><li>Many sequences have already been implemented and can be obtained through a simple function call (see <a href="implemented_sequences/#implemented_sequences">Using implemented sequences</a>).</li><li>New sequences can be created out of pre-defined sequence components and by defining sequence-specific metrics (see <a href="defining_sequence/#defining_sequences">Defining new sequences</a>).</li><li>Finally, one can actually define new sequence components (not documented yet).</li></ol><p>Typically, the resulting sequence will only cover a single repetition time (TR). MRIBuilder enables the concatenation of single-TR sequences into a multi-TR sequence. During these repeats minor adjustments can be made to the single-TR sequence. This can be used to allow different repeats to image different lines in k-space or excite different slices (see <a href="adjust_sequences/#adjust_sequences">Post-hoc adjustment of sequences</a>).</p><p>The signal formation for the resulting sequence can be predicted using <a href="https://open.win.ox.ac.uk/pages/ndcn0236/mcmrsimulator.jl/stable">MCMRSimulator</a> given some representation of the imaged tissue. MRIBuilder can be used to read/write to the <a href="https://pulseq.github.io">pulseq</a> MR sequence file format. This can be used to run the sequence on MRI scanners as described in the <a href="https://pulseq.github.io">pulseq homepage</a>. Rather than just directly running the sequences from this library on the scanner, we strongly recommend to load it using the <a href="https://github.com/pulseq/pulseq">MATLAB pulseq</a> or <a href="https://github.com/imr-framework/pypulseq">python pypulseq</a> first as these libraries run additional checks!</p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>It can be run from the command line using the Julia REPL, from a Julia script, or in a <a href="https://jupyter.org">Jupyter notebook</a>. Like any Julia package, Julia can be installed using the built-in <a href="https://pkgdocs.julialang.org/v1/">Julia package manager</a>:</p><pre><code class="nohighlight hljs">pkg> add https://git.fmrib.ox.ac.uk/ndcn0236/mribuilder.jl.git</code></pre></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="sequence_optimisation/">Optimisation »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:04">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> diff --git a/dev/objects.inv b/dev/objects.inv index c7cc8fcab9237048505028a4579ccec814ae50b9..cb6f67421d7f1fcc154e5e65d745a9a21c01ea0c 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/scanners/index.html b/dev/scanners/index.html index 76badecb8de2605de57ded957c4e2dee843ece55..74eda5f67d07fa327eac5e75c0349b5c1a4d5fb1 100644 --- a/dev/scanners/index.html +++ b/dev/scanners/index.html @@ -1,3 +1,3 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Scanners · MRIBuilder.jl</title><meta name="title" content="Scanners · MRIBuilder.jl"/><meta property="og:title" content="Scanners · MRIBuilder.jl"/><meta property="twitter:title" content="Scanners · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/scanners/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/scanners/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/scanners/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="../adjust_sequences/">Post-hoc adjustments</a></li><li class="is-active"><a class="tocitem" href>Scanners</a><ul class="internal"><li><a class="tocitem" href="#Scanners-API"><span>Scanners API</span></a></li></ul></li><li><a class="tocitem" href="../api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Scanners</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Scanners</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/scanners.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="scanners"><a class="docs-heading-anchor" href="#scanners">Scanners</a><a id="scanners-1"></a><a class="docs-heading-anchor-permalink" href="#scanners" title="Permalink"></a></h1><p>The MRI scanner that is used during acquisition puts various constraints on the MR sequences that can be used. These constraints include safety considerations, such as tissue heating, and hardware constraints, such as maximum gradient strength and slew rate. Currently, MRIBuilder only considers the latter.</p><p>To define a sequence appropriate for a specific scanner, a user would define a new <a href="#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> with the appropriate <a href="#MRIBuilder.Scanners.B0-Tuple{Scanner}"><code>B0</code></a>, maximum <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>, and maximum <a href="../api/#MRIBuilder.Variables.variables.slew_rate"><code>variables.slew_rate</code></a>. This scanner would then be passed on to the <a href="../sequence_optimisation/#sequence_optimisation">sequence optimisation</a>.</p><p>For ease of use, the <code>gradient_strength</code> and <code>slew_rate</code> of many scanners have already been pre-defined. These are listed below.</p><h2 id="Scanners-API"><a class="docs-heading-anchor" href="#Scanners-API">Scanners API</a><a id="Scanners-API-1"></a><a class="docs-heading-anchor-permalink" href="#Scanners-API" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners" href="#MRIBuilder.Scanners"><code>MRIBuilder.Scanners</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define general <a href="#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> type and methods as well as some concrete scanners.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Default_Scanner" href="#MRIBuilder.Scanners.Default_Scanner"><code>MRIBuilder.Scanners.Default_Scanner</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>A default 1.5T scanner.</p><p>Matches the one used in <code>pulseq</code> (https://github.com/pulseq/pulseq/blob/master/matlab/%2Bmr/opts.m).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Connectom" href="#MRIBuilder.Scanners.Siemens_Connectom"><code>MRIBuilder.Scanners.Siemens_Connectom</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens 3T Connectom MRI scanner (<a href="@cite">fan22_MappingHumanConnectome</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L83-L85">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Connectom_v2" href="#MRIBuilder.Scanners.Siemens_Connectom_v2"><code>MRIBuilder.Scanners.Siemens_Connectom_v2</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens 3T Connectom 2.0 MRI scanner (<a href="@cite">huang21_ConnectomeDevelopingnextgeneration</a>)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L88-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Prisma" href="#MRIBuilder.Scanners.Siemens_Prisma"><code>MRIBuilder.Scanners.Siemens_Prisma</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens MAGNETOM 3T Prisma MRI scanner (https://www.siemens-healthineers.com/en-uk/magnetic-resonance-imaging/3t-mri-scanner/magnetom-prisma).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L73-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Terra" href="#MRIBuilder.Scanners.Siemens_Terra"><code>MRIBuilder.Scanners.Siemens_Terra</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens MAGNETOM 7T Terra MRI scanner (https://www.siemens-healthineers.com/en-uk/magnetic-resonance-imaging/7t-mri-scanner/magnetom-terra)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L78-L80">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Scanner" href="#MRIBuilder.Scanners.Scanner"><code>MRIBuilder.Scanners.Scanner</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Scanner(;B0=3., gradient=Inf, slew_rate=Inf, units=:kHz)</code></pre><p>Properties of an MRI scanner relevant for the MR signal simulations.</p><ul><li><a href="#MRIBuilder.Scanners.B0-Tuple{Scanner}"><code>B0</code></a>: magnetic field strength (in Tesla)</li><li><a href="#MRIBuilder.Scanners.gradient_strength"><code>gradient_strength</code></a>: maximum gradient strength long each axis.</li><li><a href="#MRIBuilder.Scanners.slew_rate"><code>slew_rate</code></a>: maximum rate of change in the gradient strength</li></ul><p>By default <code>gradient</code> and <code>slew_rate</code> are expected to be provided in units of, respectively, kHz/um and kHz/um/ms. However, if the keyword <code>units=:Tesla</code> is set, the <code>gradient</code> and <code>slew_rate</code> should be provided in units of, respectively, mT/m and T/m/s.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L8-L18">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.B0-Tuple{Scanner}" href="#MRIBuilder.Scanners.B0-Tuple{Scanner}"><code>MRIBuilder.Scanners.B0</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">B0(scanner) -B0(sequence)</code></pre><p>Returns the magnetic field strength of the scanner in Tesla.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L41-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.gradient_strength" href="#MRIBuilder.Scanners.gradient_strength"><code>MRIBuilder.Scanners.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(scanner[, units])</code></pre><p>Returns the maximum magnetic field gradient of the scanner in kHz/um. By setting <code>units</code> to :Tesla, the gradient strength can be returned in mT/m instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L49-L54">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.slew_rate" href="#MRIBuilder.Scanners.slew_rate"><code>MRIBuilder.Scanners.slew_rate</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate(scanner[, units])</code></pre><p>Returns the maximum magnetic field slew rate of the scanner in kHz/um/ms. By setting <code>units</code> to :Tesla, the slew rate can be returned in T/m/s instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/scanners.jl#L57-L62">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../adjust_sequences/">« Post-hoc adjustments</a><a class="docs-footer-nextpage" href="../api/">Internal API »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Scanners · MRIBuilder.jl</title><meta name="title" content="Scanners · MRIBuilder.jl"/><meta property="og:title" content="Scanners · MRIBuilder.jl"/><meta property="twitter:title" content="Scanners · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/scanners/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/scanners/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/scanners/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li><a class="tocitem" href="../sequence_optimisation/">Optimisation</a></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="../adjust_sequences/">Post-hoc adjustments</a></li><li class="is-active"><a class="tocitem" href>Scanners</a><ul class="internal"><li><a class="tocitem" href="#Scanners-API"><span>Scanners API</span></a></li></ul></li><li><a class="tocitem" href="../api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Scanners</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Scanners</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/scanners.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="scanners"><a class="docs-heading-anchor" href="#scanners">Scanners</a><a id="scanners-1"></a><a class="docs-heading-anchor-permalink" href="#scanners" title="Permalink"></a></h1><p>The MRI scanner that is used during acquisition puts various constraints on the MR sequences that can be used. These constraints include safety considerations, such as tissue heating, and hardware constraints, such as maximum gradient strength and slew rate. Currently, MRIBuilder only considers the latter.</p><p>To define a sequence appropriate for a specific scanner, a user would define a new <a href="#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> with the appropriate <a href="#MRIBuilder.Scanners.B0-Tuple{Scanner}"><code>B0</code></a>, maximum <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>, and maximum <a href="../api/#MRIBuilder.Variables.variables.slew_rate"><code>variables.slew_rate</code></a>. This scanner would then be passed on to the <a href="../sequence_optimisation/#sequence_optimisation">sequence optimisation</a>.</p><p>For ease of use, the <code>gradient_strength</code> and <code>slew_rate</code> of many scanners have already been pre-defined. These are listed below.</p><h2 id="Scanners-API"><a class="docs-heading-anchor" href="#Scanners-API">Scanners API</a><a id="Scanners-API-1"></a><a class="docs-heading-anchor-permalink" href="#Scanners-API" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners" href="#MRIBuilder.Scanners"><code>MRIBuilder.Scanners</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Define general <a href="#MRIBuilder.Scanners.Scanner"><code>Scanner</code></a> type and methods as well as some concrete scanners.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L1-L3">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Default_Scanner" href="#MRIBuilder.Scanners.Default_Scanner"><code>MRIBuilder.Scanners.Default_Scanner</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>A default 1.5T scanner.</p><p>Matches the one used in <code>pulseq</code> (https://github.com/pulseq/pulseq/blob/master/matlab/%2Bmr/opts.m).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Connectom" href="#MRIBuilder.Scanners.Siemens_Connectom"><code>MRIBuilder.Scanners.Siemens_Connectom</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens 3T Connectom MRI scanner (<a href="@cite">fan22_MappingHumanConnectome</a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L83-L85">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Connectom_v2" href="#MRIBuilder.Scanners.Siemens_Connectom_v2"><code>MRIBuilder.Scanners.Siemens_Connectom_v2</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens 3T Connectom 2.0 MRI scanner (<a href="@cite">huang21_ConnectomeDevelopingnextgeneration</a>)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L88-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Prisma" href="#MRIBuilder.Scanners.Siemens_Prisma"><code>MRIBuilder.Scanners.Siemens_Prisma</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens MAGNETOM 3T Prisma MRI scanner (https://www.siemens-healthineers.com/en-uk/magnetic-resonance-imaging/3t-mri-scanner/magnetom-prisma).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L73-L75">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Siemens_Terra" href="#MRIBuilder.Scanners.Siemens_Terra"><code>MRIBuilder.Scanners.Siemens_Terra</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Siemens MAGNETOM 7T Terra MRI scanner (https://www.siemens-healthineers.com/en-uk/magnetic-resonance-imaging/7t-mri-scanner/magnetom-terra)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L78-L80">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.Scanner" href="#MRIBuilder.Scanners.Scanner"><code>MRIBuilder.Scanners.Scanner</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">Scanner(;B0=3., gradient=Inf, slew_rate=Inf, units=:kHz)</code></pre><p>Properties of an MRI scanner relevant for the MR signal simulations.</p><ul><li><a href="#MRIBuilder.Scanners.B0-Tuple{Scanner}"><code>B0</code></a>: magnetic field strength (in Tesla)</li><li><a href="#MRIBuilder.Scanners.gradient_strength"><code>gradient_strength</code></a>: maximum gradient strength long each axis.</li><li><a href="#MRIBuilder.Scanners.slew_rate"><code>slew_rate</code></a>: maximum rate of change in the gradient strength</li></ul><p>By default <code>gradient</code> and <code>slew_rate</code> are expected to be provided in units of, respectively, kHz/um and kHz/um/ms. However, if the keyword <code>units=:Tesla</code> is set, the <code>gradient</code> and <code>slew_rate</code> should be provided in units of, respectively, mT/m and T/m/s.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L8-L18">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.B0-Tuple{Scanner}" href="#MRIBuilder.Scanners.B0-Tuple{Scanner}"><code>MRIBuilder.Scanners.B0</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">B0(scanner) +B0(sequence)</code></pre><p>Returns the magnetic field strength of the scanner in Tesla.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L41-L46">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.gradient_strength" href="#MRIBuilder.Scanners.gradient_strength"><code>MRIBuilder.Scanners.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(scanner[, units])</code></pre><p>Returns the maximum magnetic field gradient of the scanner in kHz/um. By setting <code>units</code> to :Tesla, the gradient strength can be returned in mT/m instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L49-L54">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Scanners.slew_rate" href="#MRIBuilder.Scanners.slew_rate"><code>MRIBuilder.Scanners.slew_rate</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate(scanner[, units])</code></pre><p>Returns the maximum magnetic field slew rate of the scanner in kHz/um/ms. By setting <code>units</code> to :Tesla, the slew rate can be returned in T/m/s instead.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/scanners.jl#L57-L62">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../adjust_sequences/">« Post-hoc adjustments</a><a class="docs-footer-nextpage" href="../api/">Internal API »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:04">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> diff --git a/dev/sequence_optimisation/index.html b/dev/sequence_optimisation/index.html index f46a64a8b3ba23e1450bdabfd7a3ca4c6c548a8d..38d5e3e47467aedba52e3a07bc6f15f593f10f66 100644 --- a/dev/sequence_optimisation/index.html +++ b/dev/sequence_optimisation/index.html @@ -1,9 +1,9 @@ <!DOCTYPE html> -<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Optimisation · MRIBuilder.jl</title><meta name="title" content="Optimisation · MRIBuilder.jl"/><meta property="og:title" content="Optimisation · MRIBuilder.jl"/><meta property="twitter:title" content="Optimisation · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/sequence_optimisation/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/sequence_optimisation/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/sequence_optimisation/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>Optimisation</a><ul class="internal"><li><a class="tocitem" href="#variables"><span>Summary variables</span></a></li><li><a class="tocitem" href="#Variables-interface"><span>Variables interface</span></a></li></ul></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="../adjust_sequences/">Post-hoc adjustments</a></li><li><a class="tocitem" href="../scanners/">Scanners</a></li><li><a class="tocitem" href="../api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Optimisation</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Optimisation</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/sequence_optimisation.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="sequence_optimisation"><a class="docs-heading-anchor" href="#sequence_optimisation">Sequence optimisation</a><a id="sequence_optimisation-1"></a><a class="docs-heading-anchor-permalink" href="#sequence_optimisation" title="Permalink"></a></h1><p>In MRIBuilder an MR <a href="../api/#MRIBuilder.Containers.BaseSequences.Sequence"><code>Sequence</code></a> is defined as a sequence of <a href="../api/#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a> objects. Most <code>BuildingBlock</code> objects will contain free parameters determining, for example, the duration of the block or the strength/orientation of the MR gradient. In most MR sequence building software, the user will have to set all of these free parameters by computing the appropriate values given a desired echo time, b-value, etc.</p><p>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 <code>BuildingBlock</code> free parameters, such as <a href="../implemented_sequences/#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>, <a href="#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>, <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>, <a href="../implemented_sequences/#MRIBuilder.Variables.variables.diffusion_time"><code>variables.diffusion_time</code></a>, <a href="../defining_sequence/#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a> 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 <code>:min</code>/<code>:max</code> to minimise/maximise them). In addition to the user-defined constraints, this optimisation will also take into account any <a href="../scanners/#scanners">scanner-defined constraints</a>. Internally, MRIBuilder will then optimise the <code>BuildingBlock</code> free parameters to match any user-defined constraints and/or objectives. This optimisation uses the <a href="https://github.com/coin-or/Ipopt">Ipopt</a> optimiser accessed through the <a href="https://jump.dev/JuMP.jl/stable/">JuMP.jl</a> library.</p><p>In addition to any user-defined objectives, the developer might also have defined secondary objectives (e.g., minimise the total sequence duration). These objective functions will only be considered if they do not affect the result of the user-defined primary objective. More details on these developer-defined secondary objectives can be found in the section on <a href="../defining_sequence/#defining_sequences">defining new sequences</a></p><h2 id="variables"><a class="docs-heading-anchor" href="#variables">Summary variables</a><a id="variables-1"></a><a class="docs-heading-anchor-permalink" href="#variables" title="Permalink"></a></h2><p>All variables are available as members of the <a href="#variables"><code>variables</code></a> structure.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables" href="#MRIBuilder.Variables.variables"><code>MRIBuilder.Variables.variables</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Main module containing all the MRIBuilder sequence variables.</p><p>All variables are available as members of this module, e.g. <code>variables.echo_time</code> returns the echo time variable. New variables can be defined using <code>@defvar</code>.</p><p>Set constraints on variables by passing them on as keywords during the sequence generation, e.g., <code>seq=SpinEcho(echo_time=70)</code>.</p><p>After sequence generation you can get the variable values by calling <code>variables.echo_time(seq)</code>. For the sequence defined above this would return 70. (or a number very close to that).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L127-L140">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_left-sequence_optimisation" href="#MRIBuilder.Variables.variables.N_left-sequence_optimisation"><code>MRIBuilder.Variables.variables.N_left</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> before the maximum.</p><p>Also, see <a href="../api/#MRIBuilder.Variables.variables.N_right"><code>variables.N_right</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L89-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_right-sequence_optimisation" href="#MRIBuilder.Variables.variables.N_right-sequence_optimisation"><code>MRIBuilder.Variables.variables.N_right</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> after the maximum.</p><p>Also, see <a href="../api/#MRIBuilder.Variables.variables.N_left"><code>variables.N_left</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L98-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.TE-sequence_optimisation" href="#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>MRIBuilder.Variables.variables.TE</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Returns the echo time of a sequence in ms.</p><p>This is typically defined as the time between the excitation pulse and the crossing of k=0 during the MRI readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/spin_echoes.jl#L56-L62">source</a></section><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Computes the echo time(s) of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L513-L517">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.TR-sequence_optimisation" href="#MRIBuilder.Variables.variables.TR-sequence_optimisation"><code>MRIBuilder.Variables.variables.TR</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">repetition_time(sequence)</code></pre><p>Computes the repetition_times of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L520-L524">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.all_gradient_strengths-sequence_optimisation" href="#MRIBuilder.Variables.variables.all_gradient_strengths-sequence_optimisation"><code>MRIBuilder.Variables.variables.all_gradient_strengths</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">all_gradient_strengths(spoilt_slice_select)</code></pre><p>Returns the gradient strength before, during, and after the pulse in <a href="../api/#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>SpoiltSliceSelect</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/spoilt_slice_selects.jl#L127-L131">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.amplitude-sequence_optimisation" href="#MRIBuilder.Variables.variables.amplitude-sequence_optimisation"><code>MRIBuilder.Variables.variables.amplitude</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">amplitude(pulse)</code></pre><p>Return the amplitude of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L65-L69">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.area_under_curve-sequence_optimisation" href="#MRIBuilder.Variables.variables.area_under_curve-sequence_optimisation"><code>MRIBuilder.Variables.variables.area_under_curve</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">area_under_curve(pathway::Pathway)</code></pre><p>Return net displacement in k-space (i.e., spoiling) experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a>.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>area_under_curve</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L131-L139">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bandwidth-sequence_optimisation" href="#MRIBuilder.Variables.variables.bandwidth-sequence_optimisation"><code>MRIBuilder.Variables.variables.bandwidth</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bandwidth(pulse)</code></pre><p>Return the bandwidth of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L86-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat-sequence_optimisation" href="#MRIBuilder.Variables.variables.bmat-sequence_optimisation"><code>MRIBuilder.Variables.variables.bmat</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat(pathway::Pathway)</code></pre><p>Return 3x3 diffusion-weighted matrix experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>bmat</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L144-L152">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat_gradient-sequence_optimisation" href="#MRIBuilder.Variables.variables.bmat_gradient-sequence_optimisation"><code>MRIBuilder.Variables.variables.bmat_gradient</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat_gradient(overlapping, qstart[, first_event, last_event])</code></pre><p>Computes the addition to the <a href="../defining_sequence/#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a> contributed by a specific building block or gradient.</p><p><code>qstart</code> represents the <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> at the start of this component.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L243-L252">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bval-sequence_optimisation" href="#MRIBuilder.Variables.variables.bval-sequence_optimisation"><code>MRIBuilder.Variables.variables.bval</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bval(pathway::Pathway)</code></pre><p>Return size of diffusion-weighting experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane will contribute to the diffusion weighting.</p><p>Returns a NamedTuple with the <code>bval</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L156-L164">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.delay-sequence_optimisation" href="#MRIBuilder.Variables.variables.delay-sequence_optimisation"><code>MRIBuilder.Variables.variables.delay</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">delay(sequence)</code></pre><p>Returns the offset beetween the readout and the spin echo in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/diffusion_spin_echoes.jl#L91-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.diffusion_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.diffusion_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.diffusion_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">diffusion_time(diffusion_sequence)</code></pre><p>Returns the diffusion time of a <a href="../implemented_sequences/#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a> in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/diffusion_spin_echoes.jl#L84-L88">source</a></section><section><div><pre><code class="language-julia hljs">diffusion_time(sequence)</code></pre><p>Computes the diffusion time of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L527-L531">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration(block)</code></pre><p>Duration of the sequence or building block in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L377-L381">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_dephase-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration_dephase-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration_dephase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_dephase(pathway::Pathway)</code></pre><p>Returns the net time that spins following the given <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the +transverse versus the -transverse state. This determines the amount of T2'-weighting as <span>$e^{t/T_2'}$</span>, where <span>$t$</span> is the <code>duration_dephase</code>.</p><p>Also see <a href="../defining_sequence/#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a> for T2-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L106-L113">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_state-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration_state-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration_state</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_state(pathway::Pathway, transverse::Bool, positive::Bool)</code></pre><p>Returns how long the <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in a specific state.</p><p>The requested state can be set using <code>transverse</code> and <code>positive</code> as follows:</p><ul><li><code>transverse=false</code>, <code>positive=true</code>: +longitudinal</li><li><code>transverse=true</code>, <code>positive=true</code>: +transverse</li><li><code>transverse=false</code>, <code>positive=false</code>: -longitudinal</li><li><code>transverse=true</code>, <code>positive=false</code>: -transverse</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L77-L87">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_transverse-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration_transverse-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration_transverse</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_transverse(pathway::Pathway)</code></pre><p>Returns the total amount of time that spins following the given <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the transverse plane. This determines the amount of T2-weighting as <span>$e^{t/T_2}$</span>, where <span>$t$</span> is the <code>duration_transverse</code>.</p><p>Also see <a href="../defining_sequence/#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a> for T2'-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L93-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.dwell_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.dwell_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.dwell_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">dwell_time(adc)</code></pre><p>The dwell time of the ADC readout in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.echo_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.echo_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.echo_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Returns the echo time of a sequence in ms.</p><p>This is typically defined as the time between the excitation pulse and the crossing of k=0 during the MRI readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/spin_echoes.jl#L56-L62">source</a></section><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Computes the echo time(s) of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L513-L517">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.effective_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.effective_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.effective_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">effective_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="../api/#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>This will crash if the component does not have an <a href="../api/#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a> (e.g., if it is (part of) a gradient waveform).</p><p>Also see <a href="#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="../api/#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>start_time</code></a>, and <a href="../api/#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>end_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L41-L49">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flat_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.flat_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.flat_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flat_time(trapezoid)</code></pre><p>Returns the flat time of a <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L124-L128">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flip_angle-sequence_optimisation" href="#MRIBuilder.Variables.variables.flip_angle-sequence_optimisation"><code>MRIBuilder.Variables.variables.flip_angle</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flip_angle(pulse)</code></pre><p>Return the flip angle of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.fov-sequence_optimisation" href="#MRIBuilder.Variables.variables.fov-sequence_optimisation"><code>MRIBuilder.Variables.variables.fov</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fov(readout)</code></pre><p>Defines the field of view of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L288-L292">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.frequency-sequence_optimisation" href="#MRIBuilder.Variables.variables.frequency-sequence_optimisation"><code>MRIBuilder.Variables.variables.frequency</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">frequency(pulse)</code></pre><p>Return the off-resonance frequency of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L72-L76">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.gradient_strength-sequence_optimisation" href="#MRIBuilder.Variables.variables.gradient_strength-sequence_optimisation"><code>MRIBuilder.Variables.variables.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(gradient)</code></pre><p>Maximum 3D gradient strength of the gradient in kHz/um.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L32-L36">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation" href="#MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation"><code>MRIBuilder.Variables.variables.gradient_strength_norm</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength_norm(gradient)</code></pre><p>The norm of the <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L479-L483">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.lobe_duration-sequence_optimisation" href="#MRIBuilder.Variables.variables.lobe_duration-sequence_optimisation"><code>MRIBuilder.Variables.variables.lobe_duration</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">lobe_duration(sinc_pulse)</code></pre><p>Time between two zero-crossings of a <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/pulses/sinc_pulses.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.net_dephasing-sequence_optimisation" href="#MRIBuilder.Variables.variables.net_dephasing-sequence_optimisation"><code>MRIBuilder.Variables.variables.net_dephasing</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">net_dephasing(pathway::Pathway)</code></pre><p>Return net displacement vector in k-space/q-space experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in kHz/um.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>qvec</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/pathways.jl#L118-L126">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.nsamples-sequence_optimisation" href="#MRIBuilder.Variables.variables.nsamples-sequence_optimisation"><code>MRIBuilder.Variables.variables.nsamples</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nsamples(adc)</code></pre><p>Number of samples in an ADC.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L89-L93">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.oversample-sequence_optimisation" href="#MRIBuilder.Variables.variables.oversample-sequence_optimisation"><code>MRIBuilder.Variables.variables.oversample</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">oversample(adc)</code></pre><p>The oversampling rate of the ADC readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L59-L63">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.phase-sequence_optimisation" href="#MRIBuilder.Variables.variables.phase-sequence_optimisation"><code>MRIBuilder.Variables.variables.phase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">phase(pulse)</code></pre><p>Return the phase of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L58-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.qval-sequence_optimisation" href="#MRIBuilder.Variables.variables.qval-sequence_optimisation"><code>MRIBuilder.Variables.variables.qval</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">qval(gradient)</code></pre><p>The norm of the <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L427-L431">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.qvec-sequence_optimisation" href="#MRIBuilder.Variables.variables.qvec-sequence_optimisation"><code>MRIBuilder.Variables.variables.qvec</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">qvec(overlapping[, first_event, last_event])</code></pre><p>Computes the area under the curve for the gradient waveform in <a href="../api/#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a>.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/building_blocks.jl#L233-L240">source</a></section><section><div><pre><code class="language-julia hljs">qvec(gradient)</code></pre><p>The total integral of the area under the gradient curve as a length-3 vector.</p><p>The norm of this vector is available as <a href="#MRIBuilder.Variables.variables.qval-sequence_optimisation"><code>qval</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L452-L458">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.ramp_overlap-sequence_optimisation" href="#MRIBuilder.Variables.variables.ramp_overlap-sequence_optimisation"><code>MRIBuilder.Variables.variables.ramp_overlap</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ramp_overlap(line_readout)</code></pre><p>Return the fraction of the gradient ramp that overlaps with the ADC readout.</p><p>Set to 0 to ensure that the ADC is only active during the flat time of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L302-L308">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.readout_times-sequence_optimisation" href="#MRIBuilder.Variables.variables.readout_times-sequence_optimisation"><code>MRIBuilder.Variables.variables.readout_times</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">readout_times(sequence)</code></pre><p>Returns all the times that the sequence will readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/containers/abstract.jl#L146-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.resolution-sequence_optimisation" href="#MRIBuilder.Variables.variables.resolution-sequence_optimisation"><code>MRIBuilder.Variables.variables.resolution</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">resolution(readout)</code></pre><p>Resolution of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L80-L84">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.rise_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.rise_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.rise_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">rise_time(trapezoid)</code></pre><p>Returns the rise time of a <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L117-L121">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slew_rate-sequence_optimisation" href="#MRIBuilder.Variables.variables.slew_rate-sequence_optimisation"><code>MRIBuilder.Variables.variables.slew_rate</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate(gradient)</code></pre><p>Maximum 3D slew rate of the gradient in kHz/um/ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/abstract_types.jl#L25-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slew_rate_norm-sequence_optimisation" href="#MRIBuilder.Variables.variables.slew_rate_norm-sequence_optimisation"><code>MRIBuilder.Variables.variables.slew_rate_norm</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate_norm(gradient)</code></pre><p>The norm of the <a href="../api/#MRIBuilder.Variables.variables.slew_rate"><code>variables.slew_rate</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L486-L490">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slice_thickness-sequence_optimisation" href="#MRIBuilder.Variables.variables.slice_thickness-sequence_optimisation"><code>MRIBuilder.Variables.variables.slice_thickness</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slice_thickness(slice_select)</code></pre><p>Defines the slice thickness for a RF pulse with an active gradient in mm (e.g., <a href="../api/#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a>).</p><p>Defines as <a href="#MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation"><code>variables.gradient_strength_norm</code></a>(gradient) / <a href="../api/#MRIBuilder.Variables.variables.bandwidth"><code>variables.bandwidth</code></a>(pulse)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L213-L219">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.spoiler-sequence_optimisation" href="#MRIBuilder.Variables.variables.spoiler-sequence_optimisation"><code>MRIBuilder.Variables.variables.spoiler</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">spoiler(gradient)</code></pre><p>Spatial scale in mm over which the spoiler gradient will dephase by 2Ï€.</p><p>Automatically computed based on <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L443-L449">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.time_to_center-sequence_optimisation" href="#MRIBuilder.Variables.variables.time_to_center-sequence_optimisation"><code>MRIBuilder.Variables.variables.time_to_center</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">time_to_center(adc)</code></pre><p>The time of the ADC readout to reach the center of k-space.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/components/readouts/ADCs.jl#L73-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.voxel_size-sequence_optimisation" href="#MRIBuilder.Variables.variables.voxel_size-sequence_optimisation"><code>MRIBuilder.Variables.variables.voxel_size</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">voxel_size(readout)</code></pre><p>Defines the voxel size of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L295-L299">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.Δ-sequence_optimisation" href="#MRIBuilder.Variables.variables.Δ-sequence_optimisation"><code>MRIBuilder.Variables.variables.Δ</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">diffusion_time(diffusion_sequence)</code></pre><p>Returns the diffusion time of a <a href="../implemented_sequences/#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a> in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/sequences/diffusion_spin_echoes.jl#L84-L88">source</a></section><section><div><pre><code class="language-julia hljs">diffusion_time(sequence)</code></pre><p>Computes the diffusion time of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L527-L531">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.δ-sequence_optimisation" href="#MRIBuilder.Variables.variables.δ-sequence_optimisation"><code>MRIBuilder.Variables.variables.δ</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">δ(trapezoid)</code></pre><p>Returns the effective duration of a <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p><p>Defined as <a href="../api/#MRIBuilder.Variables.variables.rise_time"><code>variables.rise_time</code></a> + <a href="../api/#MRIBuilder.Variables.variables.flat_time"><code>variables.flat_time</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/parts/trapezoids.jl#L136-L142">source</a></section></article><h2 id="Variables-interface"><a class="docs-heading-anchor" href="#Variables-interface">Variables interface</a><a id="Variables-interface-1"></a><a class="docs-heading-anchor-permalink" href="#Variables-interface" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables" href="#MRIBuilder.Variables"><code>MRIBuilder.Variables</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines the functions that can be called on parts of an MRI sequence to query or constrain any variables.</p><p>In addition this defines:</p><ul><li><a href="#variables"><code>variables</code></a>: module containing all variables.</li><li><a href="#MRIBuilder.Variables.VariableType"><code>VariableType</code></a>: parent type for any variables (whether number or JuMP variable).</li><li><a href="#MRIBuilder.Variables.get_free_variable-Tuple{Number}"><code>get_free_variable</code></a>: helper function to create new JuMP variables.</li><li><a href="#MRIBuilder.Variables.add_cost_function!"><code>add_cost_function!</code></a>: add a specific term to the model cost functions.</li><li><a href="#MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}"><code>set_simple_constraints!</code></a>: call <a href="#MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}"><code>apply_simple_constraint!</code></a> for each keyword argument.</li><li><a href="#MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}"><code>apply_simple_constraint!</code></a>: set a simple equality constraint.</li><li><a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a>/<a href="../api/#MRIBuilder.Variables.get_gradient"><code>get_gradient</code></a>/<a href="#MRIBuilder.Variables.get_readout"><code>get_readout</code></a>: Used to get the pulse/gradient/readout part of a building block</li><li><a href="#MRIBuilder.Variables.gradient_orientation"><code>gradient_orientation</code></a>: returns the gradient orientation of a waveform if fixed.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L1-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.VariableType" href="#MRIBuilder.Variables.VariableType"><code>MRIBuilder.Variables.VariableType</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for any variable in the MRI sequence.</p><p>Each variable can be one of:</p><ul><li>a new JuMP variable</li><li>an expression linking this variable to other JuMP variable</li><li>a number</li></ul><p>Create these using <a href="#MRIBuilder.Variables.get_free_variable-Tuple{Number}"><code>get_free_variable</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L543-L552">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.alternative_variables" href="#MRIBuilder.Variables.alternative_variables"><code>MRIBuilder.Variables.alternative_variables</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Mapping of variable names to alternative ways to compute that variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L151-L153">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.default_generic_method" href="#MRIBuilder.Variables.default_generic_method"><code>MRIBuilder.Variables.default_generic_method</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Contains for each variable the default, generic method.</p><p>This is the method that checks for <a href="@ref"><code>alternative_functions</code></a> or uses one of the getters.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L144-L148">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.getter_functions" href="#MRIBuilder.Variables.getter_functions"><code>MRIBuilder.Variables.getter_functions</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Mapping of symbols to actual getter functions.</p><p>Used in <a href="#MRIBuilder.Variables.set_getter!-Tuple{Symbol, Symbol}"><code>set_getter!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L622-L626">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.getters" href="#MRIBuilder.Variables.getters"><code>MRIBuilder.Variables.getters</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Assigns getters to specific variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L161-L163">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.AbstractBlock" href="#MRIBuilder.Variables.AbstractBlock"><code>MRIBuilder.Variables.AbstractBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type of all components, building block, and sequences that form an MRI sequence.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L21-L23">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.InvalidRoute" href="#MRIBuilder.Variables.InvalidRoute"><code>MRIBuilder.Variables.InvalidRoute</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Raised if there is no way to reach a valid function by the default, generic method (<a href="#MRIBuilder.Variables.default_generic_method"><code>default_generic_method</code></a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L156-L158">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables._get_mult_variable-Tuple{Any, Any, Vararg{Any}}" href="#MRIBuilder.Variables._get_mult_variable-Tuple{Any, Any, Vararg{Any}}"><code>MRIBuilder.Variables._get_mult_variable</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Helper to call the variable for a result of a getter. Used in <a href="#MRIBuilder.Variables._get_variable-Tuple{Symbol, Set{Symbol}, Vararg{Any}}"><code>_get_variable</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L227-L229">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables._get_variable-Tuple{Symbol, Set{Symbol}, Vararg{Any}}" href="#MRIBuilder.Variables._get_variable-Tuple{Symbol, Set{Symbol}, Vararg{Any}}"><code>MRIBuilder.Variables._get_variable</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">_get_variable(name, tried_names, args...; kwargs...)</code></pre><p>Tries to find a route to get values for the variable <code>name</code> with the given <code>args</code> and <code>kwargs</code>.</p><p>The route through <code>tried_names</code> has already been attempted.</p><p>This function returns the route to get to the value and the value itself.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L168-L176">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.add_alternative_variable!-Tuple{Symbol, Symbol, Function, Bool}" href="#MRIBuilder.Variables.add_alternative_variable!-Tuple{Symbol, Symbol, Function, Bool}"><code>MRIBuilder.Variables.add_alternative_variable!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_alternative_variable!(name, other_func, conversion)</code></pre><p>Defines an alternative way to compute the variable with given <code>name</code>.</p><p>If the variable <code>name</code> is not defined and <code>other_name</code> is, then the value of <code>name</code> is computed by applying <code>conversion</code> to the value of <code>other_name</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L411-L418">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.add_cost_function!" href="#MRIBuilder.Variables.add_cost_function!"><code>MRIBuilder.Variables.add_cost_function!</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_cost_function!(function, level=2)</code></pre><p>Adds an additional term to the cost function.</p><p>This term will be minimised together with any other terms in the cost function. Terms added at a lower level will be optimised before any terms with a higher level.</p><p>By default, the term is added to the <code>level=2</code>, which is appropriate for any cost functions added by the developer, which will generally only be optimised after any user-defined cost functions (which are added at <code>level=1</code> by <a href="@ref"><code>add_simple_constraint!</code></a> or <a href="#MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}"><code>set_simple_constraints!</code></a>.</p><p>Any sequence will also have a <code>level=3</code> cost function, which minimises the total sequence duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L642-L654">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.add_new_variable!-Tuple{Symbol}" href="#MRIBuilder.Variables.add_new_variable!-Tuple{Symbol}"><code>MRIBuilder.Variables.add_new_variable!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_new_variable!(name)</code></pre><p>Adds a new variable in <a href="#variables"><code>variables</code></a>.</p><p>This is a helper function, which is called by <code>@defvar</code> for any variable that does not exist yet.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L241-L247">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.adjust_groups-Tuple{MRIBuilder.Variables.AbstractBlock}" href="#MRIBuilder.Variables.adjust_groups-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>MRIBuilder.Variables.adjust_groups</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">adjust_groups(block)</code></pre><p>Returns an array of keywords in <a href="../adjust_sequences/#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a> that should affect a specfic block.</p><p>If any of these keywords are present in <a href="../adjust_sequences/#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a>, then <a href="#MRIBuilder.Variables.adjust_internal"><code>adjust_internal</code></a> will be called.</p><p>Some standard keywords are:</p><ul><li><code>:gradient</code>: expects gradient adjustment parameters</li><li><code>:pulse</code>: expects RF pulse adjustment parameters</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L45-L55">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.adjust_internal" href="#MRIBuilder.Variables.adjust_internal"><code>MRIBuilder.Variables.adjust_internal</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">adjust_internal(block, names_used; kwargs...)</code></pre><p>Returns the adjusted blocks and add any keywords used in the process to <code>names_used</code>.</p><p>This is a helper function used by <a href="../adjust_sequences/#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a>. It should be defined for any block that is adjustable (as defined by <a href="#MRIBuilder.Variables.adjust_groups-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust_groups</code></a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L35-L42">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}" href="#MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}"><code>MRIBuilder.Variables.apply_simple_constraint!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">apply_simple_constraint!(variable, value)</code></pre><p>Add a single constraint or objective to the <code>variable</code>.</p><p><code>value</code> can be one of:</p><ul><li><code>nothing</code>: do nothing</li><li><code>:min</code>: minimise the variable</li><li><code>:max</code>: maximise the variable</li><li><code>number</code>: fix variable to this value</li><li><code>equation</code>: fix variable to the result of this equation</li></ul><pre><code class="nohighlight hljs">apply_simple_constraint!(variable, :>=/:<=, value)</code></pre><p>Set an inequality constraint to the <code>variable</code>.</p><p><code>value</code> can be a number of an equation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L737-L755">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.base_variables-Tuple{}" href="#MRIBuilder.Variables.base_variables-Tuple{}"><code>MRIBuilder.Variables.base_variables</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">base_variables([T])</code></pre><p>Return dictionary with all <a href="@ref"><code>Variable</code></a> objects defined for a specific sequence component/block <code>T</code>.</p><p>This only returns those <a href="@ref"><code>Variable</code></a> directly defined for this component/block, not for any sub-components (through <a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a>, [<code>get_gradient</code>][(@ref), etc.)</p><p>If <code>T</code> is not provided, all <a href="@ref"><code>Variable</code></a> objects are returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L62-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_free_variable-Tuple{Number}" href="#MRIBuilder.Variables.get_free_variable-Tuple{Number}"><code>MRIBuilder.Variables.get_free_variable</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_free_variable(value; integer=false, start=0.01)</code></pre><p>Get a representation of a given <code>variable</code> given a user-defined constraint.</p><p>The result is guaranteed to be a <a href="#MRIBuilder.Variables.VariableType"><code>VariableType</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L556-L562">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_readout" href="#MRIBuilder.Variables.get_readout"><code>MRIBuilder.Variables.get_readout</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_readout(sequence)</code></pre><p>Get the main readout events played out during the sequence.</p><p>This has to be defined for individual sequences to work.</p><p>Any <code>readout</code> variables not explicitly defined for this sequence will be passed on to the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L600-L608">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.gradient_orientation" href="#MRIBuilder.Variables.gradient_orientation"><code>MRIBuilder.Variables.gradient_orientation</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_orientation(building_block)</code></pre><p>Returns the gradient orientation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L634-L638">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.make_generic" href="#MRIBuilder.Variables.make_generic"><code>MRIBuilder.Variables.make_generic</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">make_generic(sequence/building_block/component)</code></pre><p>Returns a generic version of the <code>BaseSequence</code>, <code>BaseBuildingBlock</code>, or <code>BaseComponent</code></p><ul><li>Sequences are all flattened and returned as a single <code>Sequence</code> containing only <code>BuildingBlock</code> objects.</li><li>Any <code>BaseBuildingBlock</code> is converted into a <code>BuildingBlock</code>.</li><li>Pulses are replaced with <code>GenericPulse</code> (except for instant pulses).</li><li>Instant readouts are replaced with <code>ADC</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L789-L798">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.scanner_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock}" href="#MRIBuilder.Variables.scanner_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>MRIBuilder.Variables.scanner_constraints!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">scanner_constraints!(block)</code></pre><p>Constraints <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a> and <a href="../api/#MRIBuilder.Variables.variables.slew_rate"><code>variables.slew_rate</code></a> to be less than the <a href="../defining_sequence/#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>global_scanner</code></a> maximum.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L802-L806">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.set_getter!-Tuple{Symbol, Symbol}" href="#MRIBuilder.Variables.set_getter!-Tuple{Symbol, Symbol}"><code>MRIBuilder.Variables.set_getter!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">set_getter!(variable_name, getter)</code></pre><p>Set the getter function for <code>variable_name</code>.</p><p>If the value for <code>variable</code> is not defined for a sequence, the value for the result of the <code>getter</code> function is returned instead.</p><p>Possible values for the <code>getter</code> function are:</p><ul><li><code>:pulse</code>: <a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a></li><li><code>:gradient</code>: <a href="../api/#MRIBuilder.Variables.get_gradient"><code>get_gradient</code></a></li><li><code>:readout</code>: <a href="#MRIBuilder.Variables.get_readout"><code>get_readout</code></a></li><li><code>:pathway</code>: <a href="../defining_sequence/#MRIBuilder.Variables.get_pathway"><code>get_pathway</code></a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L386-L398">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}" href="#MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}"><code>MRIBuilder.Variables.set_simple_constraints!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">set_simple_constraints!(block, kwargs)</code></pre><p>Add any constraints or objective functions to the variables of a <a href="#MRIBuilder.Variables.AbstractBlock"><code>AbstractBlock</code></a>.</p><p>Each keyword argument has to match one of the functions in <a href="#variables"><code>variables</code></a>(block). If set to a numeric value, a constraint will be added to fix the function value to that numeric value. If set to <code>:min</code> or <code>:max</code>, minimising or maximising this function will be added to the cost function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L662-L670">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variable_defined_for-Tuple{Symbol, Vararg{Any}}" href="#MRIBuilder.Variables.variable_defined_for-Tuple{Symbol, Vararg{Any}}"><code>MRIBuilder.Variables.variable_defined_for</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">variable_defined_for(variable, args...; kwargs...)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L84-L86">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.@defvar-Tuple{Any, Any}" href="#MRIBuilder.Variables.@defvar-Tuple{Any, Any}"><code>MRIBuilder.Variables.@defvar</code></a> — <span class="docstring-category">Macro</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">@defvar(function(s))</code></pre><p>Defines new <a href="#variables"><code>variables</code></a>.</p><p>Each variable is defined as regular Julia functions embedded within a <code>@defvar</code> macro. For example, to define a <code>variables.echo_time</code> variable for a <code>SpinEcho</code> sequence, one can use:</p><pre><code class="language-julia hljs">@defvar echo_time(ge::SpinEcho) = 2 * (variables.effective_time(ge, :refocus) - variables.effective_time(ge, :excitation))</code></pre><p>Multiple variables can be defined in a single <code>@defvar</code> by including them in a code block:</p><pre><code class="language-julia hljs">@defvar begin +<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Optimisation · MRIBuilder.jl</title><meta name="title" content="Optimisation · MRIBuilder.jl"/><meta property="og:title" content="Optimisation · MRIBuilder.jl"/><meta property="twitter:title" content="Optimisation · MRIBuilder.jl"/><meta name="description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="twitter:description" content="Documentation for MRIBuilder.jl: an MRI sequence builder in Julia"/><meta property="og:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/sequence_optimisation/"/><meta property="twitter:url" content="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/sequence_optimisation/"/><link rel="canonical" href="https://open.win.ox.ac.uk/pages/ndcn0236/mribuilder.jl/stable/sequence_optimisation/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">MRIBuilder.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>Optimisation</a><ul class="internal"><li><a class="tocitem" href="#variables"><span>Summary variables</span></a></li><li><a class="tocitem" href="#Variables-interface"><span>Variables interface</span></a></li></ul></li><li><a class="tocitem" href="../implemented_sequences/">Implemented sequences</a></li><li><a class="tocitem" href="../defining_sequence/">Defining sequences</a></li><li><a class="tocitem" href="../adjust_sequences/">Post-hoc adjustments</a></li><li><a class="tocitem" href="../scanners/">Scanners</a></li><li><a class="tocitem" href="../api/">Internal API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Optimisation</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Optimisation</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl" title="View the repository"><span class="docs-icon fa-brands">ï¡</span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/main/docs/src/sequence_optimisation.md" title="Edit source"><span class="docs-icon fa-solid">ï„</span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="sequence_optimisation"><a class="docs-heading-anchor" href="#sequence_optimisation">Sequence optimisation</a><a id="sequence_optimisation-1"></a><a class="docs-heading-anchor-permalink" href="#sequence_optimisation" title="Permalink"></a></h1><p>In MRIBuilder an MR <a href="../api/#MRIBuilder.Containers.BaseSequences.Sequence"><code>Sequence</code></a> is defined as a sequence of <a href="../api/#MRIBuilder.Containers.BuildingBlocks.BuildingBlock"><code>BuildingBlock</code></a> objects. Most <code>BuildingBlock</code> objects will contain free parameters determining, for example, the duration of the block or the strength/orientation of the MR gradient. In most MR sequence building software, the user will have to set all of these free parameters by computing the appropriate values given a desired echo time, b-value, etc.</p><p>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 <code>BuildingBlock</code> free parameters, such as <a href="../implemented_sequences/#MRIBuilder.Variables.variables.echo_time"><code>variables.echo_time</code></a>, <a href="#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="../api/#MRIBuilder.Variables.variables.resolution"><code>variables.resolution</code></a>, <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>, <a href="../implemented_sequences/#MRIBuilder.Variables.variables.diffusion_time"><code>variables.diffusion_time</code></a>, <a href="../defining_sequence/#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a> 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 <code>:min</code>/<code>:max</code> to minimise/maximise them). In addition to the user-defined constraints, this optimisation will also take into account any <a href="../scanners/#scanners">scanner-defined constraints</a>. Internally, MRIBuilder will then optimise the <code>BuildingBlock</code> free parameters to match any user-defined constraints and/or objectives. This optimisation uses the <a href="https://github.com/coin-or/Ipopt">Ipopt</a> optimiser accessed through the <a href="https://jump.dev/JuMP.jl/stable/">JuMP.jl</a> library.</p><p>In addition to any user-defined objectives, the developer might also have defined secondary objectives (e.g., minimise the total sequence duration). These objective functions will only be considered if they do not affect the result of the user-defined primary objective. More details on these developer-defined secondary objectives can be found in the section on <a href="../defining_sequence/#defining_sequences">defining new sequences</a></p><h2 id="variables"><a class="docs-heading-anchor" href="#variables">Summary variables</a><a id="variables-1"></a><a class="docs-heading-anchor-permalink" href="#variables" title="Permalink"></a></h2><p>All variables are available as members of the <a href="#variables"><code>variables</code></a> structure.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables" href="#MRIBuilder.Variables.variables"><code>MRIBuilder.Variables.variables</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Main module containing all the MRIBuilder sequence variables.</p><p>All variables are available as members of this module, e.g. <code>variables.echo_time</code> returns the echo time variable. New variables can be defined using <code>@defvar</code>.</p><p>Set constraints on variables by passing them on as keywords during the sequence generation, e.g., <code>seq=SpinEcho(echo_time=70)</code>.</p><p>After sequence generation you can get the variable values by calling <code>variables.echo_time(seq)</code>. For the sequence defined above this would return 70. (or a number very close to that).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L127-L140">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_left-sequence_optimisation" href="#MRIBuilder.Variables.variables.N_left-sequence_optimisation"><code>MRIBuilder.Variables.variables.N_left</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> before the maximum.</p><p>Also, see <a href="../api/#MRIBuilder.Variables.variables.N_right"><code>variables.N_right</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L89-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.N_right-sequence_optimisation" href="#MRIBuilder.Variables.variables.N_right-sequence_optimisation"><code>MRIBuilder.Variables.variables.N_right</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">N_left(sinc_pulse)</code></pre><p>Number of zero-crossings of the <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a> after the maximum.</p><p>Also, see <a href="../api/#MRIBuilder.Variables.variables.N_left"><code>variables.N_left</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L98-L104">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.TE-sequence_optimisation" href="#MRIBuilder.Variables.variables.TE-sequence_optimisation"><code>MRIBuilder.Variables.variables.TE</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Returns the echo time of a sequence in ms.</p><p>This is typically defined as the time between the excitation pulse and the crossing of k=0 during the MRI readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/spin_echoes.jl#L56-L62">source</a></section><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Computes the echo time(s) of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L513-L517">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.TR-sequence_optimisation" href="#MRIBuilder.Variables.variables.TR-sequence_optimisation"><code>MRIBuilder.Variables.variables.TR</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">repetition_time(sequence)</code></pre><p>Computes the repetition_times of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L520-L524">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.all_gradient_strengths-sequence_optimisation" href="#MRIBuilder.Variables.variables.all_gradient_strengths-sequence_optimisation"><code>MRIBuilder.Variables.variables.all_gradient_strengths</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">all_gradient_strengths(spoilt_slice_select)</code></pre><p>Returns the gradient strength before, during, and after the pulse in <a href="../api/#MRIBuilder.Parts.SpoiltSliceSelects.SpoiltSliceSelect"><code>SpoiltSliceSelect</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/spoilt_slice_selects.jl#L127-L131">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.amplitude-sequence_optimisation" href="#MRIBuilder.Variables.variables.amplitude-sequence_optimisation"><code>MRIBuilder.Variables.variables.amplitude</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">amplitude(pulse)</code></pre><p>Return the amplitude of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L65-L69">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.area_under_curve-sequence_optimisation" href="#MRIBuilder.Variables.variables.area_under_curve-sequence_optimisation"><code>MRIBuilder.Variables.variables.area_under_curve</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">area_under_curve(pathway::Pathway)</code></pre><p>Return net displacement in k-space (i.e., spoiling) experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a>.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>area_under_curve</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L131-L139">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bandwidth-sequence_optimisation" href="#MRIBuilder.Variables.variables.bandwidth-sequence_optimisation"><code>MRIBuilder.Variables.variables.bandwidth</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bandwidth(pulse)</code></pre><p>Return the bandwidth of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L86-L90">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat-sequence_optimisation" href="#MRIBuilder.Variables.variables.bmat-sequence_optimisation"><code>MRIBuilder.Variables.variables.bmat</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat(pathway::Pathway)</code></pre><p>Return 3x3 diffusion-weighted matrix experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>bmat</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L144-L152">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bmat_gradient-sequence_optimisation" href="#MRIBuilder.Variables.variables.bmat_gradient-sequence_optimisation"><code>MRIBuilder.Variables.variables.bmat_gradient</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bmat_gradient(overlapping, qstart[, first_event, last_event])</code></pre><p>Computes the addition to the <a href="../defining_sequence/#MRIBuilder.Variables.variables.bmat"><code>variables.bmat</code></a> contributed by a specific building block or gradient.</p><p><code>qstart</code> represents the <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a> at the start of this component.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L243-L252">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.bval-sequence_optimisation" href="#MRIBuilder.Variables.variables.bval-sequence_optimisation"><code>MRIBuilder.Variables.variables.bval</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">bval(pathway::Pathway)</code></pre><p>Return size of diffusion-weighting experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in rad^2 ms/um^2.</p><p>Only gradients active while the spins are in the transverse plane will contribute to the diffusion weighting.</p><p>Returns a NamedTuple with the <code>bval</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L156-L164">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.delay-sequence_optimisation" href="#MRIBuilder.Variables.variables.delay-sequence_optimisation"><code>MRIBuilder.Variables.variables.delay</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">delay(sequence)</code></pre><p>Returns the offset beetween the readout and the spin echo in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/diffusion_spin_echoes.jl#L91-L95">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.diffusion_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.diffusion_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.diffusion_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">diffusion_time(diffusion_sequence)</code></pre><p>Returns the diffusion time of a <a href="../implemented_sequences/#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a> in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/diffusion_spin_echoes.jl#L84-L88">source</a></section><section><div><pre><code class="language-julia hljs">diffusion_time(sequence)</code></pre><p>Computes the diffusion time of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L527-L531">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration(block)</code></pre><p>Duration of the sequence or building block in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L377-L381">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_dephase-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration_dephase-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration_dephase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_dephase(pathway::Pathway)</code></pre><p>Returns the net time that spins following the given <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the +transverse versus the -transverse state. This determines the amount of T2'-weighting as <span>$e^{t/T_2'}$</span>, where <span>$t$</span> is the <code>duration_dephase</code>.</p><p>Also see <a href="../defining_sequence/#MRIBuilder.Variables.variables.duration_transverse"><code>variables.duration_transverse</code></a> for T2-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L106-L113">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_state-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration_state-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration_state</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_state(pathway::Pathway, transverse::Bool, positive::Bool)</code></pre><p>Returns how long the <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in a specific state.</p><p>The requested state can be set using <code>transverse</code> and <code>positive</code> as follows:</p><ul><li><code>transverse=false</code>, <code>positive=true</code>: +longitudinal</li><li><code>transverse=true</code>, <code>positive=true</code>: +transverse</li><li><code>transverse=false</code>, <code>positive=false</code>: -longitudinal</li><li><code>transverse=true</code>, <code>positive=false</code>: -transverse</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L77-L87">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.duration_transverse-sequence_optimisation" href="#MRIBuilder.Variables.variables.duration_transverse-sequence_optimisation"><code>MRIBuilder.Variables.variables.duration_transverse</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">duration_transverse(pathway::Pathway)</code></pre><p>Returns the total amount of time that spins following the given <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> spent in the transverse plane. This determines the amount of T2-weighting as <span>$e^{t/T_2}$</span>, where <span>$t$</span> is the <code>duration_transverse</code>.</p><p>Also see <a href="../defining_sequence/#MRIBuilder.Variables.variables.duration_dephase"><code>variables.duration_dephase</code></a> for T2'-weighting.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L93-L100">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.dwell_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.dwell_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.dwell_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">dwell_time(adc)</code></pre><p>The dwell time of the ADC readout in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L66-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.echo_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.echo_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.echo_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Returns the echo time of a sequence in ms.</p><p>This is typically defined as the time between the excitation pulse and the crossing of k=0 during the MRI readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/spin_echoes.jl#L56-L62">source</a></section><section><div><pre><code class="language-julia hljs">echo_time(sequence)</code></pre><p>Computes the echo time(s) of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L513-L517">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.effective_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.effective_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.effective_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">effective_time(container, indices...)</code></pre><p>Returns the start time of component with given <code>indices</code> with respect to the start of the <a href="../api/#MRIBuilder.Containers.Abstract.ContainerBlock"><code>ContainerBlock</code></a>.</p><p>This will crash if the component does not have an <a href="../api/#MRIBuilder.Variables.variables.effective_time"><code>variables.effective_time</code></a> (e.g., if it is (part of) a gradient waveform).</p><p>Also see <a href="#MRIBuilder.Variables.variables.duration-sequence_optimisation"><code>variables.duration</code></a>, <a href="../api/#MRIBuilder.Containers.Abstract.start_time-Tuple{ContainerBlock, Any, Any, Vararg{Any}}"><code>start_time</code></a>, and <a href="../api/#MRIBuilder.Containers.Abstract.end_time-Tuple{ContainerBlock, Any, Vararg{Any}}"><code>end_time</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L41-L49">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flat_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.flat_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.flat_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flat_time(trapezoid)</code></pre><p>Returns the flat time of a <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L124-L128">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.flip_angle-sequence_optimisation" href="#MRIBuilder.Variables.variables.flip_angle-sequence_optimisation"><code>MRIBuilder.Variables.variables.flip_angle</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">flip_angle(pulse)</code></pre><p>Return the flip angle of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L79-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.fov-sequence_optimisation" href="#MRIBuilder.Variables.variables.fov-sequence_optimisation"><code>MRIBuilder.Variables.variables.fov</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">fov(readout)</code></pre><p>Defines the field of view of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L288-L292">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.frequency-sequence_optimisation" href="#MRIBuilder.Variables.variables.frequency-sequence_optimisation"><code>MRIBuilder.Variables.variables.frequency</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">frequency(pulse)</code></pre><p>Return the off-resonance frequency of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in kHz.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L72-L76">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.gradient_strength-sequence_optimisation" href="#MRIBuilder.Variables.variables.gradient_strength-sequence_optimisation"><code>MRIBuilder.Variables.variables.gradient_strength</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength(gradient)</code></pre><p>Maximum 3D gradient strength of the gradient in kHz/um.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L32-L36">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation" href="#MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation"><code>MRIBuilder.Variables.variables.gradient_strength_norm</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_strength_norm(gradient)</code></pre><p>The norm of the <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L479-L483">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.lobe_duration-sequence_optimisation" href="#MRIBuilder.Variables.variables.lobe_duration-sequence_optimisation"><code>MRIBuilder.Variables.variables.lobe_duration</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">lobe_duration(sinc_pulse)</code></pre><p>Time between two zero-crossings of a <a href="../api/#MRIBuilder.Components.Pulses.SincPulses.SincPulse"><code>SincPulse</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/pulses/sinc_pulses.jl#L113-L117">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.net_dephasing-sequence_optimisation" href="#MRIBuilder.Variables.variables.net_dephasing-sequence_optimisation"><code>MRIBuilder.Variables.variables.net_dephasing</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">net_dephasing(pathway::Pathway)</code></pre><p>Return net displacement vector in k-space/q-space experienced by the spins following a specific <a href="../defining_sequence/#MRIBuilder.Pathways.Pathway"><code>Pathway</code></a> in kHz/um.</p><p>Only gradients active while the spins are in the transverse plane are considered.</p><p>Returns a NamedTuple with the <code>qvec</code> for all gradient groups.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/pathways.jl#L118-L126">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.nsamples-sequence_optimisation" href="#MRIBuilder.Variables.variables.nsamples-sequence_optimisation"><code>MRIBuilder.Variables.variables.nsamples</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">nsamples(adc)</code></pre><p>Number of samples in an ADC.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L89-L93">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.oversample-sequence_optimisation" href="#MRIBuilder.Variables.variables.oversample-sequence_optimisation"><code>MRIBuilder.Variables.variables.oversample</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">oversample(adc)</code></pre><p>The oversampling rate of the ADC readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L59-L63">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.phase-sequence_optimisation" href="#MRIBuilder.Variables.variables.phase-sequence_optimisation"><code>MRIBuilder.Variables.variables.phase</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">phase(pulse)</code></pre><p>Return the phase of an <a href="../api/#MRIBuilder.Components.AbstractTypes.RFPulseComponent"><code>RFPulseComponent</code></a> in degrees.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L58-L62">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.qval-sequence_optimisation" href="#MRIBuilder.Variables.variables.qval-sequence_optimisation"><code>MRIBuilder.Variables.variables.qval</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">qval(gradient)</code></pre><p>The norm of the <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L427-L431">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.qvec-sequence_optimisation" href="#MRIBuilder.Variables.variables.qvec-sequence_optimisation"><code>MRIBuilder.Variables.variables.qvec</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">qvec(overlapping[, first_event, last_event])</code></pre><p>Computes the area under the curve for the gradient waveform in <a href="../api/#MRIBuilder.Containers.BuildingBlocks.BaseBuildingBlock"><code>BaseBuildingBlock</code></a>.</p><p>If <code>first_event</code> is set to something else than <code>nothing</code>, only the gradient waveform after this RF pulse/Readout will be considered. Similarly, if <code>last_event</code> is set to something else than <code>nothing</code>, only the gradient waveform up to this RF pulse/Readout will be considered.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/building_blocks.jl#L233-L240">source</a></section><section><div><pre><code class="language-julia hljs">qvec(gradient)</code></pre><p>The total integral of the area under the gradient curve as a length-3 vector.</p><p>The norm of this vector is available as <a href="#MRIBuilder.Variables.variables.qval-sequence_optimisation"><code>qval</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L452-L458">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.ramp_overlap-sequence_optimisation" href="#MRIBuilder.Variables.variables.ramp_overlap-sequence_optimisation"><code>MRIBuilder.Variables.variables.ramp_overlap</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">ramp_overlap(line_readout)</code></pre><p>Return the fraction of the gradient ramp that overlaps with the ADC readout.</p><p>Set to 0 to ensure that the ADC is only active during the flat time of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L302-L308">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.readout_times-sequence_optimisation" href="#MRIBuilder.Variables.variables.readout_times-sequence_optimisation"><code>MRIBuilder.Variables.variables.readout_times</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">readout_times(sequence)</code></pre><p>Returns all the times that the sequence will readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/containers/abstract.jl#L146-L150">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.resolution-sequence_optimisation" href="#MRIBuilder.Variables.variables.resolution-sequence_optimisation"><code>MRIBuilder.Variables.variables.resolution</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">resolution(readout)</code></pre><p>Resolution of the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L80-L84">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.rise_time-sequence_optimisation" href="#MRIBuilder.Variables.variables.rise_time-sequence_optimisation"><code>MRIBuilder.Variables.variables.rise_time</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">rise_time(trapezoid)</code></pre><p>Returns the rise time of a <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L117-L121">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slew_rate-sequence_optimisation" href="#MRIBuilder.Variables.variables.slew_rate-sequence_optimisation"><code>MRIBuilder.Variables.variables.slew_rate</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate(gradient)</code></pre><p>Maximum 3D slew rate of the gradient in kHz/um/ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/abstract_types.jl#L25-L29">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slew_rate_norm-sequence_optimisation" href="#MRIBuilder.Variables.variables.slew_rate_norm-sequence_optimisation"><code>MRIBuilder.Variables.variables.slew_rate_norm</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slew_rate_norm(gradient)</code></pre><p>The norm of the <a href="../api/#MRIBuilder.Variables.variables.slew_rate"><code>variables.slew_rate</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L486-L490">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.slice_thickness-sequence_optimisation" href="#MRIBuilder.Variables.variables.slice_thickness-sequence_optimisation"><code>MRIBuilder.Variables.variables.slice_thickness</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">slice_thickness(slice_select)</code></pre><p>Defines the slice thickness for a RF pulse with an active gradient in mm (e.g., <a href="../api/#MRIBuilder.Parts.Trapezoids.SliceSelect"><code>SliceSelect</code></a>).</p><p>Defines as <a href="#MRIBuilder.Variables.variables.gradient_strength_norm-sequence_optimisation"><code>variables.gradient_strength_norm</code></a>(gradient) / <a href="../api/#MRIBuilder.Variables.variables.bandwidth"><code>variables.bandwidth</code></a>(pulse)</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L213-L219">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.spoiler-sequence_optimisation" href="#MRIBuilder.Variables.variables.spoiler-sequence_optimisation"><code>MRIBuilder.Variables.variables.spoiler</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">spoiler(gradient)</code></pre><p>Spatial scale in mm over which the spoiler gradient will dephase by 2Ï€.</p><p>Automatically computed based on <a href="../api/#MRIBuilder.Variables.variables.qvec"><code>variables.qvec</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L443-L449">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.time_to_center-sequence_optimisation" href="#MRIBuilder.Variables.variables.time_to_center-sequence_optimisation"><code>MRIBuilder.Variables.variables.time_to_center</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">time_to_center(adc)</code></pre><p>The time of the ADC readout to reach the center of k-space.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/components/readouts/ADCs.jl#L73-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.voxel_size-sequence_optimisation" href="#MRIBuilder.Variables.variables.voxel_size-sequence_optimisation"><code>MRIBuilder.Variables.variables.voxel_size</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">voxel_size(readout)</code></pre><p>Defines the voxel size of a readout in mm.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L295-L299">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.Δ-sequence_optimisation" href="#MRIBuilder.Variables.variables.Δ-sequence_optimisation"><code>MRIBuilder.Variables.variables.Δ</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">diffusion_time(diffusion_sequence)</code></pre><p>Returns the diffusion time of a <a href="../implemented_sequences/#MRIBuilder.Sequences.DiffusionSpinEchoes.DiffusionSpinEcho-Tuple{}"><code>DiffusionSpinEcho</code></a> in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/sequences/diffusion_spin_echoes.jl#L84-L88">source</a></section><section><div><pre><code class="language-julia hljs">diffusion_time(sequence)</code></pre><p>Computes the diffusion time of a sequence in ms.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L527-L531">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variables.δ-sequence_optimisation" href="#MRIBuilder.Variables.variables.δ-sequence_optimisation"><code>MRIBuilder.Variables.variables.δ</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">δ(trapezoid)</code></pre><p>Returns the effective duration of a <a href="../api/#MRIBuilder.Parts.Trapezoids.Trapezoid"><code>Trapezoid</code></a> gradient profile in ms.</p><p>Defined as <a href="../api/#MRIBuilder.Variables.variables.rise_time"><code>variables.rise_time</code></a> + <a href="../api/#MRIBuilder.Variables.variables.flat_time"><code>variables.flat_time</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/parts/trapezoids.jl#L136-L142">source</a></section></article><h2 id="Variables-interface"><a class="docs-heading-anchor" href="#Variables-interface">Variables interface</a><a id="Variables-interface-1"></a><a class="docs-heading-anchor-permalink" href="#Variables-interface" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables" href="#MRIBuilder.Variables"><code>MRIBuilder.Variables</code></a> — <span class="docstring-category">Module</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Defines the functions that can be called on parts of an MRI sequence to query or constrain any variables.</p><p>In addition this defines:</p><ul><li><a href="#variables"><code>variables</code></a>: module containing all variables.</li><li><a href="#MRIBuilder.Variables.VariableType"><code>VariableType</code></a>: parent type for any variables (whether number or JuMP variable).</li><li><a href="#MRIBuilder.Variables.get_free_variable-Tuple{Number}"><code>get_free_variable</code></a>: helper function to create new JuMP variables.</li><li><a href="#MRIBuilder.Variables.add_cost_function!"><code>add_cost_function!</code></a>: add a specific term to the model cost functions.</li><li><a href="#MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}"><code>set_simple_constraints!</code></a>: call <a href="#MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}"><code>apply_simple_constraint!</code></a> for each keyword argument.</li><li><a href="#MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}"><code>apply_simple_constraint!</code></a>: set a simple equality constraint.</li><li><a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a>/<a href="../api/#MRIBuilder.Variables.get_gradient"><code>get_gradient</code></a>/<a href="#MRIBuilder.Variables.get_readout"><code>get_readout</code></a>: Used to get the pulse/gradient/readout part of a building block</li><li><a href="#MRIBuilder.Variables.gradient_orientation"><code>gradient_orientation</code></a>: returns the gradient orientation of a waveform if fixed.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L1-L13">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.VariableType" href="#MRIBuilder.Variables.VariableType"><code>MRIBuilder.Variables.VariableType</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type for any variable in the MRI sequence.</p><p>Each variable can be one of:</p><ul><li>a new JuMP variable</li><li>an expression linking this variable to other JuMP variable</li><li>a number</li></ul><p>Create these using <a href="#MRIBuilder.Variables.get_free_variable-Tuple{Number}"><code>get_free_variable</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L543-L552">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.alternative_variables" href="#MRIBuilder.Variables.alternative_variables"><code>MRIBuilder.Variables.alternative_variables</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Mapping of variable names to alternative ways to compute that variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L151-L153">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.default_generic_method" href="#MRIBuilder.Variables.default_generic_method"><code>MRIBuilder.Variables.default_generic_method</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Contains for each variable the default, generic method.</p><p>This is the method that checks for <a href="@ref"><code>alternative_functions</code></a> or uses one of the getters.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L144-L148">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.getter_functions" href="#MRIBuilder.Variables.getter_functions"><code>MRIBuilder.Variables.getter_functions</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Mapping of symbols to actual getter functions.</p><p>Used in <a href="#MRIBuilder.Variables.set_getter!-Tuple{Symbol, Symbol}"><code>set_getter!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L622-L626">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.getters" href="#MRIBuilder.Variables.getters"><code>MRIBuilder.Variables.getters</code></a> — <span class="docstring-category">Constant</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Assigns getters to specific variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L161-L163">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.AbstractBlock" href="#MRIBuilder.Variables.AbstractBlock"><code>MRIBuilder.Variables.AbstractBlock</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Parent type of all components, building block, and sequences that form an MRI sequence.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L21-L23">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.InvalidRoute" href="#MRIBuilder.Variables.InvalidRoute"><code>MRIBuilder.Variables.InvalidRoute</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Raised if there is no way to reach a valid function by the default, generic method (<a href="#MRIBuilder.Variables.default_generic_method"><code>default_generic_method</code></a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L156-L158">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables._get_mult_variable-Tuple{Any, Any, Vararg{Any}}" href="#MRIBuilder.Variables._get_mult_variable-Tuple{Any, Any, Vararg{Any}}"><code>MRIBuilder.Variables._get_mult_variable</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><p>Helper to call the variable for a result of a getter. Used in <a href="#MRIBuilder.Variables._get_variable-Tuple{Symbol, Set{Symbol}, Vararg{Any}}"><code>_get_variable</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L227-L229">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables._get_variable-Tuple{Symbol, Set{Symbol}, Vararg{Any}}" href="#MRIBuilder.Variables._get_variable-Tuple{Symbol, Set{Symbol}, Vararg{Any}}"><code>MRIBuilder.Variables._get_variable</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">_get_variable(name, tried_names, args...; kwargs...)</code></pre><p>Tries to find a route to get values for the variable <code>name</code> with the given <code>args</code> and <code>kwargs</code>.</p><p>The route through <code>tried_names</code> has already been attempted.</p><p>This function returns the route to get to the value and the value itself.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L168-L176">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.add_alternative_variable!-Tuple{Symbol, Symbol, Function, Bool}" href="#MRIBuilder.Variables.add_alternative_variable!-Tuple{Symbol, Symbol, Function, Bool}"><code>MRIBuilder.Variables.add_alternative_variable!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_alternative_variable!(name, other_func, conversion)</code></pre><p>Defines an alternative way to compute the variable with given <code>name</code>.</p><p>If the variable <code>name</code> is not defined and <code>other_name</code> is, then the value of <code>name</code> is computed by applying <code>conversion</code> to the value of <code>other_name</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L411-L418">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.add_cost_function!" href="#MRIBuilder.Variables.add_cost_function!"><code>MRIBuilder.Variables.add_cost_function!</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_cost_function!(function, level=2)</code></pre><p>Adds an additional term to the cost function.</p><p>This term will be minimised together with any other terms in the cost function. Terms added at a lower level will be optimised before any terms with a higher level.</p><p>By default, the term is added to the <code>level=2</code>, which is appropriate for any cost functions added by the developer, which will generally only be optimised after any user-defined cost functions (which are added at <code>level=1</code> by <a href="@ref"><code>add_simple_constraint!</code></a> or <a href="#MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}"><code>set_simple_constraints!</code></a>.</p><p>Any sequence will also have a <code>level=3</code> cost function, which minimises the total sequence duration.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L642-L654">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.add_new_variable!-Tuple{Symbol}" href="#MRIBuilder.Variables.add_new_variable!-Tuple{Symbol}"><code>MRIBuilder.Variables.add_new_variable!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">add_new_variable!(name)</code></pre><p>Adds a new variable in <a href="#variables"><code>variables</code></a>.</p><p>This is a helper function, which is called by <code>@defvar</code> for any variable that does not exist yet.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L241-L247">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.adjust_groups-Tuple{MRIBuilder.Variables.AbstractBlock}" href="#MRIBuilder.Variables.adjust_groups-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>MRIBuilder.Variables.adjust_groups</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">adjust_groups(block)</code></pre><p>Returns an array of keywords in <a href="../adjust_sequences/#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a> that should affect a specfic block.</p><p>If any of these keywords are present in <a href="../adjust_sequences/#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a>, then <a href="#MRIBuilder.Variables.adjust_internal"><code>adjust_internal</code></a> will be called.</p><p>Some standard keywords are:</p><ul><li><code>:gradient</code>: expects gradient adjustment parameters</li><li><code>:pulse</code>: expects RF pulse adjustment parameters</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L45-L55">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.adjust_internal" href="#MRIBuilder.Variables.adjust_internal"><code>MRIBuilder.Variables.adjust_internal</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">adjust_internal(block, names_used; kwargs...)</code></pre><p>Returns the adjusted blocks and add any keywords used in the process to <code>names_used</code>.</p><p>This is a helper function used by <a href="../adjust_sequences/#MRIBuilder.Variables.adjust-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust</code></a>. It should be defined for any block that is adjustable (as defined by <a href="#MRIBuilder.Variables.adjust_groups-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>adjust_groups</code></a>).</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L35-L42">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}" href="#MRIBuilder.Variables.apply_simple_constraint!-Tuple{AbstractVector, Symbol}"><code>MRIBuilder.Variables.apply_simple_constraint!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">apply_simple_constraint!(variable, value)</code></pre><p>Add a single constraint or objective to the <code>variable</code>.</p><p><code>value</code> can be one of:</p><ul><li><code>nothing</code>: do nothing</li><li><code>:min</code>: minimise the variable</li><li><code>:max</code>: maximise the variable</li><li><code>number</code>: fix variable to this value</li><li><code>equation</code>: fix variable to the result of this equation</li></ul><pre><code class="nohighlight hljs">apply_simple_constraint!(variable, :>=/:<=, value)</code></pre><p>Set an inequality constraint to the <code>variable</code>.</p><p><code>value</code> can be a number of an equation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L737-L755">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.base_variables-Tuple{}" href="#MRIBuilder.Variables.base_variables-Tuple{}"><code>MRIBuilder.Variables.base_variables</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">base_variables([T])</code></pre><p>Return dictionary with all <a href="@ref"><code>Variable</code></a> objects defined for a specific sequence component/block <code>T</code>.</p><p>This only returns those <a href="@ref"><code>Variable</code></a> directly defined for this component/block, not for any sub-components (through <a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a>, [<code>get_gradient</code>][(@ref), etc.)</p><p>If <code>T</code> is not provided, all <a href="@ref"><code>Variable</code></a> objects are returned.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L62-L70">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_free_variable-Tuple{Number}" href="#MRIBuilder.Variables.get_free_variable-Tuple{Number}"><code>MRIBuilder.Variables.get_free_variable</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_free_variable(value; integer=false, start=0.01)</code></pre><p>Get a representation of a given <code>variable</code> given a user-defined constraint.</p><p>The result is guaranteed to be a <a href="#MRIBuilder.Variables.VariableType"><code>VariableType</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L556-L562">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.get_readout" href="#MRIBuilder.Variables.get_readout"><code>MRIBuilder.Variables.get_readout</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">get_readout(sequence)</code></pre><p>Get the main readout events played out during the sequence.</p><p>This has to be defined for individual sequences to work.</p><p>Any <code>readout</code> variables not explicitly defined for this sequence will be passed on to the readout.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L600-L608">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.gradient_orientation" href="#MRIBuilder.Variables.gradient_orientation"><code>MRIBuilder.Variables.gradient_orientation</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">gradient_orientation(building_block)</code></pre><p>Returns the gradient orientation.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L634-L638">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.make_generic" href="#MRIBuilder.Variables.make_generic"><code>MRIBuilder.Variables.make_generic</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">make_generic(sequence/building_block/component)</code></pre><p>Returns a generic version of the <code>BaseSequence</code>, <code>BaseBuildingBlock</code>, or <code>BaseComponent</code></p><ul><li>Sequences are all flattened and returned as a single <code>Sequence</code> containing only <code>BuildingBlock</code> objects.</li><li>Any <code>BaseBuildingBlock</code> is converted into a <code>BuildingBlock</code>.</li><li>Pulses are replaced with <code>GenericPulse</code> (except for instant pulses).</li><li>Instant readouts are replaced with <code>ADC</code>.</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L789-L798">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.scanner_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock}" href="#MRIBuilder.Variables.scanner_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock}"><code>MRIBuilder.Variables.scanner_constraints!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">scanner_constraints!(block)</code></pre><p>Constraints <a href="../api/#MRIBuilder.Variables.variables.gradient_strength"><code>variables.gradient_strength</code></a> and <a href="../api/#MRIBuilder.Variables.variables.slew_rate"><code>variables.slew_rate</code></a> to be less than the <a href="../defining_sequence/#MRIBuilder.BuildSequences.global_scanner-Tuple{}"><code>global_scanner</code></a> maximum.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L802-L806">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.set_getter!-Tuple{Symbol, Symbol}" href="#MRIBuilder.Variables.set_getter!-Tuple{Symbol, Symbol}"><code>MRIBuilder.Variables.set_getter!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">set_getter!(variable_name, getter)</code></pre><p>Set the getter function for <code>variable_name</code>.</p><p>If the value for <code>variable</code> is not defined for a sequence, the value for the result of the <code>getter</code> function is returned instead.</p><p>Possible values for the <code>getter</code> function are:</p><ul><li><code>:pulse</code>: <a href="../api/#MRIBuilder.Variables.get_pulse"><code>get_pulse</code></a></li><li><code>:gradient</code>: <a href="../api/#MRIBuilder.Variables.get_gradient"><code>get_gradient</code></a></li><li><code>:readout</code>: <a href="#MRIBuilder.Variables.get_readout"><code>get_readout</code></a></li><li><code>:pathway</code>: <a href="../defining_sequence/#MRIBuilder.Variables.get_pathway"><code>get_pathway</code></a></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L386-L398">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}" href="#MRIBuilder.Variables.set_simple_constraints!-Tuple{MRIBuilder.Variables.AbstractBlock, Any}"><code>MRIBuilder.Variables.set_simple_constraints!</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">set_simple_constraints!(block, kwargs)</code></pre><p>Add any constraints or objective functions to the variables of a <a href="#MRIBuilder.Variables.AbstractBlock"><code>AbstractBlock</code></a>.</p><p>Each keyword argument has to match one of the functions in <a href="#variables"><code>variables</code></a>(block). If set to a numeric value, a constraint will be added to fix the function value to that numeric value. If set to <code>:min</code> or <code>:max</code>, minimising or maximising this function will be added to the cost function.</p></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L662-L670">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.variable_defined_for-Tuple{Symbol, Vararg{Any}}" href="#MRIBuilder.Variables.variable_defined_for-Tuple{Symbol, Vararg{Any}}"><code>MRIBuilder.Variables.variable_defined_for</code></a> — <span class="docstring-category">Method</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">variable_defined_for(variable, args...; kwargs...)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L84-L86">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MRIBuilder.Variables.@defvar-Tuple{Any, Any}" href="#MRIBuilder.Variables.@defvar-Tuple{Any, Any}"><code>MRIBuilder.Variables.@defvar</code></a> — <span class="docstring-category">Macro</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">@defvar(function(s))</code></pre><p>Defines new <a href="#variables"><code>variables</code></a>.</p><p>Each variable is defined as regular Julia functions embedded within a <code>@defvar</code> macro. For example, to define a <code>variables.echo_time</code> variable for a <code>SpinEcho</code> sequence, one can use:</p><pre><code class="language-julia hljs">@defvar echo_time(ge::SpinEcho) = 2 * (variables.effective_time(ge, :refocus) - variables.effective_time(ge, :excitation))</code></pre><p>Multiple variables can be defined in a single <code>@defvar</code> by including them in a code block:</p><pre><code class="language-julia hljs">@defvar begin function var1(seq::SomeSequenceType) ... end function var2(seq::SomeSequenceType) ... end -end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/3b8e3e657d0bf2da51c78738574860e5ee34a791/src/variables.jl#L271-L293">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../implemented_sequences/">Implemented sequences »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 14:27">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html> +end</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://git.fmrib.ox.ac.uk/ndcn0236/MRIBuilder.jl/-/tree/232eca241998cb0f1dcb2b58947141f9987592e9/src/variables.jl#L271-L293">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../implemented_sequences/">Implemented sequences »</a><div class="flexbox-break"></div></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 18 October 2024 15:04">Friday 18 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><div data-docstringscollapsed="true"></div></html>