Skip to content

Commit

Permalink
simplify banc_nm2raw/banc_raw2nm
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferis committed Jul 11, 2024
1 parent 1c692e9 commit dae327b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion R/cave-tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ banc_cell_info <- function(rootids = NULL, rawcoords = FALSE){
res
else {
res %>% dplyr::mutate(dplyr::across(dplyr::ends_with("position"), function(x)
nat::xyzmatrix2str(fancr::banc_raw2nm(x))))
nat::xyzmatrix2str(banc_raw2nm(x))))
}
}

Expand Down
16 changes: 2 additions & 14 deletions R/coords.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,8 @@ banc_voxdims <- memoise::memoise(function(url=choose_banc(set=FALSE)[['fafbseg.s
#' \dontrun{
#' banc_nm2raw(clipr::read_clip())
#' }
banc_nm2raw <- function(x, vd=banc_voxdims()) {
xyz<-nat::xyzmatrix(x)
xyz[,1]=xyz[,1]/vd[1]
xyz[,2]=xyz[,2]/vd[2]
xyz[,3]=xyz[,3]/vd[3]
xyz
}
banc_nm2raw <- function(x, vd=banc_voxdims()) fancr::fanc_nm2raw(x, vd=vd)

#' @export
#' @rdname banc_voxdims
banc_raw2nm <- function(x, vd=banc_voxdims()) {
xyz<-nat::xyzmatrix(x)
xyz[,1]=xyz[,1]*vd[1]
xyz[,2]=xyz[,2]*vd[2]
xyz[,3]=xyz[,3]*vd[3]
xyz
}
banc_raw2nm <- function(x, vd=banc_voxdims()) fancr::fanc_raw2nm(x, vd=vd)

0 comments on commit dae327b

Please sign in to comment.