README.rst 2.74 KB
Newer Older
1
2
3
4
fslpy
=====


Paul McCarthy's avatar
Badges    
Paul McCarthy committed
5
6
7
8
9
10
.. image:: https://git.fmrib.ox.ac.uk/fsl/fslpy/badges/master/build.svg
   :target: https://git.fmrib.ox.ac.uk/fsl/fslpy/commits/master/

.. image:: https://git.fmrib.ox.ac.uk/fsl/fslpy/badges/master/coverage.svg
   :target: https://git.fmrib.ox.ac.uk/fsl/fslpy/commits/master/

Paul McCarthy's avatar
Paul McCarthy committed
11
.. image:: https://img.shields.io/pypi/v/fslpy.svg
Paul McCarthy's avatar
Paul McCarthy committed
12
   :target: https://pypi.python.org/pypi/fslpy/
Paul McCarthy's avatar
Paul McCarthy committed
13

Paul McCarthy's avatar
Badges    
Paul McCarthy committed
14

15
16
The ``fslpy`` project is a `FSL <http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/>`_
programming library written in Python. It is used by `FSLeyes
Paul McCarthy's avatar
Paul McCarthy committed
17
<https://git.fmrib.ox.ac.uk/fsl/fsleyes/fsleyes/>`_.
18
19


20
21
22
23
24
25
26
27
28
Installation
------------


Install ``fslpy`` and its core dependencies via pip::

    pip install fslpy


29
30
31
32
Dependencies
------------


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
All of the core dependencies of ``fslpy`` are listed in the `requirements.txt
<requirements.txt>`_ file.

Some extra dependencies are listed in `requirements.txt
<requirements-extra.txt>`_ which provide addditional functionality:

 - ``wxPython``: The `fsl.utils.idle <fsl/utils/idle.py>`_ module has
   functionality  to schedule functions on the ``wx`` idle loop.

 - ``indexed_gzip``: The `fsl.data.image.Image <fsl/data/image.py>`_ class
   can use ``indexed_gzip`` to keep large compressed images on disk instead
   of decompressing and loading them into memory..

 - ``trimesh``/``rtree``: The `fsl.data.mesh.TriangleMesh <fsl/data/mesh.py>`_
   class has some methods which use ``trimesh`` to perform geometric queries
   on the mesh.


Paul McCarthy's avatar
Paul McCarthy committed
51
52
If you are using Linux, need to install wxPython first, as binaries are not
available on PyPI. Change the URL for your specific platform::
53

Paul McCarthy's avatar
Paul McCarthy committed
54
    pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk2/ubuntu-16.04/ wxpython
55
56
57
58
59
60
61
62
63
64


The ``rtree`` library also assumes that ``libspatialindex`` is installed on
your system.


Once wxPython has been installed, you can simply type the following to install
the rest of the extra dependencies::

    pip install fslpy[extras]
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91


Documentation
-------------

``fslpy`` is documented using `sphinx <http://http://sphinx-doc.org/>`_. You
can build the API documentation by running::

    python setup.py doc

The HTML documentation will be generated and saved in the ``doc/html/``
directory.


If you are interested in contributing to ``fslpy``, check out the
`contributing guide <doc/contributing.rst>`_.


Tests
-----

Run the test suite via::

    python setup.py test

A test report will be generated at ``report.html``, and a code coverage report
will be generated in ``htmlcov/``.
Paul McCarthy's avatar
Paul McCarthy committed
92
93
94
95
96


Credits
-------

97

Paul McCarthy's avatar
Paul McCarthy committed
98
The `fsl.data.dicom <fsl/data/dicom.py>`_ module is little more than a thin
Paul McCarthy's avatar
Paul McCarthy committed
99
100
wrapper around Chris Rorden's `dcm2niix
<https://github.com/rordenlab/dcm2niix>`_ program.
101
102
103
104


The `example.mgz <tests/testdata/example.mgz>`_ file, used for testing,
originates from the ``nibabel`` test data set.