Skip to content
Snippets Groups Projects
Commit 6d912c17 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

DOC: Fixes and tweaks

parent c0156439
No related branches found
No related tags found
No related merge requests found
...@@ -456,7 +456,7 @@ class CoefficientField(NonLinearTransform): ...@@ -456,7 +456,7 @@ class CoefficientField(NonLinearTransform):
:arg premat: If ``True``, the inverse :meth:`srcToRefMat` is applied :arg premat: If ``True``, the inverse :meth:`srcToRefMat` is applied
to the coordinates after the displacements have been to the coordinates after the displacements have been
addd. added.
:returns: ``coords``, transformed into the source image space :returns: ``coords``, transformed into the source image space
""" """
...@@ -465,7 +465,7 @@ class CoefficientField(NonLinearTransform): ...@@ -465,7 +465,7 @@ class CoefficientField(NonLinearTransform):
def displacements(self, coords): def displacements(self, coords):
"""Calculate the relative displacemenets for the given coordinates. """Calculate the relative displacements for the given coordinates.
:arg coords: ``(N, 3)`` array of reference image voxel coordinates. :arg coords: ``(N, 3)`` array of reference image voxel coordinates.
:return: A ``(N, 3)`` array of relative displacements to the :return: A ``(N, 3)`` array of relative displacements to the
......
...@@ -88,18 +88,18 @@ shape, dimensions, and voxel-to-world affine transformation. ...@@ -88,18 +88,18 @@ shape, dimensions, and voxel-to-world affine transformation.
Groups of type *space* have the following fields: Groups of type *space* have the following fields:
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| **Name** | **Type** | **Value/Description** | | **Name** | **Type** | **Value/Description** |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Type`` | attribute | ``'image'`` | | ``Type`` | attribute | ``'image'`` |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Size`` | attribute | ``uint64`` ``(X, Y, Z)`` voxel dimensions | | ``Size`` | attribute | ``uint64`` ``(X, Y, Z)`` voxel dimensions |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Scales`` | attribute | ``float64`` ``(X, Y, Z)`` voxel pixdims | | ``Scales`` | attribute | ``float64`` ``(X, Y, Z)`` voxel pixdims |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Mapping`` | affine | The image voxel-to-world transformation (its | | ``Mapping/`` | affine | The image voxel-to-world transformation (its |
| | | ``sform``) | | | | ``sform``) |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
*deformation* *deformation*
...@@ -131,19 +131,19 @@ coordinate system. ...@@ -131,19 +131,19 @@ coordinate system.
Groups of type *deformation* have the following fields: Groups of type *deformation* have the following fields:
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| **Name** | **Type** | **Value/Description** | | **Name** | **Type** | **Value/Description** |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Type`` | attribute | ``'deformation'`` | | ``Type`` | attribute | ``'deformation'`` |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``SubType`` | attribute | ``'absolute'`` or ``'relative'``. | | ``SubType`` | attribute | ``'absolute'`` or ``'relative'``. |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Matrix`` | dataset | The deformation field - a ``float64`` array of | | ``Matrix`` | dataset | The deformation field - a ``float64`` array of |
| | | shape ``(X, Y, Z, 3)`` | | | | shape ``(X, Y, Z, 3)`` |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
| ``Mapping`` | affine | The field voxel-to-world transformation (its | | ``Mapping/`` | affine | The field voxel-to-world transformation (its |
| | | ``sform``) | | | | ``sform``) |
+-------------+-----------+---------------------------------------------------+ +--------------+-----------+--------------------------------------------------+
Linear X5 files Linear X5 files
...@@ -204,7 +204,7 @@ between FLIRT-style matrices and X5 style matrices. ...@@ -204,7 +204,7 @@ between FLIRT-style matrices and X5 style matrices.
.. [*] For a given image, FSL coordinates are voxel coordinates scaled by the .. [*] For a given image, FSL coordinates are voxel coordinates scaled by the
``pixdim`` values in the NIFTI header, and an inversion along the X ``pixdim`` values in the NIFTI header, with an inversion along the X
axis if the voxel-to-world affine (the ``sform``) has a positive axis if the voxel-to-world affine (the ``sform``) has a positive
determinant. determinant.
...@@ -269,9 +269,9 @@ Storage of FSL FNIRT warp fields in non-linear X5 files ...@@ -269,9 +269,9 @@ Storage of FSL FNIRT warp fields in non-linear X5 files
------------------------------------------------------- -------------------------------------------------------
FLIRT outputs the result of a non-linear registration from a source image to a FLIRT outputs the result of a non-linear registration between a source image
reference image as either a warp field, or a coefficient field which can be and a reference image as either a warp field, or a coefficient field which can
used to generate a warp field. A warp field is defined in terms of the be used to generate a warp field. A warp field is defined in terms of the
reference image - the warp field has the same shape and FOV as the reference reference image - the warp field has the same shape and FOV as the reference
image, and contains either: image, and contains either:
...@@ -316,6 +316,7 @@ to source image world coordinates. ...@@ -316,6 +316,7 @@ to source image world coordinates.
The :mod:`fsl.transform.fnirt` module contains functions which can be used to The :mod:`fsl.transform.fnirt` module contains functions which can be used to
perform all of the conversions and adjustments required to store FNIRT perform all of the conversions and adjustments required to store FNIRT
transformations as X5 files. transformations as X5 files.
""" """
...@@ -341,11 +342,11 @@ class X5Error(Exception): ...@@ -341,11 +342,11 @@ class X5Error(Exception):
def inferType(fname): def inferType(fname):
"""Return the type of the given X5 file - either ``'linear'``or """Return the type of the given X5 file - either ``'linear'`` or
``'nonlinear'``. ``'nonlinear'``.
:arg fname: Name of a X5 file :arg fname: Name of a X5 file
:returns: ``'linear'``or ``'nonlinear'`` :returns: ``'linear'`` or ``'nonlinear'``
""" """
with h5py.File(fname, 'r') as f: with h5py.File(fname, 'r') as f:
...@@ -405,7 +406,7 @@ def readNonLinearX5(fname): ...@@ -405,7 +406,7 @@ def readNonLinearX5(fname):
"""Read a nonlinear X5 transformation file from ``fname``. """Read a nonlinear X5 transformation file from ``fname``.
:arg fname: File name to read from :arg fname: File name to read from
:returns: A :class:`.DisplacementField` or :class:`.CoefficientField` :returns: A :class:`.DeformationField`
""" """
with h5py.File(fname, 'r') as f: with h5py.File(fname, 'r') as f:
...@@ -432,7 +433,7 @@ def writeNonLinearX5(fname, field): ...@@ -432,7 +433,7 @@ def writeNonLinearX5(fname, field):
"""Write a nonlinear X5 transformation to ``fname``. """Write a nonlinear X5 transformation to ``fname``.
:arg fname: File name to write to :arg fname: File name to write to
:arg field: A :class:`.DisplacementField` or :class:`.CoefficientField` :arg field: A :class:`.DeformationField`
""" """
with h5py.File(fname, 'w') as f: with h5py.File(fname, 'w') as f:
......
...@@ -448,7 +448,7 @@ class _FileOrThing(object): ...@@ -448,7 +448,7 @@ class _FileOrThing(object):
``dict``-like object, where the function's actual return value is ``dict``-like object, where the function's actual return value is
accessible via an attribute called ``output``. All output arguments with a accessible via an attribute called ``output``. All output arguments with a
value of ``LOAD`` will be present as dictionary entries, with the keyword value of ``LOAD`` will be present as dictionary entries, with the keyword
argument names used as keys. Any ``LOAD``ed output arguments which were not argument names used as keys. Any ``LOAD`` output arguments which were not
generated by the function will not be present in the dictionary. generated by the function will not be present in the dictionary.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment