Skip to content

Commit

Permalink
Fixed bloodstream import to convert AIFpars to numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
mathesong committed Aug 28, 2024
1 parent e44f944 commit dcdc737
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions R/kinfitr_bloodstream.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,21 @@ bloodstream_parameter_fix <- function(AIFmodel, AIFpars, Unit_time, Unit_AIF) {
feng <- AIFmodel == "Fit Individually: Feng"
fengconv <- AIFmodel == "Fit Individually: FengConv"

parnames <- colnames(AIFpars)

AIFpars <- AIFpars %>%
dplyr::mutate(dplyr::across(dplyr::all_of(parnames), as.numeric))

###### Tri-exponential ######
if(triexp) {

if(Unit_time == "s") {
AIFpars$alpha <- AIFpars$alpha*60
AIFpars$beta <- AIFpars$beta *60
AIFpars$gamma <- AIFpars$gamma*60
AIFpars$alpha <- as.numeric(AIFpars$alpha*60)
AIFpars$beta <- as.numeric(AIFpars$beta *60)
AIFpars$gamma <- as.numeric(AIFpars$gamma*60)

AIFpars$t0 <- AIFpars$t0/60
AIFpars$peaktime <- AIFpars$peaktime/60
AIFpars$t0 <- as.numeric(AIFpars$t0/60)
AIFpars$peaktime <- as.numeric(AIFpars$peaktime/60)
}

if(Unit_AIF != "kBq") {
Expand Down

0 comments on commit dcdc737

Please sign in to comment.