This package will extract the functional PCs based on the skeletonized FA images from TBSS-ENIGMA pipeline.
(https://www.biorxiv.org/content/10.1101/2020.05.23.112409v2.full)
It will create the functional PC basis based on the ExampleTrainData and project the ExampleTest Data to the PC basis.

Prerequiste package for this FPCA: 
FSL, python/2.7.12, R/3.6.0

Main scripts:
Main.sh

Additional scripts:
Function files: Extract.py, PC.r, Project.r

Input data example (skeletonized FA from TBSS-ENIGMA, split into training and test):
included in ExampleTrainData,ExampleTestData

Template required:
Skeleton Mask, JHU-WhiteMatter-labels-1mm.nii.gz, labels.txt 

Please run main.sh and The output files of the example input will include:

1). PC scores of training dataset:
DTI-ENIGMA-FPCA/out/Train_FA/PCs_*_*.txt

2). PC scores on test dataset:
DTI-ENIGMA-FPCA/out/Test_FA/PCs_*_*.txt

3). PC basis from training dataset:
DTI-ENIGMA-FPCA/out/Train_FA/Eigv_*_*.txt

For more details please check the main.sh
