weights_create_bids: Create weights from BIDS data

View source: R/kinfitr_weights.R

weights_create_bidsR Documentation

Create weights from BIDS data

Description

This uses the BIDS PET JSON sidecar information and a TAC to create a weights vector.

Usage

weights_create_bids(
  petinfo,
  tac,
  method = 2,
  minweight = 0.7,
  minweight_risetopeak = FALSE,
  weight_checkn = 5
)

Arguments

petinfo

The parsed information from the PET JSON sidecar. This can be extracted simply using jsonlite::fromJSON() on the JSON file, or else at a study level using bids_parse_study()

tac

The time activity curve: preferably for a region with high signal-to-noise ratio.

method

Which method should be used? 1 represents duration^2 / (tac_uncorrected). 2 represents sqrt(durations*tac_uncorrected). 3 represents duration / tac. 4 represents sqrt(durations). 5 represents durations * exp((-ln(2)) / halflife ). 6 represents durations / tac. 7 represents durations.

minweight

The minimum weight. Weights will be calculated as a fraction between this value and 1. A zero frame with duration=0 will be set to 0 though.

minweight_risetopeak

Should there be a linear rise of the minimum weight to the peak weight value? This means that values before the maximum weight can be below the minweight specified. This is helpful for downweighting noisy values towards the start of the TAC. Defaults to FALSE.

weight_checkn

The number of values of the weights to check to make sure that things haven't gone terribly wrong. It will check that this number of weights are all above half of the maximum weight.

Value

A vector of weights.

Author(s)

Granville J Matheson, mathesong@gmail.com

Examples

## Not run: 
bids_weights_create(studydata$petinfo[[1]],tacdata$Neo.cx)

## End(Not run)

mathesong/kinfitr documentation built on Jan. 15, 2024, 11:07 p.m.