Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
6d912c17
Commit
6d912c17
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Fixes and tweaks
parent
c0156439
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fsl/transform/nonlinear.py
+2
-2
2 additions, 2 deletions
fsl/transform/nonlinear.py
fsl/transform/x5.py
+34
-33
34 additions, 33 deletions
fsl/transform/x5.py
fsl/wrappers/wrapperutils.py
+1
-1
1 addition, 1 deletion
fsl/wrappers/wrapperutils.py
with
37 additions
and
36 deletions
fsl/transform/nonlinear.py
+
2
−
2
View file @
6d912c17
...
...
@@ -456,7 +456,7 @@ class CoefficientField(NonLinearTransform):
:arg premat: If ``True``, the inverse :meth:`srcToRefMat` is applied
to the coordinates after the displacements have been
addd.
add
e
d.
:returns: ``coords``, transformed into the source image space
"""
...
...
@@ -465,7 +465,7 @@ class CoefficientField(NonLinearTransform):
def
displacements
(
self
,
coords
):
"""
Calculate the relative displacemen
e
ts for the given coordinates.
"""
Calculate the relative displacements for the given coordinates.
:arg coords: ``(N, 3)`` array of reference image voxel coordinates.
:return: A ``(N, 3)`` array of relative displacements to the
...
...
This diff is collapsed.
Click to expand it.
fsl/transform/x5.py
+
34
−
33
View file @
6d912c17
...
...
@@ -88,18 +88,18 @@ shape, dimensions, and voxel-to-world affine transformation.
Groups of type *space* have the following fields:
+-------------+-----------+--------------------------------------------------
-
+
| **Name** | **Type** | **Value/Description**
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Type`` | attribute | ``
'
image
'
``
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Size`` | attribute | ``uint64`` ``(X, Y, Z)`` voxel dimensions
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Scales`` | attribute | ``float64`` ``(X, Y, Z)`` voxel pixdims
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Mapping`` | affine | The image voxel-to-world transformation (its
|
| | | ``sform``)
|
+-------------+-----------+--------------------------------------------------
-
+
+-------------
-
+-----------+--------------------------------------------------+
| **Name**
| **Type** | **Value/Description** |
+-------------
-
+-----------+--------------------------------------------------+
| ``Type``
| attribute | ``
'
image
'
`` |
+-------------
-
+-----------+--------------------------------------------------+
| ``Size``
| attribute | ``uint64`` ``(X, Y, Z)`` voxel dimensions |
+-------------
-
+-----------+--------------------------------------------------+
| ``Scales``
| attribute | ``float64`` ``(X, Y, Z)`` voxel pixdims |
+-------------
-
+-----------+--------------------------------------------------+
| ``Mapping
/
`` | affine | The image voxel-to-world transformation (its |
|
| | ``sform``) |
+-------------
-
+-----------+--------------------------------------------------+
*deformation*
...
...
@@ -131,19 +131,19 @@ coordinate system.
Groups of type *deformation* have the following fields:
+-------------+-----------+--------------------------------------------------
-
+
| **Name** | **Type** | **Value/Description**
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Type`` | attribute | ``
'
deformation
'
``
|
+-------------+-----------+--------------------------------------------------
-
+
| ``SubType`` | attribute | ``
'
absolute
'
`` or ``
'
relative
'
``.
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Matrix`` | dataset | The deformation field - a ``float64`` array of
|
| | | shape ``(X, Y, Z, 3)``
|
+-------------+-----------+--------------------------------------------------
-
+
| ``Mapping`` | affine | The field voxel-to-world transformation (its
|
| | | ``sform``)
|
+-------------+-----------+--------------------------------------------------
-
+
+-------------
-
+-----------+--------------------------------------------------+
| **Name**
| **Type** | **Value/Description** |
+-------------
-
+-----------+--------------------------------------------------+
| ``Type``
| attribute | ``
'
deformation
'
`` |
+-------------
-
+-----------+--------------------------------------------------+
| ``SubType``
| attribute | ``
'
absolute
'
`` or ``
'
relative
'
``. |
+-------------
-
+-----------+--------------------------------------------------+
| ``Matrix``
| dataset | The deformation field - a ``float64`` array of |
|
| | shape ``(X, Y, Z, 3)`` |
+-------------
-
+-----------+--------------------------------------------------+
| ``Mapping
/
`` | affine | The field voxel-to-world transformation (its |
|
| | ``sform``) |
+-------------
-
+-----------+--------------------------------------------------+
Linear X5 files
...
...
@@ -204,7 +204,7 @@ between FLIRT-style matrices and X5 style matrices.
.. [*] 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
determinant.
...
...
@@ -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
reference image as either a warp field, or a coefficient field which can
be
used to generate a warp field. A warp field is defined in terms of the
FLIRT outputs the result of a non-linear registration
between
a source image
and a
reference image as either a warp field, or a coefficient field which can
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
image, and contains either:
...
...
@@ -316,6 +316,7 @@ to source image world coordinates.
The :mod:`fsl.transform.fnirt` module contains functions which can be used to
perform all of the conversions and adjustments required to store FNIRT
transformations as X5 files.
"""
...
...
@@ -341,11 +342,11 @@ class X5Error(Exception):
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
'
``.
:arg fname: Name of a X5 file
:returns: ``
'
linear
'
``or ``
'
nonlinear
'
``
:returns: ``
'
linear
'
``
or ``
'
nonlinear
'
``
"""
with
h5py
.
File
(
fname
,
'
r
'
)
as
f
:
...
...
@@ -405,7 +406,7 @@ def readNonLinearX5(fname):
"""
Read a nonlinear X5 transformation file from ``fname``.
:arg fname: File name to read from
:returns: A :class:`.D
isplacementField` or :class:`.Coefficient
Field`
:returns: A :class:`.D
eformation
Field`
"""
with
h5py
.
File
(
fname
,
'
r
'
)
as
f
:
...
...
@@ -432,7 +433,7 @@ def writeNonLinearX5(fname, field):
"""
Write a nonlinear X5 transformation to ``fname``.
:arg fname: File name to write to
:arg field: A :class:`.D
isplacementField` or :class:`.Coefficient
Field`
:arg field: A :class:`.D
eformation
Field`
"""
with
h5py
.
File
(
fname
,
'
w
'
)
as
f
:
...
...
This diff is collapsed.
Click to expand it.
fsl/wrappers/wrapperutils.py
+
1
−
1
View file @
6d912c17
...
...
@@ -448,7 +448,7 @@ class _FileOrThing(object):
``dict``-like object, where the function
'
s actual return value is
accessible via an attribute called ``output``. All output arguments with a
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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment