You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally would allow annotations to set and retrieved using the same interface as the csv in the neuroglancer interface i.e. with a data.frame intermediate
some columns may need to be compound
The text was updated successfully, but these errors were encountered:
decode_annotes<-function(x) {
if(inherits(x, 'nglayers')) {
ann=x[[1]]
} else {
sc=ngl_decode_scene(x)
type<-NULL# for R CMD checkann=ngl_layers(sc, type=='annotation')[[1]]
}
if(!isTRUE(ann$tool=='annotatePoint'))
stop("Only point annotations can be converted to a dataframe",
" but you can still process them manually!\n",
"See ?")
process_segs<-function(x) {
if(is.null(x)) x="0"if(length(x)>1) x=paste(x, collapse=", ")
x
}
l= lapply(ann$annotations, function(p)
tibble::tibble(
x=p$point[1],
y=p$point[2],
z=p$point[3],
type=p$type,
segments= process_segs(p$segments),
id=p$id
))
df=dplyr::bind_rows(l)
df
}
The text was updated successfully, but these errors were encountered: