Skip to content
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

Document that header object given to nrrd.write will be updated with auto generated fields #86

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/README.rst
2 changes: 1 addition & 1 deletion docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Example with fields and custom fields
[0., 0., 1.]])), ('kinds', ['domain', 'domain', 'domain']), ('encoding', 'ASCII'), ('spacings', array([1.0458, 1.0458, 2.5 ])), ('units', ['mm', 'mm', 'mm']), ('custom_field_here1', 24.34), ('custom_field_here2', array([1, 2, 3, 4]))])

Example reading NRRD file with duplicated header field
-------------
------------------------------------------------------
.. code-block:: python

import nrrd
Expand Down
4 changes: 3 additions & 1 deletion nrrd/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def write(filename, data, header={}, detached_header=False, relative_data_path=T

.. note::
The following fields are automatically generated based on the :obj:`data` parameter ignoring these values
in the :obj:`header`: 'type', 'endian', 'dimension', 'sizes'.
in the :obj:`header`: 'type', 'endian', 'dimension', 'sizes'. In addition, the generated fields will be
added to the given :obj:`header`. Thus, one can check the generated fields by viewing the passed
:obj:`header`.

.. note::
The default encoding field used if not specified in :obj:`header` is 'gzip'.
Expand Down