View source: R/catmaid_selection.R
| write_catmaid_selection | R Documentation |
Make a CATMAID selection file based on neuronlist or skids
write_catmaid_selection(x, f, color = NULL, opacity = NULL, ...)
x |
A |
f |
Path to output file (usually ends in .json) |
color |
Optional vector of colours in any format understood by
|
opacity |
Optional vector of opacities (alpha values) in range 0-1 |
... |
Additional arguments passed to |
read_catmaid_selection
## Not run:
# Write selection file for neurons defined by annotation or name
write_catmaid_selection("PN", "pns.json")
write_catmaid_selection("name:AV6", "name:av6.json")
pns=read.neurons.catmaid("PN")
# extract the glomerulus from the name
pns[, 'glomerulus'] = stringr::str_match(pns[, 'name'],
".*glomerulus ([A-z0-9]+) .*")[, 2]
pns[, 'glomerulus']=addNA(factor(pns[, 'glomerulus']))
# get the same colours that nat would normally use in a plot
plotres=plot3d(pns, col=glomerulus)
cols=attr(plotres,'df')$col
# write out selection file with those colours
write_catmaid_selection(pns, f='pns-by-glom.json', color=cols)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.