Package: brainprint
BrainPrintThis is thebrainprintpython package, a derivative of the originalBrainPrint-legacyscripts,
with the primary goal to provide a Python-only version, to integrate theLaPypackage, and to remove dependencies
on third-party software (shapeDNA-* binaries, gmsh, meshfix). As a result,
some functionality of the original BrainPrint-legacy scripts is no longer
maintained (currently no support of tetrahedral meshes and no support of
cortical parcellations or label files).InstallationUse the following code to install the latest release of LaPy into your local
Python package directory:python3 -m pip install brainprintThis will also install the necessary dependencies, e.g. theLaPypackage. You may need to add your local Python package directory to your $PATH
in order to run the scripts.UsageCommand Line Interface (CLI)Once installed, the package provides abrainprintexecutable which can be run from the command line.ThebrainprintCLI enables per-subject computation of the individual brainprint descriptors. Its usage and options are summarized below;
detailed info is available by calling the script without any arguments from the command line.brainprint--sdir<directory>--sid<SubjectID>[--num<num>][--evec][--skipcortex][--norm<surface|volume|geometry|none>][--reweight][--asymmetry][--outdir<directory>][--help][--more-help]Options:--helpShowthishelpmessageandexit--more-helpShowextensivehelpmessageandexitRequiredoptions:--sid<SubjectID>SubjectID(FreeSurfer-processeddirectoryinsidethesubjectsdirectory)--sdir<directory>FreeSurfersubjectsdirectory

Processingdirectives:--num<num>Numberofeigenvalues/vectorstocompute(default:50)--evecSwitchoneigenvectorcomputation(default:off)--skipcortexSkipcorticalsurfaces(default:off)--norm<surface|volume|geometry|none>Switchoneigenvaluenormalization;willbeeithersurface,volume,ordeterminedbythegeometryoftheobject.Use"none"orleaveoutentirelytoskipnormalization.--reweightSwitchoneigenvaluereweighting(default:off)--asymmetryPerformleft-rightasymmetrycalculation(default:off)--cholmodSwitchonuseof(faster)Choleskydecompositioninsteadof(slower)LUdecomposition(default:off).Mayrequiremanualinstallofscikit-sparsepackage.Outputparameters:--outdir=OUTDIROutputdirectory(default:<sdir>/<sid>/brainprint)--keep-tempWhethertokeepthetemporaryfilesdirectoryornotbydefaultFalsePython Packagebrainprintcan also be run within a pure Python environment, i.e. installed and imported as a Python package. E.g.:>>>frombrainprintimportBrainprint>>>subjects_dir="/path/to/freesurfer/subjects_dir/">>>subject_id="42">>>bp=Brainprint(subjects_dir=subjects_dir,asymmetry=True,keep_eigenvectors=True)>>>results=bp.run(subject_id=subject_id)>>>results{"eigenvalues":PosixPath("/path/to/freesurfer/subjects_dir/subject_id/brainprint/subject_id.brainprint.csv"),"eigenvectors":PosixPath("/path/to/freesurfer/subjects_dir/subject_id/brainprint/eigenvectors"),"distances":PosixPath("/path/to/freesurfer/subjects_dir/subject_id/brainprint/subject_id.brainprint.asymmetry.csv")}OutputThe script will create an output directory that contains a CSV table with
values (in that order) for the area, volume, and first n eigenvalues per each
FreeSurfer structure. An additional output file will be created if the
asymmetry calculation is performed and/or for the eigenvectors (CLI--evecsflag orkeep_eigenvectorson class initialization).ChangesThere are some changes in functionality in comparison to the originalBrainPrintscripts:currently no support for tetrahedral meshescurrently no support for analyses of cortical parcellation or label filesno more Python 2.x compatibilityReferencesIf you use this software for a publication please cite:[1] BrainPrint: a discriminative characterization of brain morphology. Wachinger C, Golland P, Kremen W, Fischl B, Reuter M. Neuroimage. 2015;109:232-48.http://dx.doi.org/10.1016/j.neuroimage.2015.01.032http://www.ncbi.nlm.nih.gov/pubmed/25613439[2] Laplace-Beltrami spectra as 'Shape-DNA' of surfaces and solids. Reuter M, Wolter F-E, Peinecke N Computer-Aided Design. 2006;38:342-366.http://dx.doi.org/10.1016/j.cad.2005.10.011