Skip to content

Commit

Permalink
Plotting electrodes on slices now takes numerical adjust_brightness
Browse files Browse the repository at this point in the history
… interpreted as quantile
  • Loading branch information
dipterix committed Aug 22, 2024
1 parent 47a8db0 commit 3854835
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Changes since last CRAN release
* `498f62db (HEAD -> master)` [_`dipterix`_]: Changed default color palette for discrete values, removed colors that are too dark or gray
* `c345aa3a (origin/master, origin/HEAD)` [_`dipterix`_]: Change `CT` threshold back to positive (3000) when switching from `DBS` leads back to `sEEG` leads.
* `7086b17c (HEAD -> master)` [_`dipterix`_]: Plotting electrodes on slices now takes numerical `adjust_brightness` interpreted as quantile
* `47a8db0a (origin/master, origin/HEAD)` [_`dipterix`_]: Changed default color palette for discrete values, removed colors that are too dark or gray
* `c345aa3a` [_`dipterix`_]: Change `CT` threshold back to positive (3000) when switching from `DBS` leads back to `sEEG` leads.
* `69a3853c` [_`dipterix`_]: Support drag and drop annot files
* `ac572325` [_`dipterix`_]: Changed electrode material to display front-side only instead of double side to avoid overlapping contacts visually when spacing is small
* `189fc172` [_`dipterix`_]: Added `Abbott` segmented electrodes 6170-6173, with segmented electrodes clockwise viewing from proximal end
Expand Down
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.1.1.9011
Version: 1.1.1.9012
Authors@R: c(
person("Zhengjia", "Wang", email = "dipterix.wang@gmail.com", role = c("aut", "cre", "cph")),
person("John", "Magnotti", email = "John.Magnotti@Pennmedicine.upenn.edu", role = c("ctb", "res")),
Expand Down
7 changes: 5 additions & 2 deletions R/class_brain.R
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,11 @@ Brain2 <- R6::R6Class(
if(is.na(adjust_brightness)) {
adjust_brightness <- TRUE
}
if( adjust_brightness ) {
qt <- quantile(volume$data, c(0, 0.95), na.rm = TRUE)
if( isTRUE(adjust_brightness) || isTRUE(adjust_brightness > 0 && adjust_brightness < 1) ) {
if(isTRUE(adjust_brightness)) {
adjust_brightness <- 0.95
}
qt <- quantile(volume$data, c(0, adjust_brightness), na.rm = TRUE)
volume$data[] <- (volume$data - qt[[1]]) / (qt[[2]] - qt[[1]]) * 255
volume$data[volume$data > 255] <- 255
}
Expand Down

0 comments on commit 3854835

Please sign in to comment.