Skip to content

Commit

Permalink
enable crant_updateids to update both supervoxel_id and root_id in a …
Browse files Browse the repository at this point in the history
…data frame from position
  • Loading branch information
alexanderbates committed Oct 31, 2024
1 parent b2c3870 commit 8af9bc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/ids.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ banc_updateids <- function(x,
}else{
old <- rep(TRUE,nrow(x))
}
old[is.na(old)] <- FALSE
old[is.na(old)] <- TRUE
if(!sum(old)){
return(x)
}
Expand All @@ -214,9 +214,9 @@ banc_updateids <- function(x,
bad <- is.na(update)|update=="0"
update <- update[!bad]
if(length(update)) x[old,][[root.column]][!bad] <- update
old[old][!bad] <- FALSE
old[old][!bad] <- TRUE
}
old[is.na(old)] <- FALSE
old[is.na(old)] <- TRUE

# update based on position
if(any(c("position","pt_position")%in%colnames(x)) && sum(old)){
Expand All @@ -227,7 +227,7 @@ banc_updateids <- function(x,
if(length(update)) x[old,][[root.column]][!bad] <- update
old[!bad] <- FALSE
}
old[is.na(old)] <- TRUE
old[is.na(old)] <- FALSE

# update based on root Ids
if(root.column%in%colnames(x) && sum(old)){
Expand Down

0 comments on commit 8af9bc0

Please sign in to comment.