No Description

Fabian Peter Hammerle 4c5670b416 pipeline: disable pandas=1.* build for python3.6 as pandas v1.2.0 dropped support; disable python3.8-dev build to save CI time 3 years ago
.github dccb788293 configure github's dependabot to update Pipfile.lock (dev env) 4 years ago
examples 77c36b7683 build(deps): bump bleach from 3.1.2 to 3.1.4 in /examples 4 years ago
freesurfer_volume_reader 2c9560766b black 4 years ago
tests 5ca2e18dfa fix remaining duplicate-code linter warnings 4 years ago
.coveragerc 6b2c883982 coverage: enable branch management 5 years ago
.gitignore a861da9dff gitignore mypy cache 4 years ago
.pylintrc b7c4b6859d pylint: disable missing-module-docstring selectively 4 years ago
.travis.yml 4c5670b416 pipeline: disable pandas=1.* build for python3.6 as pandas v1.2.0 dropped support; disable python3.8-dev build to save CI time 3 years ago
CHANGELOG.md eeff5aa4c4 release v2.1.0 4 years ago
Pipfile 18b865b897 env: downgrade importlib-metadata to fix pipeline on python3.5 3 years ago
Pipfile.lock bf27caf504 build(deps-dev): bump pytest-cov from 2.10.1 to 2.11.1 3 years ago
README.rst 58d62fc48a readme: added zenodo DOI badge 5 years ago
setup.py b49a4dd57b setup.py: remove unneeded test dependencies 4 years ago

README.rst

freesurfer-volume-reader
========================

.. image:: https://travis-ci.org/fphammerle/freesurfer-volume-reader.svg?branch=master
:target: https://travis-ci.org/fphammerle/freesurfer-volume-reader
.. image:: https://coveralls.io/repos/github/fphammerle/freesurfer-volume-reader/badge.svg?branch=master
:target: https://coveralls.io/github/fphammerle/freesurfer-volume-reader?branch=master
.. image:: https://img.shields.io/pypi/v/freesurfer-volume-reader.svg
:target: https://pypi.org/project/freesurfer-volume-reader/#history
.. image:: https://img.shields.io/pypi/pyversions/freesurfer-volume-reader.svg
:target: https://pypi.org/project/freesurfer-volume-reader/
.. image:: https://zenodo.org/badge/183625692.svg
:target: https://zenodo.org/badge/latestdoi/183625692

Python script & library to read hippocampal subfield volumes computed by
Freesurfer & ASHS

- Freesurfer
https://surfer.nmr.mgh.harvard.edu/fswiki/HippocampalSubfields
- ASHS https://sites.google.com/site/hipposubfields/home

Install
-------

.. code:: sh

pip3 install --user freesurfer-volume-reader
freesurfer-volume-reader --help

Releases follow the `semantic versioning `__
scheme.

Usage
-----

Freesurfer
~~~~~~~~~~

.. code:: sh

export SUBJECTS_DIR=/my/freesurfer/subjects
freesurfer-volume-reader

or

.. code:: sh

freesurfer-volume-reader /my/freesurfer/subjects
freesurfer-volume-reader /my/freesurfer/subjects /other/freesurfer/subjects

or

.. code:: python

from freesurfer_volume_reader import freesurfer

for volume_file in freesurfer.HippocampalSubfieldsVolumeFile.find('/my/freesurfer/subjects'):
print(volume_file.subject, volume_file.hemisphere, volume_file.analysis_id)
print(volume_file.read_volumes_mm3())
print(volume_file.read_volumes_dataframe())

ASHS
~~~~

.. code:: sh

export SUBJECTS_DIR=/my/ashs/subjects
freesurfer-volume-reader --source-types ashs

or

.. code:: sh

freesurfer-volume-reader --source-types ashs -- /my/ashs/subjects
freesurfer-volume-reader --source-types ashs -- /my/ashs/subjects /other/ashs/subjects

or

.. code:: python

from freesurfer_volume_reader import ashs

for volume_file in ashs.HippocampalSubfieldsVolumeFile.find('/my/ashs/subjects'):
print(volume_file.subject, volume_file.hemisphere, volume_file.correction)
print(volume_file.read_volumes_mm3())
print(volume_file.read_volumes_dataframe())

Intracranial Volume
^^^^^^^^^^^^^^^^^^^

.. code:: python

from freesurfer_volume_reader import ashs

for volume_file in ashs.IntracranialVolumeFile.find('/my/ashs/subjects'):
print(volume_file.subject)
print(volume_file.read_volume_mm3())
print(volume_file.read_volume_series())

Freesurfer & ASHS
~~~~~~~~~~~~~~~~~

.. code:: sh

freesurfer-volume-reader --source-types ashs freesurfer-hipposf -- /my/subjects
freesurfer-volume-reader --source-types ashs freesurfer-hipposf -- /my/ashs/subjects /my/freesurfer/subjects /other/subjects

Tests
-----

.. code:: sh

pip3 install --user pipenv
git clone https://github.com/fphammerle/freesurfer-volume-reader.git
cd freesurfer-volume-reader
pipenv run pylint freesurfer_volume_reader
pipenv run pytest