Reconstruct Left Pelvis curves from Right curves

PelR2L(data, ofs, flipped = F)

Arguments

data

dataframe with columns curve_id, side, 0,1,...,100, and whatever is specified by the ofs argument.

ofs

the column name (quoted) of data which specifies the time point of opposite foot strike.

flipped

logical. If TRUE the Right curves are flipped about the 0 degree axis. This is needed when reconstructing the coronal and transverse plane pelvis curves, but not for the saggital curves.

Value

same as data but the right curves are reconstructed to look like the left curves.

Details

Since there is only 1 pelvis for each person, the information conveyed by the left and right curve should be the same. However, the left and right curves do not typically look the same. Therefore, it might be useful to homogenize them so we are only looking at 1 set of patterns. PelR2L reconstruct the left curves from the right curves. It basically cuts out the second part of the curve, from the time of opposite (left) foot strike to the end of the gait cycle (t=100), and paste it before the original beginning of the curve (t=0:t[opposite foot off]). For the coronal and transverse plane, the whole curve can be flipped vertically about the 0 axis. i.e. multiplied by -1.

Examples

## make some fake opposite foot strike time point kinematics$ofs=sample(58:62,nrow(kinematics),replace=T) homogenized=PelR2L(subset(kinematics,joint=="Pel"&plane=="sag"),"ofs")
#> Joining, by = "curve_id"
matplot(t(homogenized%>%select(`0`:`100`)),type="l",lty=1,col=ifelse(temp$side=="R","blue","red"))
#> Error in ifelse(temp$side == "R", "blue", "red"): object 'temp' not found
matplot(t(subset(kinematics,joint=="Pel"&plane=="sag")%>%select(`0`:`100`)),type="l",lty=1,col=ifelse(temp$side=="R","blue","red"))
#> Error in ifelse(temp$side == "R", "blue", "red"): object 'temp' not found
PelR2L(subset(kinematics,joint=="Pel"&plane=="cor"),"ofs",flipped=TRUE)
#> Error in vars(`0`:`100`): could not find function "vars"