This works best with anaconda python
conda
numpy
scipy
matplotlib
bs4
svg.path
vtk
nibabel
pandas
shapeio
curvematch
To install the dependencies, do
pip install numpy scipy matplotlib bs4 svg.path pandas nibabel
conda install vtk -y
pip install git+https://github.com/bmapdev/shapeio git+https://github.com/bmapdev/curvematch
pip install git+https://github.com/bmapdev/ccshape.git
For offline plotting on macos, you will have to add a backend for matplotlib
On the terminal do
echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc
To get help, type:
corpus_callosum_analyze.py -h
The corpus callosum shape analysis can be run in two different ways.
-
Calculate thickness
Assumingtoplist.txt
andbotlist.txt
contain the paths to the top and bottom curves, andsubjid.txt
contains the list of unique subject identifiers, the below command will match the top and bottom curves, compute callosal thickness and save them in the directoryccout
.
corpus_callosum_analyze.py subjid.txt toplist.txt botlist.txt -odir ccout
-
Registration to a template
Assumingtoplist.txt
andbotlist.txt
contain the paths to the top and bottom curves, andsubjid.txt
contains the list of unique subject identifiers, the below command will register the top and bottom curves to the top and bottom curves of a template, and save the warped outputs in the directoryccout_register
.
corpus_callosum_analyze.py subjid.txt toplist.txt botlist.txt -template curve_template -odir ~/Desktop/ccout_register