Skip to content

RFC: Fix NRRD output axis order#356

Merged
hjmjohnson merged 2 commits intoBRAINSia:masterfrom
ihnorton:fix_mismatched_axes
Nov 29, 2017
Merged

RFC: Fix NRRD output axis order#356
hjmjohnson merged 2 commits intoBRAINSia:masterfrom
ihnorton:fix_mismatched_axes

Conversation

@ihnorton
Copy link
Copy Markdown
Collaborator

@ihnorton ihnorton commented Nov 19, 2017

NOTE: small change -- but please review very carefully and see note below

Before: After:
image image

This turned out to be a little more involved than the pixel precision mismatch I initially suspected: NRRD output size axes appear to be swapped relative to ITK row-major array storage (and have been back at least 5 years or so). In practice, this only matters when x and y axis dimensions are different -- as they happen to be in this particular dataset I was sent after a Slicer forum post.

Input nifti dimensions: 173 207 173 143
Output nrrd - before: sizes: 207 173 173 143
Output nrrd - after: sizes: 173 207 173 143

Apparently such an acquisition is relatively rare, though I'm still surprised this could have persisted for so long. As such, despite fixing read of this particular dataset, there's a chance I missed some underlying assumption elsewhere in the code. So, please review carefully and run the test suite if possible before merging. I'm not set up to run it myself right now, but if needed I can set it up to run on our cluster if it can't otherwise be run.

@hjmjohnson
Copy link
Copy Markdown
Member

@ihnorton Thank you very much for doing this testing. I will test as soon as I can.

@hjmjohnson
Copy link
Copy Markdown
Member

Tests run and passed.

@hjmjohnson
Copy link
Copy Markdown
Member

@ihnorton Thanks for your support. Code confirmed.

@hjmjohnson hjmjohnson merged commit f375870 into BRAINSia:master Nov 29, 2017
@ihnorton
Copy link
Copy Markdown
Collaborator Author

ihnorton commented Dec 1, 2017

Thanks!

@ihnorton ihnorton deleted the fix_mismatched_axes branch December 1, 2017 19:52
slicerbot pushed a commit to Slicer/SlicerGitSVNArchive that referenced this pull request Dec 5, 2017
Thanks: Isaiah Norton <inorton@bwh.harvard.edu>

References:
* BRAINSia/BRAINSTools#356
* https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/4

List of changes:

$ git shortlog 42ac3c3..c1289e6 --no-merges
Hans J. Johnson (1):
      ENH: Need to add allowLossy for file types other than short.

Isaiah Norton (2):
      BUG: ITK is row-major; fix NRRD output with mismatched (x,y) axis sizes
      BUG: FSL converter should check reader status

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26676 3bd1e089-480b-0410-8dfb-8563597acbee
jcfr added a commit to Slicer/SlicerGitSVNArchive that referenced this pull request Dec 20, 2017
Thanks: Isaiah Norton <inorton@bwh.harvard.edu>

References:
* BRAINSia/BRAINSTools#356
* https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/4

List of changes:

$ git shortlog 42ac3c3..c1289e6 --no-merges
Hans J. Johnson (1):
      ENH: Need to add allowLossy for file types other than short.

Isaiah Norton (2):
      BUG: ITK is row-major; fix NRRD output with mismatched (x,y) axis sizes
      BUG: FSL converter should check reader status

git-svn-id: http://svn.slicer.org/Slicer4/branches/Slicer-4-8@26767 3bd1e089-480b-0410-8dfb-8563597acbee
jcfr added a commit to jcfr/SlicerGitSVNArchive that referenced this pull request Jan 18, 2018
Thanks: Isaiah Norton <inorton@bwh.harvard.edu>

References:
* BRAINSia/BRAINSTools#356
* https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/4

List of changes:

$ git shortlog 42ac3c3..c1289e6 --no-merges
Hans J. Johnson (1):
      ENH: Need to add allowLossy for file types other than short.

Isaiah Norton (2):
      BUG: ITK is row-major; fix NRRD output with mismatched (x,y) axis sizes
      BUG: FSL converter should check reader status

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26676 3bd1e089-480b-0410-8dfb-8563597acbee
@ihnorton ihnorton restored the fix_mismatched_axes branch August 5, 2018 02:06
jcfr added a commit to Slicer/Slicer that referenced this pull request Mar 13, 2020
Thanks: Isaiah Norton <inorton@bwh.harvard.edu>

References:
* BRAINSia/BRAINSTools#356
* https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/4

List of changes:

$ git shortlog 42ac3c3..c1289e6 --no-merges
Hans J. Johnson (1):
      ENH: Need to add allowLossy for file types other than short.

Isaiah Norton (2):
      BUG: ITK is row-major; fix NRRD output with mismatched (x,y) axis sizes
      BUG: FSL converter should check reader status

svn-url: http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26767
git-svn-id: http://svn.slicer.org/Slicer4/branches/Slicer-4-8@26767 3bd1e089-480b-0410-8dfb-8563597acbee
jcfr added a commit to NA-MIC/svn.slicer.org-Slicer4 that referenced this pull request Dec 22, 2022
Thanks: Isaiah Norton <inorton@bwh.harvard.edu>

References:
* BRAINSia/BRAINSTools#356
* https://discourse.slicer.org/t/dti-nifti-data-import-via-dwi-convert-module/1460/4

List of changes:

$ git shortlog 42ac3c3..c1289e6 --no-merges
Hans J. Johnson (1):
      ENH: Need to add allowLossy for file types other than short.

Isaiah Norton (2):
      BUG: ITK is row-major; fix NRRD output with mismatched (x,y) axis sizes
      BUG: FSL converter should check reader status

git-svn-id: http://svn.slicer.org/Slicer4/branches/Slicer-4-8@26767 3bd1e089-480b-0410-8dfb-8563597acbee
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.

2 participants