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

scl_slope = 0 should not scale #14

Open
kleinschmidt opened this issue Apr 5, 2018 · 1 comment
Open

scl_slope = 0 should not scale #14

kleinschmidt opened this issue Apr 5, 2018 · 1 comment

Comments

@kleinschmidt
Copy link

The NIfTI spec says that the slope/intercept should be used for nonzero slope:

/ DATA SCALING:
   ------------
   If the scl_slope field is nonzero, then each voxel value in the dataset
   should be scaled as
      y = scl_slope  x + scl_inter
   where x = voxel value stored
         y = "true" voxel value

This could be checked when creating the header struct, setting the slope to 1f0 if its zero, or adding a type parameter to the nifti struct and dispatching on that for getindex.

@kleinschmidt
Copy link
Author

(or I could keep just using the .raw field like I have been doing...)

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

No branches or pull requests

1 participant