shape mancova:MainPage
From NITRC Wiki
Contents |
Objective
shapeAnalysisMANCOVA presents a unified method for local shape analysis that can accommodate different number of variates and contrasts. It also allows to include any number of associated variables in the statistical analysis of the data. Several cases of study are given to clarify the explanation of the different types of data that can be analyzed and the parameters that can be used to tune the program shapeAnalysisMAN- COVA. This tool has been designed to interact seamlessly with the existing UNC SPHARM-PDM based shape analysis toolbox.
Pipeline overview
Input: Mesh files (*meta ITK format RAW meshes), Vector map files (*txt KWMeshVisu readable files)
All the tools used in the current pipeline are command line executables, as part of UNC-NeuroLib Toolbox.
shapeAnalysisMANCOVA Download
Executables and tutorial dataset
Available on NITRC : http://www.nitrc.org/projects/shape_mancova/
shapeAnalysisMANCOVA is also included in the UNC-NeuroLib Toolbox http://www.ia.unc.edu/dev/
Release source code via svn
Required software/libraries
Download and install shapeAnalysisMANCOVA
- Create and go to a shapeAnalysisMANCOVA/ directory
mkdir shapeAnalysisMANCOVA cd shapeAnalysisMANCOVA
- Download shapeAnalysisMANCOVA (NeuroLib)
- Start the project configuration with ccmake
ccmake ../shapeAnalysisMANCOVA
- Configure the project
Press 'c' to start the configuration, Press "e" to exit help Set "CMAKE_BUILD_TYPE" -> RelWithDebInfo Press "c" to configure, Press "g" to generate the Makefile
- Compile shapeAnalysisMANCOVA
make
CVS source code (within UNC NeuroLib)
Required software/libraries
- Install required software to compile the NeuroLib
- CMake
- BatchMake (v 1.0.8 needed, use cvs access)
- FLTK
- VTK
Download and install the NeuroLib
- Create and go to a NeuroLib/ directory
mkdir NeuroLib cd NeuroLib
- Download the NeuroLib with cvs :
cvs -d :pserver:anonymous@demeter.ia.unc.edu:/cvsroot login (press Enter for password) cvs -d :pserver:anonymous@demeter.ia.unc.edu:/cvsroot co -P NeuroLib
- Create and go to a Neurolib-build/ directory
mkdir NeuroLib-build cd NeuroLib-build
- Start the project configuration with ccmake
ccmake ../NeuroLib
- Configure the project
Press 'c' to start the configuration Set "CMAKE_BUILD_TYPE" -> RelWithDebInfo Set STATNONPARAM at "ON" Press "c" to configure, Press "e" to exit help Set "VTK_DIR" -> Your VTK directory Press "c" to configure, Press "e" to exit help Set "ITK_DIR" -> Your ITK directory Press "c" to configure, Press "e" to exit help Set "FLTK_DIR" -> "your_FLTK-build_path" Set "FLTK_CONFIG_SCRIPT" -> "your_FLTK-build_path"/fltk-config Set "GENERATECLP_DIR" -> Your GenerateCLP build path Press "c" to configure, Press "e" to exit help Set "BOOST_INCLUDE_DIR" -> Your Boost directory Press "c" to configure, Press "e" to exit help Set "BATCHMAKE_DIR" -> "your_BatchMake-build_path" Press "c" to configure, Press "e" to exit help Set "BUILD_SHARED_LIB" -> OFF Press "c" to configure, Press "e" to exit help Press "g" to generate the makefile
- Compile shapeAnalysisMANCOVA
make
Tutorials
LONGITUDINAL STUDIES WITH MANCOVA
shapeAnalysisMANCOVA allows to test for differences between the surfaces of two different time points screenings in case of a same patient. This analytic approach is used first for paired longitudinal comparisons between the baseline measurement and the subsequent follow-up measurements of the same patient. The first step consists in computing statistical features over each subject, using longitudinal information. For any subject-wise study, statistical features can be computed by using MeshMath:
- Absolute distances In these color maps only the magnitude of the shape change is displayed, where green color shows no change from baseline to follow-up and red shows maximum change. The color gets darker as the magnitudes of the distance increase.
- Vectors These maps intent to represent the directionality of the shape changes, displayed by means of vector maps that show the shape differences between the mean shape of the two groups tested.
Example to create Vector and Absolute Distance map features using MeshMath -subtract argument, for each subject:
MeshMath time2_mesh diff_feature.txt -subtract baseline_mesh
- Signed distances In these color maps white color is used where the magnitudes are zero. The color gets darker as the magnitudes of the distance increase. The distance is positive if the mean surface of group A is protruding outside of the mean surface of group B; the distance is negative if the mean surface of group A is shrinking below the mean surface of group B. By default, positive distances are color-coded by blue and negative distances are color-coded by red.
Example to create Signed Distances using MeshMath and -magNormDir, for each subject:
MeshMath baseline_mesh signed_magn.txt -magNormDir diff_feature.txt
Vector files showing longitudinal changes can be input into MANCOVA instead of meshes, by including the flag –KWMinput in the command line. In case of analysis of distance maps (signed and unsigned) StatNonParaTestPDM can be used instead. Once any of those two features are obtained from that analysis, the next step consists in composing files with only raw features on it, the input file will be the same, but instead of containing meshes, it will contain point by point each feature for each point in each subject. That would produce long input subject lines. Thus, if we have M subject meshes and N points per subject meshes, the input file will be…
subjectID(1) groupindex(A) featurepoint(0) featurepoint (1) ... featurepoint(N) subjectID(2) groupindex(A) featurepoint(0) featurepoint (1) ... featurepoint(N) … subjectID(M-1) groupindex(B) featurepoint(0) featurepoint (1) ... featurepoint(N) subjectID(M) groupindex(B) featurepoint(0) featurepoint (1) ... featurepoint(N)
And then, once the input files have been formated according to these guidelines, the last step is to input the right parameters for the program to compute the data needed. In case of distances, whether signed or unsigned, the input arguments for StatsNonParamTestPDM will be:
- featgroupID X will specify the column that denotes the group indexes. It is cero based, in this case would be 1. - featSelStart X will specify where your feature points start (in this case 2) - featSellen X, where X is the number of points to process (in this case N) - log parameter will be required in case of Absolute (unsigned) Distances
Example of StatNonParamTestPDM command line for Absolute Distances:
StatNonParamTestPDM All_NOTsigned_magn.txt -featgroupID 0 -featSelStart 1 -featSelLen 1002 -numPerms 20000 -log -signLevel 0.1 -signSteps 1000 -v
Example of StatNonParamTestPDM command line for Signed Distances:
StatNonParamTestPDM All_signed_magn.txt -featgroupID 0 -featSelStart 1 -featSelLen 1002 -numPerms 20000 -signLevel 0.1 -signSteps 1000 -v
Visualization of the results obtained from the aforementioned tests provide three kinds of information at a specific location on the surface:
- Average magnitude and direction of the shape changes between longitudinal groups: Similarly to signed distance maps, white color is used where the magnitudes are zero. The distance is positive if the mean surface of group A is protruding outside of the mean surface of group B ; the distance is negative if the mean surface of group A is shrinking below the mean surface of group B. Positive distances are color-coded by blue and negative distances are color-coded by red.
- Directionality of the shape changes: Displayed by means of vector maps that show the shape differences between the mean shape of the two groups tested.
- Significance maps: Showing the areas in where the shape changes were considered to be statistically significant. The p-values are color-coded showing blue where the raw p-value exceeds 0.05, that is to say the change for that point is not significant regardless the magnitude of it, and red in those points where the changes are significant.
STUDIES USING shapeAnalysisMANCOVA_Wizard
shapeAnalysisMANCOVA is the computing core of the Wizard. A graphic interface is available in the SPHARM-PDM distribution : shapeAnalysisMANCOVA_Wizard. Thus you can load/create an input file and choose all your study parameters in a very intuitive way.
In the section Docs/ Documentation , you can find a tutorial to help you to understand how this Wizard works. In Docs/data, there are the data usefull to follow the tutorial
Output file description for ShapeAnalysisMANCOVA
Text files
customLut_DiffMagnitude.txt customLut_FDRP.txt customLut_RawP.txt : Every LUT (stands for Look Up Table) are loadable color maps for Slicer3. They are used to create the MRML file with the statistical results, and they have no practical use by themselves.
distances_scaled.txtThis file is also used by Slicer3 to create the MRML scenes. Since Slicer3 only display linear color maps with values from 0 to 100, this file contains the distances normalized to that range.
commandline.txt: include the command line used to get those results.
DiffMagnitude.txt this file contains the absolute distance maps obtained from the subtraction of the two mean shapes from the group tested.
diffMesh.txt : includes the difference vectors obtained from the subtraction of two mean shapes from the groups tested.
mancovaBonferroniP.txt : includes the p-values after Bonferroni correction. Bonferroni correction (FDR) threshold is calculated first, and then the raw p-values are scaled considering that the Bonferroni threshold is now at the given significance level.
mancovaFDRP.txt: includes the p-values after correction for false discovery. False Discovery Rate (FDR) threshold is calculated first, and then the raw p-values are scaled considering that the FDR threshold is now at the given significance level.
mancovaRawP.txt : includes the raw p-values or associated statistical significance for each point for the test performed.
normDistance.txt: includes the magnitude of the difference vectors.
normProjections.txt: includes the magnitude of the projection of the previously described difference vectors to its correspondent normal vector in the mean population surface. The magnitude of this projection is a measure of shape variation that can be useful in the analysis.
Spearman.txt : includes a collection of files are generated when the right argument (‘–
simpleCorrs’) is used in an Interaction Test. Those files will include raw P values maps, corrected FDR maps, Bonferroni corrected P values maps, and the Spearman correlation coefficients maps for a population of shapes correlated with a certain independent variable. The correlation is calculated for both normDistProjections shape scalar maps and normProjections shape scalar maps.
Pearson.txt includes a collection of files are generated correlation is used an Interaction Test. In the same way than the one described for Spearman correlation, the files will contain raw P values maps, corrected FDR maps, Bonferroni corrected P values maps, and the Pearson correlation coefficients maps for a population of shapes correlated with a certain independent variable. The correlation is calculated for both normDistances shape scalar maps and normProjections shape scalar maps. Both Pearson and Spearman correlation related files are always computed.
Mesh files
meanAll uncorrected.meta : is calculated only in case of Interaction Tests, and it contains the overall mean shape corrected using the values of the indicated independent variables.
meanA.metaandmeanB.meta: contain mean shape of each one of the two groups being tested.
GLM corrected meanAll.meta : includes the overall population mean shape with GLM correction.
Complementary Resources
Up-to-date Documentation
We are under review in Insight Journal: http://www.insight-journal.org/browse/publication/694








