README.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. freesurfer-stats
  2. ================
  3. TODO add badges
  4. Python Library to Read FreeSurfer's cortical parcellation anatomical statistics
  5. Freesurfer https://surfer.nmr.mgh.harvard.edu/
  6. Install
  7. -------
  8. .. code:: sh
  9. pip3 install --user freesurfer-stats
  10. Releases follow the `semantic versioning <https://semver.org/>` scheme.
  11. Usage
  12. -----
  13. .. code:: python
  14. >>> from freesurfer_stats import CorticalParcellationStats
  15. >>> stats = CorticalParcellationStats.read('tests/subjects/fabian/stats/lh.aparc.DKTatlas.stats')
  16. >>> stats.headers['CreationTime'].isoformat()
  17. '2019-05-09T21:05:54+00:00'
  18. >>> stats.headers['cvs_version']
  19. 'Id: mris_anatomical_stats.c,v 1.79 2016/03/14 15:15:34 greve Exp'
  20. >>> stats.headers['cmdline'][:64]
  21. 'mris_anatomical_stats -th3 -mgz -cortex ../label/lh.cortex.label'
  22. >>> stats.hemisphere
  23. 'left'
  24. >>> stats.whole_brain_measurements['estimated_total_intracranial_volume_mm^3']
  25. 1670487.274486
  26. >>> stats.whole_brain_measurements['white_surface_total_area_mm^2']
  27. 98553.0
  28. >>> stats.structure_measurements[['Structure Name', 'Surface Area (mm^2)', 'Gray Matter Volume (mm^3)']].head()
  29. Structure Name Surface Area (mm^2) Gray Matter Volume (mm^3)
  30. 0 caudalanteriorcingulate 1472 4258
  31. 1 caudalmiddlefrontal 3039 8239
  32. 2 cuneus 2597 6722
  33. 3 entorhinal 499 2379
  34. 4 fusiform 3079 9064