Skip to content

Commit

Permalink
update cols / docs for nerve meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferis committed Aug 12, 2023
1 parent f7899b4 commit 80d9e46
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 7 deletions.
14 changes: 9 additions & 5 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@
#' @rdname MANC.tissue.surf
"MANC.tissue.surf.sym"

#' Simplified meshes of 35 Male VNC nerves.
#'Simplified meshes of 35 Male VNC nerves.
#'
#'@name MANC.tissue.surf
#'@docType data
#'@description \code{MANC.nerves} contains meshes of 35 nerves: 17 symmetric
#' pairs \code{(L)/(R)} and \code{AbNT}. These were hand-drawn based on the
#' MANC grayscale data, guided by motor neuron and sensory neuron axon
#' reconstructions. Abbreviated names follow the conventions established in
#' Court et al., 2020 and are defined in Table 2 of Takemura et al., 2023.
#'
#' @name MANC.tissue.surf
#' @docType data
#' @description \code{MANC.nerves} contains mesh of 35 MANC nerves:
#' 15 symmetric ("L"/"R") and "AbNT".
#' @examples
#' \dontrun{
#' # Depends on nat
Expand Down
67 changes: 67 additions & 0 deletions data-raw/manc-meshes.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# see
# https://flyconnectome.slack.com/archives/C01AETN5W15/p1675441690566929
u2="https://clio-ng.janelia.org/#!gs://flyem-user-links/short/2023-08-01.060515.json"
nsc=fafbseg::ngl_decode_scene(flyem_expand_url(u2))
nsc$layers$`nerves-202301`

neuprintr::neuprint_ROI_mesh("PrN(L)", conn=manc_neuprint())
neuprintr::neuprint_ROI_hierarchy(conn = manc_neuprint())

nsc$layers$`nerves-202301` %>% dput

rois=neuprintr::neuprint_ROIs(conn = manc_neuprint())
nerve.rois=grep("N[1-4]{0,1}(T|[(LR)]{0,})$", rois, value = T)

library(nat)
nerve.meshes=nlapply(nerve.rois, neuprintr::neuprint_ROI_mesh, conn=manc_neuprint())
names(nerve.meshes)=nerve.rois

# test but not used in the end
nerve.meshes.simp <- nlapply(nerve.meshes, function(x) {
nrvmesh.simp <- Rvcg::vcgQEdecim(x, percent = 0.2)
nrvmesh.simp = addNormals(nrvmesh.simp)
nrvmesh.simp
})

# MANC.nerves=do.call(c, mapply(as.hxsurf, nerve.meshes,region=nerve.rois, SIMPLIFY = F))*8/1000

cols=readr::read_table(file="
Region Colour
AbN1(L) #7300FF
AbN1(R) #9900FF
AbN2(L) #00FF73
AbN2(R) #00FFB3
AbN3(L) #00B3A2
AbN3(R) #009980
AbN4(L) #FF6300
AbN4(R) #FF9400
AbNT #D600FF
ADMN(L) #00CC60
ADMN(R) #009933
CvN(L) #FF00A0
CvN(R) #FF0080
DMetaN(L) #FF4500
DMetaN(R) #FF2200
DProN(L) #a7faf7
DProN(R) #bff5f3
MesoAN(L) #0084ff
MesoAN(R) #0095ff
MesoLN(L) #52FF00
MesoLN(R) #21FF00
MetaLN(L) #faed05
MetaLN(R) #fff830
PDMN(L) #FFBB00
PDMN(R) #FFDD00
PrN(L) #0e0114
PrN(R) #09020d
ProAN(L) #BBAA00
ProAN(R) #998800
ProCN(L) #f788f2
ProCN(R) #f274ec
ProLN(L) #FF0000
ProLN(R) #CC0000
VProN(L) #10FF00
VProN(R) #00CC00")

MANC.nerves=do.call(c, mapply(as.hxsurf, nerve.meshes[cols$Region],region=cols$Region,col=cols$Colour, SIMPLIFY = F))*8/1000
usethis::use_data(MANC.nerves, internal = F, version = 2, overwrite = T)
Binary file modified data/MANC.nerves.rda
Binary file not shown.
7 changes: 5 additions & 2 deletions man/MANC.tissue.surf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80d9e46

Please sign in to comment.