View source: R/choose-segmentation.R
choose_segmentation | R Documentation |
with_segmentation
allows a specific segmentation to be
temporarily selected.
choose_segmentation(
release = c("flywire31", "public-flywire31", "20200412", "20190805", "20190521",
"sandbox-flywire31"),
set = TRUE,
moreoptions = list()
)
with_segmentation(release, expr)
release |
character vector specifying a released segmentation via a known short name or a sample neuroglancer URL. |
set |
Whether or not to set the selected options for the selected
|
moreoptions |
Any further options that you might wish to set (optional,
expert use only, principally intended for use by |
expr |
The expression to execute with the temporary options set |
Each released segmentation implies a number of global options. This
package comes with multiple different default scene urls specified via
choose_segmentation
or with_segmentation
. This
is the easiest way to choose a particular segmentation. You can also pass a
sample URL to the release
argument.
As of Nov 2020, the "flywire31"
is the default segmentation when the
package loads. This specifies the production (i.e. in progress) version of
the flywire dataset. You will need to register with the flywire team and
generate a flywire token linked to the email used during your registration
to access this. Alternatively you can also use the
"public-flywire31"
data release accompanying the Dorkenwald et al
2023 and Schlegel et al 2023 publications; you still need a token for this
(see flywire_set_token
), but no registration is required (and
there are no limitations on use of these data for new projects besides
citing those two preprints).
You can also specify a different sample URL via the sampleurl
argument of some functions; it will be remembered for the rest of the R
session. If you regularly use a particular kind of scene URL, you can set
options(fafbseg.sampleurl)
in your Rprofile
file.
If you need to use both built-in and custom segmentation URLs, we recommend
specifying the custom URL in your Rprofile
file and using the
with_segmentation
to run code that uses one of the built-in
segmentations.
If set=TRUE
a list containing the previous values of the
relevant global options (in the style of options
. If
set=FALSE
a named list containing the option values.
The result of evaluating expr
choose_segmentation('20190805', set=FALSE)
## Not run:
# temporarily change default segmentation to run a command
# but restore original default when finished
# Choose the FlyWire segmentation
with_segmentation('flywire31', {open_fafb_ngl(c(460792, 221812, 61480))})
# similarly for one Google (Li and Jain) segmentation
with_segmentation('20190805', {open_fafb_ngl(c(460792, 221812, 61480))})
## End(Not run)
## Not run:
n <- with_segmentation("20190521",
read.neuron.brainmaps(22427007374))
# open location in flywire
with_segmentation("flywire", open_fafb_ngl(c(433440, 168344, 131200)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.