-
Notifications
You must be signed in to change notification settings - Fork 262
Clarification to docs regarding initial sform/qform code values #576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification to docs regarding initial sform/qform code values #576
Conversation
…ecified during Nifti1Image creation.
…ow the sform/qform codes are initialised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo - but otherwise looks good - thanks.
nibabel/nifti1.py
Outdated
``affine`` does not match the affine that is in the ``header``, | ||
the ``affine`` will be used, but the ``sform_code`` and | ||
``qform_code`` fields in the header will be re-initialised to | ||
their default values.. This is performed on the basis that, if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra period values..
Codecov Report
@@ Coverage Diff @@
## master #576 +/- ##
=======================================
Coverage 94.32% 94.32%
=======================================
Files 177 177
Lines 24695 24695
Branches 2639 2639
=======================================
Hits 23294 23294
Misses 925 925
Partials 476 476
Continue to review full report at Codecov.
|
doc/source/nifti_images.rst
Outdated
The sform and qform codes will be initialised to 2 (aligned) and 0 (unknown) | ||
respectively: | ||
|
||
>>> img.get_sform(coded=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> img.get_sform(coded=True) # doctest: +NORMALIZE_WHITESPACE
Oops. You got to the typo before me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last couple of nitpicks, sorry.
doc/source/nifti_images.rst
Outdated
>>> new_data = np.random.random(n1_img.shape[:3]) | ||
>>> new_img = nib.nifti1.Nifti1Image(data, None, header=new_header) | ||
|
||
Then the newly created image will inherit the same sform and qform codes that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capital T for Then reads oddly.
nibabel/nifti1.py
Outdated
Notes | ||
----- | ||
|
||
If both a ``header`` and an ``affine`` are specified, and the ``affine`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want single backticks for the parameters header
and affine
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a single backtick for markdown, but double backticks for restructured text - this renders fine as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single backticks in rst gives the default markup, which, in the case of the numpy docstring renderer, has the right markup for referring to parameters. So, single backticks to refer to parameters, double backticks for typewriter font ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah ok - I am not all that familiar with numpydoc - will fix it now!
Great - thanks for your patience. |
[see #574 for background]
This PR adds a little bit of documentation to the
Nifti1Pair
class, and to the nibabel user documentation page on working with NIfTI images, clarifying how thesform_code
andqform_code
fields are initialised under different circumstances.