kinfitr v0.6.0
This is a big release since the last one.
New BIDS Support
With the changes to the PET BIDS specification, I've incorporated those, and now BIDS data is ingested at a study level. There could still be some changes to the specification in the near future, and there could be a few things that need ironed out for strangely structured BIDS data, but it is certainly working for the current spec.
- The main change here is the
bids_parse_study()function, which parses a whole BIDS study
Blooddata changes
With the new BIDS spec, I've also updated the blooddata object to more closely represent it. I've also expanded upon the ability to extract data, and better compartmentalised these functions, as they were becoming impossible to maintain.
- create_blooddata_components is a little simpler, and now returns the new blooddata objects
bd_getdata()andbd_create_input()replacebd_getdata(), for extracting data from blooddata objects.bd_getdata()is for extracting single kinds of measures, and allows extraction of raw data, predicted data, or interpolated predicted databd_create_input()is for extracting input objects for use in kinetic modelling
- For backward compatibility, in case blooddata objects have been saved with a previous version of kinfitr, there is a
update_blooddata()function for updating to the new format. But some aspects of the new functionality are lost, so better to just create the blooddata objects afresh.
Model Updates
There are two new models, and some new functionality
New Models
- SRTM2, which can be fitted as either a 2 or 3-parameter model
- Linearised 2TCM, which can fit vB or ignore it.
Model Updates
- All linearised models can now be specified with the durations. This gives a theoretically more optimal method for integration, which should also be faster. The normal trapezoidal integration method, requiring only the mid time points are also available, and are still the default if durations are not provided.
- The models with double integrals now produce better parameter estimates, as there was an issue with the second integral. This applies to MA2 and lin2tcm.
Delay Fitting
I've been a little bit bothered by delay fitting for a while now, as you can fit it with the TCMs, but if the delay was clearly still wrong, but the rate constants were bending the curve into shape regardless, it could be hard to fix the delay other than playing with trial-and-error. From the Turku PET Tools pages, I saw that they use the linearised 2TCM and perform a grid search. I've pushed this idea into providing a whole RSS profile, so that we can see all the minima, and choose one that makes most sense, even if the model fit is less idea.
kinfitr::lin2tcm_inpshiftProfileprovides a figure with the log sum of weighted RSS, with the top 3 minima highlighted for better selection of the most appropriate inpshift value.
New Data
I've added a new dataset for testing reference region models which can be played with using data(simref). This is simulated data based on the PBR28 blood curves.
Improved Warnings
kinfitr will now warn if fitted parameters are equal to the upper or lower limits for nonlinear models. This is usually a sign either of bad parameter bounds, or of a bad fit. If the parameter estimates seem reasonable, best to alter the bounds. If they seem unreasonable, best to either try altering the starting values, or to try using multstart.
Misc
- Blood models: Tri-exponential model should be working better, and the spline method is now powered by GAMs, which improves its stability.
- Standard errors: More of the models provide SE estimates now, using the delta method to obtain values which take into consideration the relationships between coefficients for the models for which these are calculated from combinations of other outcomes.
- Unit conversion: From having fluffed unit conversions a few too many times, there's now a specified unit conversion function
unit_convert() - Weighting: There's also a method for calculating weights based on several different methods. I like the default best.
weights_create