BP_FitMLRadialCompactness {BoneProfileR}R Documentation

Estimation of the likelihood of a bone section

Description

Estimation of the compactness of a bone section using radial model.
If the fitted.parameters and fixed.parameters are NULL and the analysis includes a BP_FitMLCompactness() result, the values of this result is used as a reference for fitted.parameters and fixed.parameters.
If no BP_FitMLCompactness() result is available, it will use:
fitted.parameters=c(P=0.5, S=0.05, Min=-2, Max=5); fixed.parameters=c(K1=1, K2=1).
The reference for radial estimation of compactness is the trigonometric circle for rotation.angle=0 in BP_EstimateCompactness():

Usage

BP_FitMLRadialCompactness(
  bone,
  fitted.parameters = NULL,
  priors = NULL,
  fixed.parameters = NULL,
  analysis = 1,
  silent = FALSE,
  twosteps = TRUE,
  progressbar = FALSE
)

Arguments

bone

The bone image to be used

fitted.parameters

Parameters of the model to be fitted

priors

If twosteps is TRUE, tell what prior should be used.

fixed.parameters

Fixed parameters of the model

analysis

Name or rank of analysis

silent

Should the function displays some information?

twosteps

Should a 2-steps analysis be performed?

progressbar

Should a progress bar be shown?

Details

BP_FitMLRadialCompactness estimates likelihood of model of a bone section

Value

The -Ln L

Author(s)

Marc Girondot marc.girondot@gmail.com

See Also

Other BoneProfileR: BP_AutoFit(), BP_ChooseBackground(), BP_ChooseCenter(), BP_ChooseForeground(), BP_DetectBackground(), BP_DetectCenters(), BP_DetectForeground(), BP_DuplicateAnalysis(), BP_EstimateCompactness(), BP_FitBayesianCompactness(), BP_FitBayesianPeriodicCompactness(), BP_FitMLCompactness(), BP_FitMLPeriodicCompactness(), BP_GetFittedParameters(), BP_ListAnalyses(), BP_LnLCompactness(), BP_OpenImage(), BP_Report(), Erinaceus_europaeus, plot.BoneProfileR(), summary.BoneProfileR()

Examples

## Not run: 
# Not run
library(BoneProfileR)
path_Hedgehog <- system.file("extdata", "Erinaceus_europaeus_fem_2-1_small.png", 
                             package = "BoneProfileR")
 bone <- BP_OpenImage(file=path_Hedgehog)
 # or 
 bone <- BP_OpenImage(ijtiff=TRUE)
 bone <- BP_DetectBackground(bone=bone, analysis="logistic")
 bone <- BP_DetectForeground(bone=bone, analysis="logistic")
 bone <- BP_DetectCenters(bone=bone, analysis="logistic")
 bone <- BP_EstimateCompactness(bone, analysis="logistic")
 bone <- BP_EstimateCompactness(bone, analysis="logistic", cut.angle=30)
 bone <- BP_FitMLCompactness(bone, analysis="logistic")
 plot(bone)
 plot(bone, type="observations")
 plot(bone, type="observations+model", analysis=1)
 fittedpar <- BP_GetFittedParameters(bone, analysis="logistic", 
                                     ML=TRUE, return.all = FALSE)[, "mean"]
 bone <- BP_DuplicateAnalysis(bone, from="logistic", to="flexit")
 bone <- BP_FitMLCompactness(bone, 
                fitted.parameters=c(fittedpar, K1=1.01, K2=1.01), 
                fixed.parameters=NULL, analysis="flexit")
 bone <- BP_FitBayesianCompactness(bone, analysis="flexit")
 mcmc <- RM_get(bone, RMname = "flexit", value="mcmc")
 fittedpar <- as.parameters(mcmc)
 bone <- BP_FitMLCompactness(bone, 
                fitted.parameters=fittedpar, 
                fixed.parameters=NULL, analysis="flexit")
 compare_AIC(Logistic=BP_GetFittedParameters(bone, analysis="logistic", 
                                             ML=TRUE, return.all = TRUE), 
             Flexit=BP_GetFittedParameters(bone, analysis="flexit", 
                                           ML=TRUE, return.all=TRUE))
 out4p <- plot(bone, type="observations+model", analysis="logistic")
 out6p <- plot(bone, type="observations+model", analysis="flexit")
 # The twosteps fit is more acurate but is around 100 times slower
 bone <- BP_FitMLRadialCompactness(bone, analysis="logistic", twosteps=TRUE)
 bone <- BP_FitMLRadialCompactness(bone, analysis="logistic", twosteps=FALSE)
 plot(bone, type="observations", angle=0)
 plot(bone, type="model", analysis="logistic", angle=0)
 plot(bone, type="observations+model", angle=0)
 plot(bone, type="observations+model", angle=pi)
 plot(bone, type="radial", parameter.name=c("P"), analysis="logistic")
 plot(bone, type="radial", parameter.name=c("P", "S"), analysis="logistic")
 plot(bone, type="radial", parameter.name=c("P", "S", "Min", "Max"), analysis="logistic")
 plot(bone, type="radial", parameter.name=c("TRC"), analysis="logistic")
 
 # The observed compactness
 plot(bone, type="radial", parameter.name=c("observed.compactness"), analysis="logistic")
 # The observed compactness weighted by the pixel number
 plot(bone, type="radial", parameter.name="linearized.observed.compactness", analysis="logistic")
 # The integration of the compactness model
 plot(bone, type="radial", parameter.name="modeled.compactness", analysis="logistic")
 # The integration of the compactness model weighted by the pixel number
 plot(bone, type="radial", parameter.name="linearized.modeled.compactness", analysis="logistic")
 
 # Test using the change of orientation using default.angle from BP_EstimateCompactness():
 bone <- BP_DuplicateAnalysis(bone, from="logistic", to="logistic_rotation_pi")
 # With a pi rotation, the top moves to the bottom and the left moves to the right
 bone <- BP_EstimateCompactness(bone, rotation.angle=pi, analysis="logistic_rotation_pi")
 bone <- BP_FitMLRadialCompactness(bone, analysis="logistic_rotation_pi")
 plot(bone, type="radial", parameter.name=c("P", "S"), analysis="logistic")
 plot(bone, type="radial", parameter.name=c("P", "S"), analysis="logistic_rotation_pi")
 BP_Report(bone=bone, 
           analysis=1,
           docx=NULL, 
           pdf=NULL, 
           xlsx=file.path(getwd(), "report.xlsx"), 
           author="Marc Girondot", 
           title=attributes(bone)$name)

## End(Not run)

[Package BoneProfileR version 4.0 Index]