|
11 | 11 | #' @param input Data frame containing the blood, plasma, and parent fraction |
12 | 12 | #' concentrations over time. This can be generated using the |
13 | 13 | #' \code{blood_interp} function. |
14 | | -#' @param tstar The t* specification for regression. If tstar_type="frames", |
| 14 | +#' @param tstar The t* specification for regression. If tstar_type="frames", |
15 | 15 | #' this is the number of frames from the end to include (e.g., 10 means last 10 frames). |
16 | | -#' If tstar_type="time", this is the time point (in minutes) after which all frames |
| 16 | +#' If tstar_type="time", this is the time point (in minutes) after which all frames |
17 | 17 | #' with midpoints later than this time are included. This value can be estimated using \code{Patlak_tstar}. |
18 | 18 | #' @param tstar_type Either "frames" (default) or "time", specifying how to interpret tstar. |
19 | 19 | #' @param tstarIncludedFrames Deprecated. Use 'tstar' with 'tstar_type="frames"' instead. |
@@ -71,7 +71,7 @@ Patlakplot <- function(t_tac, tac, input, tstar, weights = NULL, |
71 | 71 |
|
72 | 72 | # Convert timeStartEnd to frameStartEnd if needed |
73 | 73 | if (is.null(frameStartEnd) && !is.null(timeStartEnd)) { |
74 | | - frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
| 74 | + frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
75 | 75 | tail(which(t_tac <= timeStartEnd[2]), 1)) |
76 | 76 | } |
77 | 77 |
|
@@ -219,14 +219,6 @@ plot_Patlakfit <- function(patlakout, roiname = NULL) { |
219 | 219 | Equilibrium = as.character("Before") |
220 | 220 | ) |
221 | 221 |
|
222 | | - if (is.null(roiname)) { |
223 | | - roiname <- "ROI" |
224 | | - } |
225 | | - |
226 | | - if (roiname != "ROI") { |
227 | | - plotdf <- dplyr::rename(plotdf, !!roiname := ROI_measured) |
228 | | - } |
229 | | - |
230 | 222 | plotdf$Equilibrium <- as.character(plotdf$Equilibrium) |
231 | 223 | plotdf$Equilibrium [ (nrow(plotdf) - (patlakout$tstarIncludedFrames - 1)):nrow(plotdf) ] <- "After" |
232 | 224 |
|
@@ -300,7 +292,7 @@ plot_Patlakfit <- function(patlakout, roiname = NULL) { |
300 | 292 | Patlak_tstar <- function(t_tac, lowroi, medroi, highroi, input, filename = NULL, inpshift = 0, vB = 0, frameStartEnd = NULL, timeStartEnd = NULL, gridbreaks = 2) { |
301 | 293 | # Convert timeStartEnd to frameStartEnd if needed |
302 | 294 | if (is.null(frameStartEnd) && !is.null(timeStartEnd)) { |
303 | | - frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
| 295 | + frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
304 | 296 | tail(which(t_tac <= timeStartEnd[2]), 1)) |
305 | 297 | } |
306 | 298 |
|
|
0 commit comments