|
3 | 3 | #' Function to fit the MA1 of Ichise et al (2002) to data. |
4 | 4 | #' |
5 | 5 | #' @param t_tac Numeric vector of times for each frame in minutes. We use the time halfway through the frame as well as a |
6 | | -#' zero. If a time zero frame is not included, it will be added. |
| 6 | +#' zero. If a time zero frame is not included, it will be added. |
7 | 7 | #' @param tac Numeric vector of radioactivity concentrations in the target tissue for each frame. We include zero at time |
8 | 8 | #' zero: if not included, it is added. |
9 | 9 | #' @param input Data frame containing the blood, plasma, and parent fraction concentrations over time. This can be generated |
10 | 10 | #' using the \code{blood_interp} function. |
11 | | -#' @param tstar The t* specification for regression. If tstar_type="frames", |
| 11 | +#' @param tstar The t* specification for regression. If tstar_type="frames", |
12 | 12 | #' this is the number of frames from the end to include (e.g., 10 means last 10 frames). |
13 | | -#' If tstar_type="time", this is the time point (in minutes) after which all frames |
| 13 | +#' If tstar_type="time", this is the time point (in minutes) after which all frames |
14 | 14 | #' with midpoints later than this time are included. This value can be estimated using \code{ma1_tstar}. |
15 | 15 | #' @param tstar_type Either "frames" (default) or "time", specifying how to interpret tstar. |
16 | 16 | #' @param tstarIncludedFrames Deprecated. Use 'tstar' with 'tstar_type="frames"' instead. |
@@ -63,7 +63,7 @@ ma1 <- function(t_tac, tac, input, tstar, weights = NULL, |
63 | 63 |
|
64 | 64 | # Convert timeStartEnd to frameStartEnd if needed |
65 | 65 | if (is.null(frameStartEnd) && !is.null(timeStartEnd)) { |
66 | | - frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
| 66 | + frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
67 | 67 | tail(which(t_tac <= timeStartEnd[2]), 1)) |
68 | 68 | } |
69 | 69 |
|
@@ -317,7 +317,7 @@ plot_ma1fit <- function(ma1out, roiname = NULL) { |
317 | 317 | ma1_tstar <- function(t_tac, lowroi, medroi, highroi, input, filename = NULL, inpshift = 0, vB = 0, frameStartEnd = NULL, timeStartEnd = NULL, gridbreaks = 2) { |
318 | 318 | # Convert timeStartEnd to frameStartEnd if needed |
319 | 319 | if (is.null(frameStartEnd) && !is.null(timeStartEnd)) { |
320 | | - frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
| 320 | + frameStartEnd <- c(which(t_tac >= timeStartEnd[1])[1], |
321 | 321 | tail(which(t_tac <= timeStartEnd[2]), 1)) |
322 | 322 | } |
323 | 323 |
|
|
0 commit comments