if (FALSE) {
# Not run:
library(BoneProfileR)
bone <- BP_OpenImage()
# or, to use the package imager to open a tiff image
bone <- BP_OpenImage(ijtiff=TRUE)
library(BoneProfileR)
path_Hedgehog <- system.file("extdata", "Erinaceus_europaeus_fem_2-1_small.png",
package = "BoneProfileR")
bone <- BP_OpenImage(file=path_Hedgehog)
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")
plot(bone, type="mineralized", show.grid=FALSE)
plot(bone, type="unmineralized", show.grid=FALSE)
plot(bone, type="section", show.grid=FALSE)
bone <- BP_FitMLCompactness(bone, analysis="logistic", twosteps=TRUE)
BP_GetFittedParameters(bone)
plot(bone)
plot(bone, type="observations")
plot(bone, type="observations+model", analysis=1)
bone <- BP_DuplicateAnalysis(bone, from="logistic", to="flexit")
fittedpar <- BP_GetFittedParameters(bone, analysis="logistic")
bone <- BP_DuplicateAnalysis(bone, from="logistic", to="flexit")
BP_ListAnalyses(bone)
bone <- BP_FitMLCompactness(bone,
fitted.parameters=c(fittedpar, K1=1, K2=1),
fixed.parameters=NULL, analysis="flexit", twosteps=TRUE)
compare_AIC(Logistic=BP_GetFittedParameters(bone, analysis="logistic", alloptim=TRUE),
Flexit=BP_GetFittedParameters(bone, analysis="flexit", alloptim=TRUE))
out4p <- plot(bone, type="observations+model", analysis="logistic")
out6p <- plot(bone, type="observations+model", analysis="flexit")
}
Run the code above in your browser using DataLab