/usr/lib/python3/dist-packages/nibabel/info.py is in python3-nibabel 2.2.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | """ Define distrubution parameters for nibabel, including package version
This file contains defines parameters for nibabel that we use to fill settings
in setup.py, the nibabel top-level docstring, and for building the docs. In
setup.py in particular, we exec this file, so it cannot import nibabel.
"""
import re
from distutils.version import StrictVersion
# nibabel version information. An empty _version_extra corresponds to a
# full release. *Any string* in `_version_extra` labels the version as
# pre-release. So, if `_version_extra` is not empty, the version is taken to
# be earlier than the same version where `_version_extra` is empty (see
# `cmp_pkg_version` below).
#
# We usually use `dev` as `_version_extra` to label this as a development
# (pre-release) version.
_version_major = 2
_version_minor = 2
_version_micro = 1
# _version_extra = 'dev'
_version_extra = ''
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
__version__ = "%s.%s.%s%s" % (_version_major,
_version_minor,
_version_micro,
_version_extra)
def _parse_version(version_str):
""" Parse version string `version_str` in our format
"""
match = re.match('([0-9.]*\d)(.*)', version_str)
if match is None:
raise ValueError('Invalid version ' + version_str)
return match.groups()
def _cmp(a, b):
""" Implementation of ``cmp`` for Python 3
"""
return (a > b) - (a < b)
def cmp_pkg_version(version_str, pkg_version_str=__version__):
""" Compare `version_str` to current package version
To be valid, a version must have a numerical major version followed by a
dot, followed by a numerical minor version. It may optionally be followed
by a dot and a numerical micro version, and / or by an "extra" string.
*Any* extra string labels the version as pre-release, so `1.2.0somestring`
compares as prior to (pre-release for) `1.2.0`, where `somestring` can be
any string.
Parameters
----------
version_str : str
Version string to compare to current package version
pkg_version_str : str, optional
Version of our package. Optional, set fom ``__version__`` by default.
Returns
-------
version_cmp : int
1 if `version_str` is a later version than `pkg_version_str`, 0 if
same, -1 if earlier.
Examples
--------
>>> cmp_pkg_version('1.2.1', '1.2.0')
1
>>> cmp_pkg_version('1.2.0dev', '1.2.0')
-1
"""
version, extra = _parse_version(version_str)
pkg_version, pkg_extra = _parse_version(pkg_version_str)
if version != pkg_version:
return _cmp(StrictVersion(version), StrictVersion(pkg_version))
return (0 if extra == pkg_extra
else 1 if extra == ''
else -1 if pkg_extra == ''
else _cmp(extra, pkg_extra))
CLASSIFIERS = ["Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering"]
description = 'Access a multitude of neuroimaging data formats'
# Note: this long_description is the canonical place to edit this text.
# It also appears in README.rst, but it should get there by running
# ``tools/refresh_readme.py`` which pulls in this version.
# We also include this text in the docs by ``..include::`` in
# ``docs/source/index.rst``.
long_description = """
=======
NiBabel
=======
Read / write access to some common neuroimaging file formats
This package provides read +/- write access to some common medical and
neuroimaging file formats, including: ANALYZE_ (plain, SPM99, SPM2 and later),
GIFTI_, NIfTI1_, NIfTI2_, MINC1_, MINC2_, MGH_ and ECAT_ as well as Philips
PAR/REC. We can read and write FreeSurfer_ geometry, annotation and
morphometry files. There is some very limited support for DICOM_. NiBabel is
the successor of PyNIfTI_.
.. _ANALYZE: http://www.grahamwideman.com/gw/brain/analyze/formatdoc.htm
.. _NIfTI1: http://nifti.nimh.nih.gov/nifti-1/
.. _NIfTI2: http://nifti.nimh.nih.gov/nifti-2/
.. _MINC1:
https://en.wikibooks.org/wiki/MINC/Reference/MINC1_File_Format_Reference
.. _MINC2:
https://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_File_Format_Reference
.. _PyNIfTI: http://niftilib.sourceforge.net/pynifti/
.. _GIFTI: https://www.nitrc.org/projects/gifti
.. _MGH: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat
.. _ECAT: http://xmedcon.sourceforge.net/Docs/Ecat
.. _Freesurfer: https://surfer.nmr.mgh.harvard.edu
.. _DICOM: http://medical.nema.org/
The various image format classes give full or selective access to header
(meta) information and access to the image data is made available via NumPy
arrays.
Website
=======
Current documentation on nibabel can always be found at the `NIPY nibabel
website <http://nipy.org/nibabel>`_.
Mailing Lists
=============
Please send any questions or suggestions to the `neuroimaging mailing list
<https://mail.python.org/mailman/listinfo/neuroimaging>`_.
Code
====
Install nibabel with::
pip install nibabel
You may also be interested in:
* the `nibabel code repository`_ on Github;
* documentation_ for all releases and current development tree;
* download the `current release`_ from pypi;
* download `current development version`_ as a zip file;
* downloads of all `available releases`_.
.. _nibabel code repository: https://github.com/nipy/nibabel
.. _Documentation: http://nipy.org/nibabel
.. _current release: https://pypi.python.org/pypi/nibabel
.. _current development version: https://github.com/nipy/nibabel/archive/master.zip
.. _available releases: https://github.com/nipy/nibabel/releases
License
=======
Nibabel is licensed under the terms of the MIT license. Some code included
with nibabel is licensed under the BSD license. Please see the COPYING file
in the nibabel distribution.
Citing nibabel
==============
Please see the `available releases`_ for the release of nibabel that you are
using. Recent releases have a Zenodo_ `Digital Object Identifier`_ badge at
the top of the release notes. Click on the badge for more information.
.. _zenodo: https://zenodo.org
.. _Digital Object Identifier: https://en.wikipedia.org/wiki/Digital_object_identifier
"""
# versions for dependencies. Check these against:
# doc/source/installation.rst
# requirements.txt
# .travis.yml
NUMPY_MIN_VERSION = '1.7.1'
PYDICOM_MIN_VERSION = '0.9.7'
SIX_MIN_VERSION = '1.3'
# Main setup parameters
NAME = 'nibabel'
MAINTAINER = "Matthew Brett, Michael Hanke, Eric Larson, Chris Markiewicz"
MAINTAINER_EMAIL = "neuroimaging@python.org"
DESCRIPTION = description
LONG_DESCRIPTION = long_description
URL = "http://nipy.org/nibabel"
DOWNLOAD_URL = "https://github.com/nipy/nibabel"
LICENSE = "MIT license"
CLASSIFIERS = CLASSIFIERS
AUTHOR = "nibabel developers"
AUTHOR_EMAIL = "neuroimaging@python.org"
PLATFORMS = "OS Independent"
MAJOR = _version_major
MINOR = _version_minor
MICRO = _version_micro
ISRELEASE = _version_extra == ''
VERSION = __version__
PROVIDES = ["nibabel", 'nisext']
REQUIRES = ["numpy (>=%s)" % NUMPY_MIN_VERSION]
|