-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Oct 25, 2023
1 parent
cde2cb6
commit ca5743c
Showing
39 changed files
with
108 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-24T20:47:16","documenter_version":"1.1.2"}} | ||
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-25T10:12:57","documenter_version":"1.1.2"}} |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Convert 3D positions / montages to 2D layouts · UnfoldMakie.jl</title><meta name="title" content="Convert 3D positions / montages to 2D layouts · UnfoldMakie.jl"/><meta property="og:title" content="Convert 3D positions / montages to 2D layouts · UnfoldMakie.jl"/><meta property="twitter:title" content="Convert 3D positions / montages to 2D layouts · UnfoldMakie.jl"/><meta name="description" content="Documentation for UnfoldMakie.jl."/><meta property="og:description" content="Documentation for UnfoldMakie.jl."/><meta property="twitter:description" content="Documentation for UnfoldMakie.jl."/><meta property="og:url" content="https://unfoldtoolbox.github.io/UnfoldMakie.jl/generated/reference/positions/"/><meta property="twitter:url" content="https://unfoldtoolbox.github.io/UnfoldMakie.jl/generated/reference/positions/"/><link rel="canonical" href="https://unfoldtoolbox.github.io/UnfoldMakie.jl/generated/reference/positions/"/><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/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"><a class="docs-logo" href="../../../"><img src="../../../assets/logo.svg" alt="UnfoldMakie.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../../../">UnfoldMakie.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="../../../">UnfoldMakie Documentation</a></li><li><span class="tocitem">Visualizations-Types</span><ul><li><a class="tocitem" href="../../tutorials/erp/">ERP plot</a></li><li><a class="tocitem" href="../../../tutorials/butterfly/">Butterfly Plot</a></li><li><a class="tocitem" href="../../../tutorials/designmatrix/">Designmatrix</a></li><li><a class="tocitem" href="../../../tutorials/erpimage/">ERP Image</a></li><li><a class="tocitem" href="../../../tutorials/parallelcoordinates/">Parallel Coordinates Plot</a></li><li><a class="tocitem" href="../../../tutorials/topoplot/">Topo Plot</a></li><li><a class="tocitem" href="../../../tutorials/topoplotseries/">Topo Plot Series</a></li><li><a class="tocitem" href="../../tutorials/circTopo/">Circular TopoPlot</a></li></ul></li><li><span class="tocitem">How To</span><ul><li><a class="tocitem" href="../../../how_to/position2color/">Butterfly Colormap</a></li><li><a class="tocitem" href="../../../how_to/fix_pcp/">Fix Parallel Coordinates Plot</a></li><li><a class="tocitem" href="../../../how_to/hide_deco/">Hide Axis Spines and Decorations</a></li><li><a class="tocitem" href="../../../how_to/mult_vis_in_fig/">Include multiple Visualizations in one Figure</a></li><li><a class="tocitem" href="../../../how_to/show_oob_labels/">Show out of Bounds Label</a></li></ul></li><li><span class="tocitem">Reference</span><ul><li class="is-active"><a class="tocitem" href>Convert 3D positions / montages to 2D layouts</a><ul class="internal"><li class="toplevel"><a class="tocitem" href="#project-from-3D-electrode-locations-to-2D"><span>project from 3D electrode locations to 2D</span></a></li></ul></li></ul></li><li><a class="tocitem" href="../../../api/">API</a></li><li><a class="tocitem" href="../../../helper/">Utilities</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><a class="is-disabled">Reference</a></li><li class="is-active"><a href>Convert 3D positions / montages to 2D layouts</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Convert 3D positions / montages to 2D layouts</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/unfoldtoolbox/UnfoldMakie.jl/blob/main/docs/literate/reference/positions.jl#" title="Edit source on GitHub"><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"><pre><code class="language-julia hljs">using UnfoldMakie | ||
using CairoMakie | ||
using TopoPlots | ||
using PyMNE</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"> CondaPkg Found dependencies: /home/runner/.julia/packages/PyMNE/HGgbW/CondaPkg.toml | ||
CondaPkg Found dependencies: /home/runner/.julia/packages/PythonCall/qTEA1/CondaPkg.toml | ||
CondaPkg Dependencies already up to date</code></pre><h1 id="get-MNE-positions"><a class="docs-heading-anchor" href="#get-MNE-positions">get MNE-positions</a><a id="get-MNE-positions-1"></a><a class="docs-heading-anchor-permalink" href="#get-MNE-positions" title="Permalink"></a></h1><p>Generate a fake MNE structure <a href="https://mne.tools/0.24/auto_examples/visualization/eeglab_head_sphere.html">taken from mne documentation</a></p><pre><code class="language-julia hljs">biosemi_montage = PyMNE.channels.make_standard_montage("biosemi64") | ||
n_channels = length(biosemi_montage.ch_names) | ||
fake_info = PyMNE.create_info(ch_names=biosemi_montage.ch_names, sfreq=250., | ||
ch_types="eeg") | ||
data = rand(n_channels,1) * 1e-6 | ||
fake_evoked = PyMNE.EvokedArray(data, fake_info) | ||
fake_evoked.set_montage(biosemi_montage) | ||
|
||
pos = to_positions(fake_evoked)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">64-element Vector{Point2{Float64}}: | ||
[0.34935274876763384, 0.8914697618166454] | ||
[0.2285454515991697, 0.8299153694246765] | ||
[0.3239207434789678, 0.8210416675361911] | ||
[0.38009721906796695, 0.7346772379558053] | ||
[0.28116929732806945, 0.7288908776450373] | ||
[0.19598811803244962, 0.729048111114921] | ||
[0.13267223773863893, 0.7340421555641459] | ||
[0.07111784534666996, 0.6132348583956815] | ||
[0.1381378125628734, 0.6118022611559795] | ||
[0.2400936018380034, 0.6086174147856195] | ||
⋮ | ||
[0.612772564740614, 0.34981504242270145] | ||
[0.5864401194985318, 0.2239606378043266] | ||
[0.6853680412384293, 0.2297469981150946] | ||
[0.7705492205340492, 0.22958976464521094] | ||
[0.8338651008278599, 0.22459572019598625] | ||
[0.8710458357539724, 0.19758233504967118] | ||
[0.7379918869673291, 0.12872250633545543] | ||
[0.6426165950875308, 0.13759620822394072] | ||
[0.6171845897988648, 0.06716811394348651]</code></pre><h1 id="project-from-3D-electrode-locations-to-2D"><a class="docs-heading-anchor" href="#project-from-3D-electrode-locations-to-2D">project from 3D electrode locations to 2D</a><a id="project-from-3D-electrode-locations-to-2D-1"></a><a class="docs-heading-anchor-permalink" href="#project-from-3D-electrode-locations-to-2D" title="Permalink"></a></h1><pre><code class="language-julia hljs">pos3d = hcat(values(pyconvert(Dict,biosemi_montage.get_positions()["ch_pos"]))...) | ||
|
||
pos2 = to_positions(pos3d) | ||
|
||
f = Figure(resolution=(600,300)) | ||
scatter(f[1,1],pos3d[1:2,:]) | ||
scatter(f[1,2],pos2) | ||
f</code></pre><img src="a31d64a3.png" alt="Example block output"/><p>as one can see, the "naive" transform of just dropping the third dimension doesnt really work (left). We rather have to project the chanels to a sphere and unfold it (right)</p><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../../how_to/show_oob_labels/">« Show out of Bounds Label</a><a class="docs-footer-nextpage" href="../../../api/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.2 on <span class="colophon-date" title="Wednesday 25 October 2023 10:12">Wednesday 25 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.