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

nii2mnc doesn't seem to handle scl_slope and scl_inter properly #110

Open
gdevenyi opened this issue Dec 4, 2020 · 0 comments
Open

nii2mnc doesn't seem to handle scl_slope and scl_inter properly #110

gdevenyi opened this issue Dec 4, 2020 · 0 comments

Comments

@gdevenyi
Copy link

gdevenyi commented Dec 4, 2020

nii2mnc seems to have issues handling the voxel storage/scaling features of nifti.

I have a file with scl_slope = 0.000219166, scl_inter = 0

If I re-generate the NIFTI using ANTs ConvertImage, which strips the scaling and encodes directly in the voxel values:

> ConvertImage 3 file_with_scaling.nii.gz file_without_scaling.nii.gz

I can see that the resulting MINC files are different

> mincstats file_with_scaling.mnc
*** mincstats - reported min (3.59153) doesn't equal header (0.000876664)
*** mincstats - reported max (7.18109) doesn't equal header (7.1812)
File:              file_with_scaling.mnc
Mask file:         (null)
Total voxels:      8711680
# voxels:          8711680
% of total:        100
Volume (mm3):      4001.943345
Min:               3.591529182
Max:               7.181086052
Sum:               32807197.61
Sum^2:             124161604.9
Mean:              3.765886443
Variance:          0.07041399787
Stddev:            0.2653563601
CoM_voxel(y,z,x):  102.1101118 82.5984099 127.4448086
CoM_real(x,y,z):   -2.192321458 -1.239079736 -2.827323455

Histogram:         (null)
Total voxels:      8711680
# voxels:          8711680
% of total:        100
Median:            3.63232449
Majority:          3.617962337
BiModalT:          3.984158603
PctT [  0%]:       0.002671744039
Entropy :          6.322473846
> mincstats file_without_scaling.mnc
File:              file_without_scaling.mnc
Mask file:         (null)
Total voxels:      8711680
# voxels:          8711680
% of total:        100
Volume (mm3):      4001.94323
Min:               0.0008766643004
Max:               7.181195736
Sum:               3046036.55
Sum^2:             3519566.35
Mean:              0.3496497289
Variance:          0.2817505648
Stddev:            0.5308018131
CoM_voxel(y,z,x):  104.3723066 84.62019458 126.3109265
CoM_real(x,y,z):   -2.035618383 -1.095800832 -2.699890566

Histogram:         (null)
Total voxels:      8711680
# voxels:          8711680
% of total:        100
Median:            0.08524575843
Majority:          0.05652413711
BiModalT:          0.7889166824
PctT [  0%]:       0.002671744068
Entropy :          7.319477426

Comparing the two MINC files, min(file_without_scaling.mnc) = 0.000219166*min(file_with_scaling.mnc)

Considering the max values are the same, I'm guessing the issue is with how the minimum value is calculated. Will investigate further.

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