README.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. freesurfer-volume-reader
  2. ========================
  3. .. image:: https://travis-ci.org/fphammerle/freesurfer-volume-reader.svg?branch=master
  4. :target: https://travis-ci.org/fphammerle/freesurfer-volume-reader
  5. .. image:: https://coveralls.io/repos/github/fphammerle/freesurfer-volume-reader/badge.svg?branch=master
  6. :target: https://coveralls.io/github/fphammerle/freesurfer-volume-reader?branch=master
  7. .. image:: https://img.shields.io/pypi/v/freesurfer-volume-reader.svg
  8. :target: https://pypi.org/project/freesurfer-volume-reader/#history
  9. .. image:: https://img.shields.io/pypi/pyversions/freesurfer-volume-reader.svg
  10. :target: https://pypi.org/project/freesurfer-volume-reader/
  11. .. image:: https://zenodo.org/badge/183625692.svg
  12. :target: https://zenodo.org/badge/latestdoi/183625692
  13. Python script & library to read hippocampal subfield volumes computed by
  14. Freesurfer & ASHS
  15. - Freesurfer
  16. https://surfer.nmr.mgh.harvard.edu/fswiki/HippocampalSubfields
  17. - ASHS https://sites.google.com/site/hipposubfields/home
  18. Install
  19. -------
  20. .. code:: sh
  21. pip3 install --user freesurfer-volume-reader
  22. freesurfer-volume-reader --help
  23. Releases follow the `semantic versioning <https://semver.org/>`__
  24. scheme.
  25. Usage
  26. -----
  27. Freesurfer
  28. ~~~~~~~~~~
  29. .. code:: sh
  30. export SUBJECTS_DIR=/my/freesurfer/subjects
  31. freesurfer-volume-reader
  32. or
  33. .. code:: sh
  34. freesurfer-volume-reader /my/freesurfer/subjects
  35. freesurfer-volume-reader /my/freesurfer/subjects /other/freesurfer/subjects
  36. or
  37. .. code:: python
  38. from freesurfer_volume_reader import freesurfer
  39. for volume_file in freesurfer.HippocampalSubfieldsVolumeFile.find('/my/freesurfer/subjects'):
  40. print(volume_file.subject, volume_file.hemisphere, volume_file.analysis_id)
  41. print(volume_file.read_volumes_mm3())
  42. print(volume_file.read_volumes_dataframe())
  43. ASHS
  44. ~~~~
  45. .. code:: sh
  46. export SUBJECTS_DIR=/my/ashs/subjects
  47. freesurfer-volume-reader --source-types ashs
  48. or
  49. .. code:: sh
  50. freesurfer-volume-reader --source-types ashs -- /my/ashs/subjects
  51. freesurfer-volume-reader --source-types ashs -- /my/ashs/subjects /other/ashs/subjects
  52. or
  53. .. code:: python
  54. from freesurfer_volume_reader import ashs
  55. for volume_file in ashs.HippocampalSubfieldsVolumeFile.find('/my/ashs/subjects'):
  56. print(volume_file.subject, volume_file.hemisphere, volume_file.correction)
  57. print(volume_file.read_volumes_mm3())
  58. print(volume_file.read_volumes_dataframe())
  59. Intracranial Volume
  60. ^^^^^^^^^^^^^^^^^^^
  61. .. code:: python
  62. from freesurfer_volume_reader import ashs
  63. for volume_file in ashs.IntracranialVolumeFile.find('/my/ashs/subjects'):
  64. print(volume_file.subject)
  65. print(volume_file.read_volume_mm3())
  66. print(volume_file.read_volume_series())
  67. Freesurfer & ASHS
  68. ~~~~~~~~~~~~~~~~~
  69. .. code:: sh
  70. freesurfer-volume-reader --source-types ashs freesurfer-hipposf -- /my/subjects
  71. freesurfer-volume-reader --source-types ashs freesurfer-hipposf -- /my/ashs/subjects /my/freesurfer/subjects /other/subjects
  72. Tests
  73. -----
  74. .. code:: sh
  75. pip3 install --user pipenv
  76. git clone https://github.com/fphammerle/freesurfer-volume-reader.git
  77. cd freesurfer-volume-reader
  78. pipenv run pylint freesurfer_volume_reader
  79. pipenv run pytest