Skip to content

2316 Fix endian order issue of Nibabel reader#2326

Merged
Nic-Ma merged 7 commits into
Project-MONAI:devfrom
Nic-Ma:2316-fix-endian-order
Jun 7, 2021
Merged

2316 Fix endian order issue of Nibabel reader#2326
Nic-Ma merged 7 commits into
Project-MONAI:devfrom
Nic-Ma:2316-fix-endian-order

Conversation

@Nic-Ma

@Nic-Ma Nic-Ma commented Jun 7, 2021

Copy link
Copy Markdown
Contributor

Fixes #2316 .

Description

This PR added support to swap endian order in Nibabel reader as we must swap endian order by nibabel API.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma Nic-Ma requested review from ericspod, rijobro and wyli June 7, 2021 12:49

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I think both this and #2325 could be merged to address #2316

Comment thread monai/data/image_reader.py Outdated
Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma Nic-Ma force-pushed the 2316-fix-endian-order branch from 18eaf00 to c4f76b2 Compare June 7, 2021 13:02
@Nic-Ma

Nic-Ma commented Jun 7, 2021

Copy link
Copy Markdown
Contributor Author

Hi @wyli ,

Thanks for your review.
Added unit tests.
Without this PR, the test data shape is:

...tensor([[100, 100]], dtype=torch.int16)
....tensor([[25600, 25600]], dtype=torch.int16)

Thanks.

Signed-off-by: Nic Ma <nma@nvidia.com>
@Nic-Ma

Nic-Ma commented Jun 7, 2021

Copy link
Copy Markdown
Contributor Author

/black

@Nic-Ma Nic-Ma enabled auto-merge (squash) June 7, 2021 13:11
@Nic-Ma Nic-Ma merged commit 89ee6af into Project-MONAI:dev Jun 7, 2021
@Nic-Ma Nic-Ma deleted the 2316-fix-endian-order branch July 2, 2021 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saving NiFTI images with resampling raises memory error

2 participants