<commit_before># hippodeep
Brain Hippocampus Segmentation

This program can quickly segment (<30s) the Hippocampus of a brain T1 image, using Deep Convolutional NN.

![screenshot](blink.gif?raw=True)

A more complete description of the process is coming soon (see also manuscript (*under review*))

##Requirement
The program requires an NVIDIA GPU with CUDA capabilities >= 3.0 (most hardware sold since 2012).
It uses NVIDIA's CuDNN library through Theano/Lasagne.

The FSL tools are also required

Optionally, the ANTs warping tools can be used if installed for speed boost.

Tested on Linux CentOS 6.8

##Installation

The code uses the Scipy stack and a recent Theano. It also requires the nibabel library (for nifti loading) and the Lasagne library.

To setup a working CUDA+CuDNN environment, download from NVIDIA and follow installation instruction

To setup a working FSL environment, download from fMRIB.

The simplest way to install the rest from scratch is to use a Anaconda environment, then
* install scipy and Theano >=0.8.2
* nibabel is available on pip (`pip install nibabel`)
* Lasagne should be probably pulled from the github repo


##Usage:
To use the program, simply
Using only FSL tools `deepseg3.sh example_brain_t1.nii.gz`, or Using ANTs tools: `deepseg2.sh example_brain_t1.nii.gz`
(The script can be called with its full path, but the image file must be in current, writtable, directory)

The resulting segmentation should be stored as `example_brain_t1_mask_L.nii.gz` (or R for right).

The volumes values are stored in `example_brain_t1_hippo_vol_LR.txt`<commit_msg>warn that initial compilation takes time<commit_after># hippodeep
Brain Hippocampus Segmentation

This program can quickly segment (<30s) the Hippocampus of a brain T1 image, using Deep Convolutional NN.

![screenshot](blink.gif?raw=True)

A more complete description of the process is coming soon (see also manuscript (*under review*))

##Requirement
The program requires an NVIDIA GPU with CUDA capabilities >= 3.0 (most hardware sold since 2012).
It uses NVIDIA's CuDNN library through Theano/Lasagne.

The FSL tools are also required

Optionally, the ANTs warping tools can be used as alternative to the FSL-flirt call.

Tested on Linux CentOS 6.8

##Installation

The code uses the Scipy stack and a recent Theano. It also requires the nibabel library (for nifti loading) and the Lasagne library.

To setup a working CUDA+CuDNN environment, download from NVIDIA and follow installation instruction

To setup a working FSL environment, download from fMRIB.

The simplest way to install the rest from scratch is to use a Anaconda environment, then
* install scipy and Theano >=0.8.2
* nibabel is available on pip (`pip install nibabel`)
* Lasagne should be probably pulled from the github repo


##Usage:
To use the program, simply
Using only FSL tools `deepseg3.sh example_brain_t1.nii.gz`, or Using ANTs tools: `deepseg2.sh example_brain_t1.nii.gz`. The script can be called with its full path, but the image file must be in current, writable, directory.

The resulting segmentation should be stored as `example_brain_t1_mask_L.nii.gz` (or R for right).

The volumes values are stored in `example_brain_t1_hippo_vol_LR.txt`

Due to Theano CUDA compilation, the first run of the program may take a long time (up to several minutes, depending on your CUDA architecture)

{'fraction_non_alphanumeric': 0.054945054945054944, 'fraction_numerical': 0.01188001188001188, 'mean_word_length': 4.898423817863398, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3413598', 'n_tokens_mistral': 1038, 'n_tokens_neox': 960, 'n_words': 480}