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

Benefits of lossless scaling? #682

Closed
dorkylever opened this issue Mar 1, 2023 · 1 comment
Closed

Benefits of lossless scaling? #682

dorkylever opened this issue Mar 1, 2023 · 1 comment

Comments

@dorkylever
Copy link

Hi Chris,

Just wondering about the benefits of lossless scaling.

I use dcm2niix -l n to match intensity values produced by converting DICOM to NRRD in 3DSlicer (I believe that 3D Slicer uses this module in some instances / but in other instances it uses DWIConvert ... I don't really understand).

Have there been any publications that use the scaling?

I think for our studies it would slow our analysis as I need to directly modify the array for certain parts of the analysis pipeline but I'm open to your opinion.

Kind Regards,
Kyle

@neurolabusc
Copy link
Collaborator

Many MRI scanners use 12-bit ADC, so for magnitude images the raw voxel values are in the range of 0..4095. dcm2niix will convert these as the NIfTI INT16 datatype (with a range of -32768..32767). Most neuroimaging preprocessing tools default to saving data to the input datatype, so the INT16 datatype is preserved for all steps of processing (slice timing, motion correction, spatial smoothing, detrending, normalization). By using the full range of the data type, we attempt to preserve the precision of these steps which are calculated as floating point with fractional results.

Consider an input NIfTI image with the following parameters:

min_intensity 0
max_intensity 3996
scl_slope	1.000000
scl_inter	0.000000

The lossless rescaling would simply multiply each voxel by 16, and divide the scale slope by 16 to yield:

min_intensity 0
max_intensity 63936
scl_slope	0.062500
scl_inter	0.000000

As an analogy, we can have more precision in our accounting if we measure each expense in terms of pennies rather than dollars.

See issue 198 for more details

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

2 participants