Fără Descriere

Fabian Peter Hammerle 08c745be75 pipeline: upgrade image of "test-examples" job from ubuntu v18.04 to v20.04 1 an în urmă
.github 08c745be75 pipeline: upgrade image of "test-examples" job from ubuntu v18.04 to v20.04 1 an în urmă
examples 81239d61af build(deps): bump nbconvert from 6.3.0 to 6.5.1 in /examples (#102) 2 ani în urmă
freesurfer_volume_reader 92a5e215d3 disable pylint's similarity checks locally 2 ani în urmă
tests 3ed507d415 pylint: disable irrelevant duplicate code warning in tests 2 ani în urmă
.coveragerc 6b2c883982 coverage: enable branch management 5 ani în urmă
.gitignore a861da9dff gitignore mypy cache 4 ani în urmă
.pylintrc c02a5655a6 pylint: enable various optional checks/extensions 2 ani în urmă
CHANGELOG.md 66bab9a5d5 drop compatibility with python3.6 & pandas<0.23 2 ani în urmă
Pipfile 652866b5ab dev env: re-add typed-ast to fix mypy on python<3.8 2 ani în urmă
Pipfile.lock a44983cba2 build(deps-dev): bump pytest from 7.1.3 to 7.2.0 (#113) 2 ani în urmă
README.rst d7d3f5ae36 pipeline: added format checking with black 3 ani în urmă
mypy.ini 40da0b9972 fixed type hints; added mypy to pipeline 3 ani în urmă
pyproject.toml a69266475c added pyproject.toml to specify build dependencies & build backend 3 ani în urmă
setup.py 425fd8465d test env: add upper version constraint for pandas (to keep compatibility with python3.7) 2 ani în urmă

README.rst

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

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
.. image:: https://github.com/fphammerle/freesurfer-volume-reader/workflows/tests/badge.svg
:target: https://github.com/fphammerle/freesurer-volume-reader/actions
.. 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