fix: preserve original datatype on output instead of hardcoding signed short - #7
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
akhanf
June 24, 2026 19:44
View session
Member
|
@copilot: the problem is fslmaths does not support odt of ushort: |
Author
... Good catch. Since |
Copilot
AI
changed the title
fix: preserve unsigned short datatype on output instead of hardcoding signed short
fix: preserve original datatype on output instead of hardcoding signed short
Jun 24, 2026
akhanf
marked this pull request as ready for review
June 24, 2026 20:02
akhanf
force-pushed
the
copilot/fix-signed-short-casting-issue
branch
from
July 9, 2026 16:39
309cbf7 to
f093422
Compare
Member
|
cleaned up history that involved deps etc, since those dealt with in the pixi PR.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fslmaths -odt short(INT16) was hardcoded as the output datatype, silently corrupting UINT16 images by mapping values > 32767 to negative numbers.Changes
run.sh: Usefslinfoto read the original image's NIfTI datatype, then map it to the correctfslmaths -odtargument before writing the final output. Sincefslmathsdoes not supportushort, UINT16 inputs are mapped toint(INT32), which holds all UINT16 values (0–65535) without sign corruption.No new dependencies —
fslinfois part of the existing FSL 5.0 install.