README.rst 3.3 KB

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