Skip to content

Don't force int16 conversion in nonrigid.transform_data#1230

Open
ethanbb wants to merge 1 commit intoMouseLand:mainfrom
proektlab:transform-maintain-type
Open

Don't force int16 conversion in nonrigid.transform_data#1230
ethanbb wants to merge 1 commit intoMouseLand:mainfrom
proektlab:transform-maintain-type

Conversation

@ethanbb
Copy link
Copy Markdown

@ethanbb ethanbb commented Apr 14, 2026

This change fixes an integer overflow that I encountered when using registration_wrapper on arrays that were not int16 type. Specifically, the values in my data were in the range of uint16, and the cast to int16 (short) type at the end of transform_data caused some values to wrap around to very negative int16 values. With this change, the output of registration_wrapper will be the same type as the input.

I realize that in other parts of the software, data arrays are expected to be in int16 format, and other features might not be expected to work correctly if this is violated. However, empirically, at least registration_wrapper with an input and output memmapped array of another dtype worked fine with this change.

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.

1 participant