Giter Club home page Giter Club logo

freesurfer-volume-reader's Introduction

freesurfer-volume-reader

image

image

image

image

image

image

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

Install

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

Releases follow the semantic versioning scheme.

Usage

Freesurfer

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

or

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

or

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

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

or

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

or

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

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

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

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

freesurfer-volume-reader's People

Contributors

dependabot[bot] avatar fphammerle avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yh2010

freesurfer-volume-reader's Issues

mybinder.org fails to open example notebook

https://mybinder.org/v2/gh/fphammerle/freesurfer-volume-reader/master

ERROR: Complete output from command python setup.py egg_info:                              
ERROR: Traceback (most recent call last):                                                  
  File "", line 1, in                                                      
  File "/tmp/pip-req-build-43n3oihg/setup.py", line 5, in                          
    import freesurfer_volume_reader                                                        
  File "/tmp/pip-req-build-43n3oihg/freesurfer_volume_reader/init.py", l23, in 
    import pandas                                                                                                                               
ModuleNotFoundError: No module named 'pandas'        

Fail gracefully when no volume file was found

Traceback (most recent call last):
File ".../bin/freesurfer-volume-reader", line 11, in
load_entry_point('freesurfer-volume-reader', 'console_scripts', 'freesurfer-volume-reader')()
File ".../freesurfer_volume_reader/main.py", line 59, in main
united_volume_frame = pandas.concat(volume_frames, ignore_index=True, sort=False)
File ".../lib/python3.6/site-packages/pandas/core/reshape/concat.py", line 228, in concat
copy=copy, sort=sort)
File ".../lib/python3.6/site-packages/pandas/core/reshape/concat.py", line 262, in init
raise ValueError('No objects to concatenate')
ValueError: No objects to concatenate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.