# \donttest{
#calculation of csg parameter on a human femur cross section
data(HomFem38023)
meshes<-morphomapSegm(HomFem38023, param1=4)
perMesh<-meshes$external
endMesh<-meshes$internal
mech_length<-380.23
rawSections<-morphomapCore(out.sur=perMesh,
inn.sur=endMesh,num.sect=61,mech.len = mech_length,
start = 0.2,end=0.8)
shapeSections<-morphomapShape(rawSections,250,sects_vector=NULL,cent.out="CCA",
delta=0.1, side="left")
csgSect31<-morphomapCSG(cp = shapeSections$`2D_out`[,,31],
mp=shapeSections$`2D_inn`[,,31],
translate = FALSE,center="CCA")
#Cross sectional geometry along the entire femur bone
results<-matrix(NA,ncol=24,nrow=61)
rownames(results)<-paste("section",c(1:61))
colnames(results)<-c("Cx","Cy","T_area","M_area","CA",
"Ext_perim","Med_perim","Mean_thick","Sd_thick" ,
"Min_thick","Max_thick","Ix","Iy","Zx" ,"Zy","Zpol" ,
"dx","dy","Imin","Imax","J","Zmax","Zmin","theta")
for(i in 1:61){
results[i,]<-unlist(morphomapCSG(cp = shapeSections$`2D_out`[,,i],
mp=shapeSections$`2D_inn`[,,i],
translate = FALSE,center="CCA",delta = 0.5))
}
plot(c(1:61),results[,24],type="b",main="Theta",cex=1,
xlab="section",ylab="radians")
#calculation of csg parameter on a chimpanzee femur cross section
data(PanFem27713)
meshes<-morphomapSegm(PanFem27713, param1=3)
perMesh<-meshes$external
endMesh<-meshes$internal
mech_length<-277.13
rawSections<-morphomapCore(out.sur=perMesh,
inn.sur=endMesh,num.sect=61,mech.len = mech_length,
start = 0.2,end=0.8)
shapeSections<-morphomapShape(rawSections,250,sects_vector=NULL,cent.out="CCA",
delta=0.1, side="left")
csgSect31<-morphomapCSG(cp = shapeSections$`2D_out`[,,31],
mp=shapeSections$`2D_inn`[,,31],
translate = FALSE,center="CCA")
#Cross sectional geometry along the entire femur bone
results<-matrix(NA,ncol=24,nrow=61)
rownames(results)<-paste("section",c(1:61))
colnames(results)<-c("Cx","Cy","T_area","M_area","CA",
"Ext_perim","Med_perim","Mean_thick","Sd_thick" ,
"Min_thick","Max_thick","Ix","Iy","Zx" ,"Zy","Zpol" ,
"dx","dy","Imin","Imax","J","Zmax","Zmin","theta")
for(i in 1:61){
results[i,]<-unlist(morphomapCSG(cp = shapeSections$`2D_out`[,,i],
mp=shapeSections$`2D_inn`[,,i],
translate = FALSE,center="CCA",delta = 0.5))
}
plot(c(1:61),results[,24],type="b",main="Theta",cex=1,
xlab="section",ylab="radians")
# }
Run the code above in your browser using DataLab