-
Notifications
You must be signed in to change notification settings - Fork 29
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
Disagreement between miget_real_value
and miget_real_value_hyperslab
#108
Comments
|
Does |
mincresample uses minc1 API, miget_real_value_hyperslab and miget_real_value is from minc2 API |
So do you think |
what's the file in question? |
|
so, looks like the problem is in |
|
so, there is piece of code in https://github.com/BIC-MNI/libminc/blob/develop/libsrc2/hyper.c#L579 (used in miget_hyperslab_with_icv) that is missing in https://github.com/BIC-MNI/libminc/blob/develop/libsrc2/convert.c#L89 , used from |
Ok, thanks for looking in to this Vlad! So that code says that scaling is disabled if you have float volume? I guess that kind of makes sense. |
yes, it should be disabled for float and double , but |
Want me to issue a PR or should I leave this with you? |
it will be better if you make the PR |
No problem, I'll open one later this week. |
Hi, we're planning a new libminc/minc-toolkit-v2 release, do you have time to put together a PR, or should we do it? |
Typically in RMINC we read data in using
miget_real_value_hyperslab
. However one of our functions,mincGetVoxel
usesmiget_real_value
. I would have assumed that these two functions would agree on any particular voxel's real value, but that doesn't seem to be the case at least for double precision volumes. Internallymiget_real_value
usesmirw_hyperslab_raw
which does no conversion on the value, and then post-hoc callsmiconvert_voxel_to_real
. Whereasmiget_real_value_hyperslab
callsmirw_hyperslab_icv
which does its own, apparently more complicated scaling internally. So I suspect thatmiconvert_voxel_to_real
is missing something relevant for the rescaling.Here's a sample C program illustrating the problem
An easy way to test is to convert the icbm average to unsigned double
Then compile and run the above program to check the difference, on my machine I get
This was noticed by one of our users getting the expected answer when using
mincAnova
which usesmiget_real_value_hyperslab
internally, but a very different answer when plucking individual voxels withmincGetVoxel
which usesmiget_real_value
The text was updated successfully, but these errors were encountered: