<commit_before>.. _index:

======================================
qipipe - Quantitative Imaging pipeline
======================================

********
Synopsis
********
qipipe processes DICOM study images.

:API: http://qipipe.readthedocs.org/en/latest/api/index.html

:Git: https://github.com/ohsu-qin/qipipe


************
Feature List
************
1. Recognizes new study images.

2. Stages images for submission to 
   `The Cancer Imaging Archive`_ (TCIA) `QIN collection`_.

3. Masks images to subtract extraneous image content.

4. Corrects motion artifacts.

5. Performs pharmokinetic modeling.

6. Imports the input scans and processing results into the XNAT_
   image database.


************
Installation
************
The following instructions assume that you start in your home directory.
We recommend the Anaconda_ environment for scientific packages and pip_
for the remaining Python packages. Install ``qipipe`` using the
following procedure:

1. Install and activate a qixnat_ Anaconda_ environment as described in the
   `qixnat Installation Instructions`_.

2. Install the ``qipipe`` dependencies hosted by Anaconda::

       wget -q --no-check-certificate -O \
         - https://www.github.com/ohsu-qin/qipipe/raw/master/requirements_conda.txt \
         | xargs conda install --yes

3. Install the ``qipipe`` package using pip::

       pip install qipipe

4. For ANTS_ registration, build the ants package from source using
   the `ANTS Compile Instructions`_::

       pushd ~/workspace
       git clone git://github.com/stnava/ANTs.git
       mkdir $HOME/ants
       cd $HOME/ants
       ccmake ../workspace/ANTs
       cmake
       #=> Enter “c"
       #=> Enter “g”
       #=> Exit back to the terminal
       make -j 4
       popd

   Then, prepend ANTS to your shell login script. E.g., for Linux or
   Mac OS X, open an editor on ``$HOME/.bashrc`` or ``$HOME/.bash_profile``
   and add the following lines::

       # Prepend ANTS to the path.
       ANTS_HOME=$HOME/ants
       export PATH=$ANTS_HOME/bin

  and refresh your environment::

       . $HOME/.bash_profile
 

*****
Usage
*****
Run the following command for the pipeline options::

    qipipe --help


***********
Development
***********

Download
--------
Download the source by cloning the `source repository`_, e.g.::

    cd ~/workspace
    git clone https://github.com/ohsu-qin/qipipe.git
    cd qipipe

Installing from a local qipipe clone requires the constraints option::

    pip install -c constraints.txt -e .

Testing
-------
Testing is performed with the nose_ package, which can be installed
separately as follows::

    conda install nose

The unit tests are then run as follows::

    nosetests test/unit/

Documentation
-------------
API documentation is built automatically by ReadTheDocs_ when the
project is pushed to GitHub. The modules documented are defined in
``doc/api``. If you add a new Python file to a package directory
*pkg*, then include it in the ``doc/api``\ *pkg* \``.rst`` file.

Documentation can be generated locally as follows:

* Install Sphinx_ and ``docutils``, if necessary::

      conda install Sphinx docutils

* Run the following in the ``doc`` subdirectory::

      make html

Release
-------<commit_msg>Add Read the Docs comment.<commit_after>.. _index:

======================================
qipipe - Quantitative Imaging pipeline
======================================

********
Synopsis
********
qipipe processes DICOM study images.

:API: http://qipipe.readthedocs.org/en/latest/api/index.html

:Git: https://github.com/ohsu-qin/qipipe


************
Feature List
************
1. Recognizes new study images.

2. Stages images for submission to
   `The Cancer Imaging Archive`_ (TCIA) `QIN collection`_.

3. Masks images to subtract extraneous image content.

4. Corrects motion artifacts.

5. Performs pharmokinetic modeling.

6. Imports the input scans and processing results into the XNAT_
   image database.


************
Installation
************
The following instructions assume that you start in your home directory.
We recommend the Anaconda_ environment for scientific packages and pip_
for the remaining Python packages. Install ``qipipe`` using the
following procedure:

1. Install and activate a qixnat_ Anaconda_ environment as described in the
   `qixnat Installation Instructions`_.

2. Install the ``qipipe`` dependencies hosted by Anaconda::

       wget -q --no-check-certificate -O \
         - https://www.github.com/ohsu-qin/qipipe/raw/master/requirements_conda.txt \
         | xargs conda install --yes

3. Install the ``qipipe`` package using pip::

       pip install qipipe

4. For ANTS_ registration, build the ants package from source using
   the `ANTS Compile Instructions`_::

       pushd ~/workspace
       git clone git://github.com/stnava/ANTs.git
       mkdir $HOME/ants
       cd $HOME/ants
       ccmake ../workspace/ANTs
       cmake
       #=> Enter “c"
       #=> Enter “g”
       #=> Exit back to the terminal
       make -j 4
       popd

   Then, prepend ANTS to your shell login script. E.g., for Linux or
   Mac OS X, open an editor on ``$HOME/.bashrc`` or ``$HOME/.bash_profile``
   and add the following lines::

       # Prepend ANTS to the path.
       ANTS_HOME=$HOME/ants
       export PATH=$ANTS_HOME/bin

  and refresh your environment::

       . $HOME/.bash_profile


*****
Usage
*****
Run the following command for the pipeline options::

    qipipe --help


***********
Development
***********

Download
--------
Download the source by cloning the `source repository`_, e.g.::

    cd ~/workspace
    git clone https://github.com/ohsu-qin/qipipe.git
    cd qipipe

Installing from a local qipipe clone requires the constraints option::

    pip install -c constraints.txt -e .

Testing
-------
Testing is performed with the nose_ package, which can be installed
separately as follows::

    conda install nose

The unit tests are then run as follows::

    nosetests test/unit/

Documentation
-------------
API documentation is built automatically by ReadTheDocs_ when the
project is pushed to GitHub. The modules documented are defined in
``doc/api``. If you add a new Python file to a package directory
*pkg*, then include it in the ``doc/api``\ *pkg* \``.rst`` file.

Documentation can be generated locally as follows:

* Install Sphinx_ and ``docutils``, if necessary::

      conda install Sphinx docutils

* Run the following in the ``doc`` subdirectory::

      make html

Read The Docs builds occur in a limited context that sometimes fails
on dependencies, e.g. when an install a requires C extension. In that
case, the project has a ``requirements_read_the_doc.txt`` that
eliminates the problematic dependency and specify the requirements
file in the Read The Docs project Advance Settings.

Release
-------
{'fraction_non_alphanumeric': 0.13391941391941392, 'fraction_numerical': 0.0032234432234432234, 'mean_word_length': 3.1980319803198034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1944226', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1907, 'n_words': 776}