Skip to content

Commit 4ac9821

Browse files
committed
DOC: Address warnings and improve formatting
1 parent b57cf1b commit 4ac9821

File tree

9 files changed

+43
-41
lines changed

9 files changed

+43
-41
lines changed

nibabel/affines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def obliquity(affine):
306306
This implementation is inspired by `AFNI's implementation
307307
<https://github.com/afni/afni/blob/b6a9f7a21c1f3231ff09efbd861f8975ad48e525/src/thd_coords.c#L660-L698>`_.
308308
For further details about *obliquity*, check `AFNI's documentation
309-
<https://sscc.nimh.nih.gov/sscc/dglen/Obliquity>_.
309+
<https://sscc.nimh.nih.gov/sscc/dglen/Obliquity>`_.
310310
311311
Parameters
312312
----------

nibabel/brikhead.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def __init__(self, file_like, header, mmap=True, keep_file_open=None):
250250
a new file handle is created every time the image is accessed.
251251
If ``file_like`` refers to an open file handle, this setting has no
252252
effect. The default value (``None``) will result in the value of
253-
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT` being used.
253+
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT`` being used.
254254
"""
255255
super(AFNIArrayProxy, self).__init__(file_like,
256256
header,
@@ -533,7 +533,7 @@ def from_file_map(klass, file_map, mmap=True, keep_file_open=None):
533533
a new file handle is created every time the image is accessed.
534534
If ``file_like`` refers to an open file handle, this setting has no
535535
effect. The default value (``None``) will result in the value of
536-
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT` being used.
536+
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT`` being used.
537537
"""
538538
with file_map['header'].get_prepare_fileobj('rt') as hdr_fobj:
539539
hdr = klass.header_class.from_fileobj(hdr_fobj)
@@ -553,6 +553,7 @@ def filespec_to_file_map(klass, filespec):
553553
afni.nimh.nih.gov/pub/dist/doc/program_help/README.compression.html.
554554
Thus, if you have AFNI files my_image.HEAD and my_image.BRIK.gz and you
555555
want to load the AFNI BRIK / HEAD pair, you can specify:
556+
556557
* The HEAD filename - e.g., my_image.HEAD
557558
* The BRIK filename w/o compressed extension - e.g., my_image.BRIK
558559
* The full BRIK filename - e.g., my_image.BRIK.gz

nibabel/cifti2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
Cifti2TransformationMatrixVoxelIndicesIJKtoXYZ,
2727
Cifti2Vertices, Cifti2Volume, CIFTI_BRAIN_STRUCTURES,
2828
Cifti2HeaderError, CIFTI_MODEL_TYPES, load, save)
29-
from .cifti2_axes import (Axis, BrainModelAxis, ParcelsAxis, SeriesAxis, LabelAxis, ScalarAxis)
29+
from .cifti2_axes import (Axis, BrainModelAxis, ParcelsAxis, SeriesAxis, LabelAxis, ScalarAxis)

nibabel/cifti2/cifti2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _to_xml_element(self):
172172

173173

174174
class Cifti2LabelTable(xml.XmlSerializable, MutableMapping):
175-
""" CIFTI-2 label table: a sequence of ``Cifti2Label``s
175+
""" CIFTI-2 label table: a sequence of ``Cifti2Label``\s
176176
177177
* Description - Used by NamedMap when IndicesMapToDataType is
178178
"CIFTI_INDEX_TYPE_LABELS" in order to associate names and display colors
@@ -927,8 +927,8 @@ class Cifti2MatrixIndicesMap(xml.XmlSerializable, MutableSequence):
927927
* Text Content: [NA]
928928
* Parent Element - Matrix
929929
930-
Attribute
931-
---------
930+
Attributes
931+
----------
932932
applies_to_matrix_dimension : list of ints
933933
Dimensions of this matrix that follow this mapping
934934
indices_map_to_data_type : str one of CIFTI_MAP_TYPES

nibabel/cifti2/cifti2_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(except for SeriesAxis objects, which have to remain monotonically increasing or decreasing).
2424
2525
Creating new CIFTI-2 axes
26-
-----------------------
26+
-------------------------
2727
New Axis objects can be constructed by providing a description for what is contained
2828
in each row/column of the described tensor. For each Axis sub-class this descriptor is:
2929
@@ -250,7 +250,7 @@ def __init__(self, name, voxel=None, vertex=None, affine=None,
250250
factory methods:
251251
252252
- :py:meth:`~BrainModelAxis.from_mask`: creates surface or volumetric BrainModelAxis axis
253-
from respectively 1D or 3D masks
253+
from respectively 1D or 3D masks
254254
- :py:meth:`~BrainModelAxis.from_surface`: creates a surface BrainModelAxis axis
255255
256256
The resulting BrainModelAxis axes can be concatenated by adding them together.

nibabel/gifti/gifti.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,21 @@ class GiftiCoordSystem(xml.XmlSerializable):
207207
Attributes
208208
----------
209209
dataspace : int
210-
From the spec: "Contains the stereotaxic space of a DataArray's data
210+
From the spec: Contains the stereotaxic space of a DataArray's data
211211
prior to application of the transformation matrix. The stereotaxic
212212
space should be one of:
213-
NIFTI_XFORM_UNKNOWN
214-
NIFTI_XFORM_SCANNER_ANAT
215-
NIFTI_XFORM_ALIGNED_ANAT
216-
NIFTI_XFORM_TALAIRACH
217-
NIFTI_XFORM_MNI_152"
213+
214+
- NIFTI_XFORM_UNKNOWN
215+
- NIFTI_XFORM_SCANNER_ANAT
216+
- NIFTI_XFORM_ALIGNED_ANAT
217+
- NIFTI_XFORM_TALAIRACH
218+
- NIFTI_XFORM_MNI_152
219+
218220
xformspace : int
219221
Spec: "Contains the stereotaxic space of a DataArray's data after
220222
application of the transformation matrix. See the DataSpace element for
221223
a list of stereotaxic spaces."
224+
222225
xform : array-like shape (4, 4)
223226
Affine transformation matrix
224227
"""

nibabel/nifti1.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,18 +1775,18 @@ def __init__(self, dataobj, affine, header=None,
17751775
self._affine2header()
17761776
# Copy docstring
17771777
__init__.__doc__ = analyze.AnalyzeImage.__init__.__doc__ + '''
1778-
Notes
1779-
-----
1780-
1781-
If both a `header` and an `affine` are specified, and the `affine` does
1782-
not match the affine that is in the `header`, the `affine` will be used,
1783-
but the ``sform_code`` and ``qform_code`` fields in the header will be
1784-
re-initialised to their default values. This is performed on the basis
1785-
that, if you are changing the affine, you are likely to be changing the
1786-
space to which the affine is pointing. The :meth:`set_sform` and
1787-
:meth:`set_qform` methods can be used to update the codes after an image
1788-
has been created - see those methods, and the :ref:`manual
1789-
<default-sform-qform-codes>` for more details. '''
1778+
Notes
1779+
-----
1780+
1781+
If both a `header` and an `affine` are specified, and the `affine` does
1782+
not match the affine that is in the `header`, the `affine` will be used,
1783+
but the ``sform_code`` and ``qform_code`` fields in the header will be
1784+
re-initialised to their default values. This is performed on the basis
1785+
that, if you are changing the affine, you are likely to be changing the
1786+
space to which the affine is pointing. The :meth:`set_sform` and
1787+
:meth:`set_qform` methods can be used to update the codes after an image
1788+
has been created - see those methods, and the :ref:`manual
1789+
<default-sform-qform-codes>` for more details. '''
17901790

17911791
def update_header(self):
17921792
''' Harmonize header with image data and affine

nibabel/streamlines/tck.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,18 @@ class TckFile(TractogramFile):
3030
-----
3131
MRtrix (so its file format: TCK) considers streamlines coordinates
3232
to be in world space (RAS+ and mm space). MRtrix refers to that space
33-
as the "real" or "scanner" space [1]_.
33+
as the "real" or "scanner" space [#]_.
3434
35-
Moreover, when streamlines are mapped back to voxel space [2]_, a
35+
Moreover, when streamlines are mapped back to voxel space [#]_, a
3636
streamline point located at an integer coordinate (i,j,k) is considered
3737
to be at the center of the corresponding voxel. This is in contrast with
3838
TRK's internal convention where it would have referred to a corner.
3939
4040
NiBabel's streamlines internal representation follows the same
4141
convention as MRtrix.
4242
43-
References
44-
----------
45-
[1] http://www.nitrc.org/pipermail/mrtrix-discussion/2014-January/000859.html
46-
[2] http://nipy.org/nibabel/coordinate_systems.html#voxel-coordinates-are-in-voxel-space
43+
.. [#] http://www.nitrc.org/pipermail/mrtrix-discussion/2014-January/000859.html
44+
.. [#] http://nipy.org/nibabel/coordinate_systems.html#voxel-coordinates-are-in-voxel-space
4745
"""
4846
# Constants
4947
MAGIC_NUMBER = "mrtrix tracks"

nibabel/streamlines/tractogram.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ class Tractogram(object):
263263
choice as long as you provide the correct `affine_to_rasmm` matrix, at
264264
construction time. When applied to streamlines coordinates, that
265265
transformation matrix should bring the streamlines back to world space
266-
(RAS+ and mm space) [1]_.
266+
(RAS+ and mm space) [#]_.
267267
268-
Moreover, when streamlines are mapped back to voxel space [2]_, a
268+
Moreover, when streamlines are mapped back to voxel space [#]_, a
269269
streamline point located at an integer coordinate (i,j,k) is considered
270270
to be at the center of the corresponding voxel. This is in contrast with
271271
other conventions where it might have referred to a corner.
@@ -292,8 +292,8 @@ class Tractogram(object):
292292
293293
References
294294
----------
295-
[1] http://nipy.org/nibabel/coordinate_systems.html#naming-reference-spaces
296-
[2] http://nipy.org/nibabel/coordinate_systems.html#voxel-coordinates-are-in-voxel-space
295+
.. [#] http://nipy.org/nibabel/coordinate_systems.html#naming-reference-spaces
296+
.. [#] http://nipy.org/nibabel/coordinate_systems.html#voxel-coordinates-are-in-voxel-space
297297
"""
298298
def __init__(self, streamlines=None,
299299
data_per_streamline=None,
@@ -515,9 +515,9 @@ class LazyTractogram(Tractogram):
515515
choice as long as you provide the correct `affine_to_rasmm` matrix, at
516516
construction time. When applied to streamlines coordinates, that
517517
transformation matrix should bring the streamlines back to world space
518-
(RAS+ and mm space) [1]_.
518+
(RAS+ and mm space) [#]_.
519519
520-
Moreover, when streamlines are mapped back to voxel space [2]_, a
520+
Moreover, when streamlines are mapped back to voxel space [#]_, a
521521
streamline point located at an integer coordinate (i,j,k) is considered
522522
to be at the center of the corresponding voxel. This is in contrast with
523523
other conventions where it might have referred to a corner.
@@ -553,8 +553,8 @@ class LazyTractogram(Tractogram):
553553
554554
References
555555
----------
556-
[1] http://nipy.org/nibabel/coordinate_systems.html#naming-reference-spaces
557-
[2] http://nipy.org/nibabel/coordinate_systems.html#voxel-coordinates-are-in-voxel-space
556+
.. [#] http://nipy.org/nibabel/coordinate_systems.html#naming-reference-spaces
557+
.. [#] http://nipy.org/nibabel/coordinate_systems.html#voxel-coordinates-are-in-voxel-space
558558
"""
559559
def __init__(self, streamlines=None,
560560
data_per_streamline=None,

0 commit comments

Comments
 (0)