Welcome to NeurAL’s documentation!¶
This library is designed to provide easy shortcut methods for processing neuroimaging data with Python. The functions are simply meant as wrappers for different command line programs and simple functions to replace common scripts.
For a more comprehensive analysis library, see the NIPy project: http://nipy.org
This library is written to try to be generic, wrapping multiple neuroimaging packages, although (because of author bias) it’s currently dominated by AFNI functions.
Usage Example:¶
Just a quick example of how you might use it:
import neural as nl
with nl.run_in('data_dir/subject1'):
nl.calc(['dataset.nii.gz','mask.nii.gz'],'a*step(b)',prefix='dataset_masked.nii.gz')
nl.thresh('dataset_masked.nii.gz',p=0.005,prefix='dataset_masked_p0.005.nii.gz')
nl.affine_align('anatomy.nii.gz','TT_N27.nii.gz',skull_strip='anatomy.nii.gz')
nl.affine_apply('dataset_masked_p0.005.nii.gz','anatomy_aff.1D')
General Structure¶
The library contains several groups of functions, organized into several modules. When using the functions, you can pretty much ignore the
module hierchy (just call neural.func()
rather than neural.module.func()
. The modules are primarily there for
conceptual organization and keeping the documentation simple. All of the following modules are imported into the main level,
and don’t need to be referred to in code:
neural.wrappers
, neural.utils
, neural.dsets
, neural.decon
, neural.alignment
,
neural.dicom
, neural.preprocess
, neural.stats
For example, to call the method neural.wrappers.calc()
, you just need to call neural.calc()
Modules:¶
Wrapper Functions¶
Wrappers for simple generic functions can be found in the module neural.wrappers
. Calling these functions will try
to find an analysis package to implement the function (based on the preferences you set).
Useful Utilities¶
Generic, non-imaging specific methods for useful functions are located in neural.utils
. Simple dataset identification and manipulation methods can be found in neural.dsets
.
Simple Analysis¶
Methods to implement simple analyses are organized by topic. Linear and non-linear alignment methods can be found in neural.alignment
. DICOM image manipulation and dataset creation methods are in neural.dicom
. Simple preprocessing and dataset statistic methods are in neural.preprocess
and neural.stats
. Functional connectivity analyses can be found in neural.connectivity
.
Contents¶
- wrappers - Wrappers for generic imaging functions
- utils - Generic helper utilities
- dsets - Simple manipulation of datasets
- decon - Wrapper for AFNI’s 3dDeconvolve program
- alignment - Linear and non-linear analysis methods
- dicom - Functions to interact with DICOM images
- preprocess - Simple preprocessing analyses
- stats - Methods to extract dataset statistics
- eprime - E-Prime logfile parsing
- freesurfer - Methods to run Freesurfer analyses
- connectivity - Methods to help with functional connectivity analyses
- driver - Methods to control the AFNI GUI