Skip to content

Commit

Permalink
Function threeBrain does not automatically download templates if an…
Browse files Browse the repository at this point in the history
…notation is not found
  • Loading branch information
dipterix committed Jan 26, 2025
1 parent 18823dd commit 70aa92e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: threeBrain
Type: Package
Title: Your Advanced 3D Brain Visualization
Version: 1.2.0.9014
Version: 1.2.0.9015
Authors@R: c(
person("Zhengjia", "Wang", email = "[email protected]", role = c("aut", "cre", "cph")),
person("John", "Magnotti", email = "[email protected]", role = c("ctb", "res")),
Expand Down
4 changes: 4 additions & 0 deletions R/class_brain.R
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ Brain2 <- R6::R6Class(
surface_instance <- self$surfaces[[surface_type]]

if(!length(lh_path) || !length(rh_path)) {
if(length(template_subject) != 1 || is.na(template_subject)) {
# no-op: do NOT generate parc, just return
return(invisible())
}
# annot file is missing; generate one on the fly
tryCatch({
generate_cortical_parcellation(brain = self,
Expand Down
2 changes: 1 addition & 1 deletion R/template_cortical-annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ generate_cortical_parcellation <- function(
# ieegio::write_surface(x = rh_annot, con = file.path(brain$base_path, "label", sprintf("rh.%s.annot", annotation)), format = "freesurfer", type = "annotations")

if( add_annotation ) {
brain$add_annotation(sprintf("label/%s", annotation))
brain$add_annotation(sprintf("label/%s", annotation), template_subject = NULL)
}
invisible(brain)

Expand Down

0 comments on commit 70aa92e

Please sign in to comment.