diff --git a/R/data.R b/R/data.R index feb3d82..1a5c3bc 100644 --- a/R/data.R +++ b/R/data.R @@ -13,10 +13,27 @@ #' } "banc.surf" -# How it was obtained: +#' @export +#' @rdname banc.surf +"banc_neuropil.surf" + +#' @export +#' @rdname banc.surf +"banc_brain_neuropil.surf" + +#' @export +#' @rdname banc.surf +"banc_vnc_neuropil.surf" + +#' @export +#' @rdname banc.surf +"banc_neck_connective.surf" + +## How it was obtained: # res <- httr::GET("https://www.googleapis.com/storage/v1/b/zetta_lee_fly_cns_001_kisuk/o/final%2Fv2%2Fvolume_meshes%2Fmeshes%2F1%3A0.drc?alt=media&neuroglancer=610000b05b6497edcf20b78f29516970") # httr::stop_for_status(res) # bytes <- httr::content(res, as = "raw") -# banc.mesh <- decode_neuroglancer_mesh(bytes) +# banc.mesh <- malevnc:::decode_neuroglancer_mesh(bytes) # banc.surf <- as.hxsurf(banc.mesh) +# banc.surf$Vertices[,"Z"] <- banc.surf$Vertices[,"Z"]*0.9462 # scaling Jasper worked out # save(banc.surf, file="data/BANC.surf.rda") diff --git a/R/meshes.R b/R/meshes.R index de73dde..f3a5843 100644 --- a/R/meshes.R +++ b/R/meshes.R @@ -72,7 +72,7 @@ banc_decapitate <- function(x, invert = FALSE, reference = "BANC"){ v3 <- nat.templatebrains::xform_brain(v3, sample = "BANC", reference = reference) y.cut <- v1[,2] } - ismesh <- any(class(x[[1]]), class(x)) %in% "mesh3d" + ismesh <- any( c(class(x[[1]]), class(x)) %in% "mesh3d") if(!ismesh & any(class(x)%in%c("neuron","neuronlist","mesh3d"))){ if (invert){ z <- subset(x,x$y