links¶
champalimaud.links
¶
Links that open cells in other tools.
Neuroglancer draws the meshes of cells in 3D, and Codex lists cells by search. Each takes the whole request in its URL, so building one reads no data and opens no connection.
codex_search_url(query)
¶
Return a Codex search URL that lists the cells a query matches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
What the Codex search box takes: free text, root ids separated
by commas, or structured terms such as |
required |
Returns:
| Type | Description |
|---|---|
str
|
The page needs a Codex login; without one it shows the sign-in. |
See Also
neuroglancer_url : Shows the same cells in 3D.
Examples:
>>> codex_search_url("cell_type == LC16")
'https://codex.flywire.ai/app/search?filter_string=cell_type%20%3D%3D%20LC16'
Source code in champalimaud/links.py
neuroglancer_url(root_ids, *, colors=None, side_panel=False)
¶
Return a Neuroglancer URL that shows cells in 3D.
The scene has the brain outline and the meshes of the given cells, over the EM volume, which loads when a slice view is opened. It needs a browser that has WebGL. Open it in its own tab: framed in a page, the viewer drew 20 cells unsteadily on an integrated GPU (Firefox, Intel Arc 130V) where a tab drew 74 smoothly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root_ids
|
sequence of int
|
The cells to show, by root id at the release's materialization. |
required |
colors
|
mapping of int to str
|
A color by root id; Neuroglancer picks one for each cell not listed. |
None
|
side_panel
|
bool
|
Open the panel that lists the segments. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
The state of the viewer is in the URL fragment, so the link opens the same scene for anyone. |
See Also
codex_search_url : Lists the same cells in Codex.
Examples:
>>> import json
>>> from urllib.parse import unquote
>>> url = neuroglancer_url(
... [720575940606173630], colors={720575940606173630: "#009E73"}
... )
>>> state = json.loads(unquote(url.split("#!")[1]))
>>> state["layers"][-1]["segments"]
['720575940606173630']
Source code in champalimaud/links.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |