# Partial correlation

Hello SlicerSALT Team,

As far as partial correlation can not be done with shapeAnalysisMANCOVA, do you know I could perform it? I thought I could use the distance at each vertex between my patients’ shapes and the mean shape (I used the option “Use mean as Template”) and do the statistical analyses with another software (like R) but I did not find where theses distances were written and I think it will be difficult to get shape illustrations afterwards… I found a paper in which the authors did a partial correlation (https://www.sciencedirect.com/science/article/pii/S0967586819307441) but they did not tell how they did it and I assume there are other papers and this kind of analysis has been done several times… Could you help me please?

Wish you a pleasant day,
Quentin

Hi Question
I don’t think the Yoo et al paper did partial correlations, rather (if I am reading the paper correctly) they did straightforward Pearson correlation with the local signed magnitude difference to the average object shape.

MeshMath operations can provide you with that information (you will need to use the terminal though for doing this). If you run MeshMath -help then it will give you a breakdown of all the tasks it can do.

Computing a mean surface with MeshMath:
MeshMath mesh1.vtk outputAverageMesh.vtk -avgMesh mesh2.vtk mesh3.vtk ….

Difference vector between meshes mesh1 - mesh2:
MeshMath mesh1.vtk output_DiffVector.txt -subtract mesh2.vtk

Signed difference magnitude (sign is relative to reference mesh):
MeshMath referenceMesh.vtk output_SignedDistanceMagnitude.txt -magDir output_DiffVector.txt

You can alternatively compute the normal projection of that signed difference (this would mean you are only looking at the part of the difference that goes along the surface normal of your reference mesh)"
MeshMath referenceMesh.vtk output_SignedDistanceNormMagnitude.txt -magNormDir output_DiffVector.txt

I am not 100% sure which of the these 2 differences were used in the Yoo paper, but I think it refers to the “magNormDir” distance

Finally, shapeAnalysisMANCOVA will not yield partial correlations and I am not sure how you can straightforwardly do so.

Hi Martin,

Thank you for your reply. I have computed magNormDir distances using the process you told me. However, some points have really high values (-101507 for example). Is it possible? If yes, what is the unit of these values? I guess it’s not in millimeter.

Thank you again for your help,
Wish you a nice day,

Quentin

mm, that’s strange. Values should be in mm. Which surfaces did you use (I assume the procalign.vtk surfaces)? Did you inspect your generated surfaces to ensure that they all look fine and are appropriately shaped (you can use ShapePopulationViewer in SlicerSALT to efficiently look at lots of surfaces at the same time)?
Martin

Martin,

Thank you for your reply. These values were due to a conversion problem in Excel. Everything is okay now and I managed to perform partial correlations in R using the method you described above.

Quentin