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

Display develop HEAD reports wrong value for voxel under cursor #65

Open
gdevenyi opened this issue Aug 31, 2016 · 10 comments
Open

Display develop HEAD reports wrong value for voxel under cursor #65

gdevenyi opened this issue Aug 31, 2016 · 10 comments
Assignees

Comments

@gdevenyi
Copy link

I'm writing some code using nibabel to lookup voxel values from minc files, so I was using Display to look at the value under the cursor to compare (since I know both the world and voxel coodinates thanks to recent Display improvements).

I found consistent difference between my nibabel output and Display. After much testing, I have confirmed it's not my nibabel code as register reports the correct value.

Screenshots:
Display:
voxel [96,114,96]
image

Register:
voxel [96,114,96]
image

Nibabel:

import nibabel as nb
img_y = nb.load("y.mnc")
print(img_y.get_data()[96,114,96])
2.59016
@rdvincent rdvincent self-assigned this Aug 31, 2016
@rdvincent
Copy link
Member

ok, is there anything unusual about that file (e.g. what is the voxel type)? Also, do you know if you have Convert_volumes_to_byte set to FALSE?

@gdevenyi
Copy link
Author

The mincheader of the file:

hdf5 y {
dimensions:
    xspace = 193 ;
    yspace = 229 ;
    zspace = 193 ;
variables:
    float image(zspace, yspace, xspace) ;
        image:varid = "MINC standard variable" ;
        image:vartype = "group________" ;
        image:version = "MINC Version    2.0" ;
        image:dimorder = "zspace,yspace,xspace" ;
        image:valid_range = -12.0096292495728, 11.6458549499512 ;
    double image-min ;
        image-min:varid = "MINC standard variable" ;
        image-min:vartype = "group________" ;
        image-min:version = "MINC Version    2.0" ;
    double image-max ;
        image-max:varid = "MINC standard variable" ;
        image-max:vartype = "group________" ;
        image-max:version = "MINC Version    2.0" ;
    double xspace ;
        xspace:version = "MINC Version    2.0" ;
        xspace:width = 1. ;
        xspace:vartype = "group________" ;
        xspace:start = -96. ;
        xspace:spacing = "regular__" ;
        xspace:alignment = "centre" ;
        xspace:direction_cosines = 1., 0., 0. ;
        xspace:class = "spatial" ;
        xspace:comments = "X increases from patient left to right" ;
        xspace:units = "mm" ;
        xspace:varid = "MINC standard variable" ;
        xspace:length = 193 ;
        xspace:step = 1. ;
    double yspace ;
        yspace:version = "MINC Version    2.0" ;
        yspace:width = 1. ;
        yspace:vartype = "group________" ;
        yspace:start = -132. ;
        yspace:spacing = "regular__" ;
        yspace:alignment = "centre" ;
        yspace:direction_cosines = 0., 1., 0. ;
        yspace:class = "spatial" ;
        yspace:comments = "Y increases from patient posterior to anterior" ;
        yspace:units = "mm" ;
        yspace:varid = "MINC standard variable" ;
        yspace:length = 229 ;
        yspace:step = 1. ;
    double zspace ;
        zspace:version = "MINC Version    2.0" ;
        zspace:width = 1. ;
        zspace:vartype = "group________" ;
        zspace:start = -78. ;
        zspace:spacing = "regular__" ;
        zspace:alignment = "centre" ;
        zspace:direction_cosines = 0., 0., 1. ;
        zspace:class = "spatial" ;
        zspace:comments = "Z increases from patient inferior to superior" ;
        zspace:units = "mm" ;
        zspace:varid = "MINC standard variable" ;
        zspace:length = 193 ;
        zspace:step = 1. ;

// global attributes:
        :ident = "devgab:cicws24:2016.08.31.14.28.28:16362:1" ;
        :class = "real___" ;
        :minc_version = "2.4.01" ;
data:

 image-min = -12.0096292495728 ;

 image-max = 11.6458549499512 ;

 xspace = 0 ;

 yspace = 0 ;

 zspace = 0 ;
}

and mincinfo:

file: y.mnc
image: signed__ float -12.009629249572753906 to 11.645854949951171875
image dimensions: zspace yspace xspace
    dimension name         length         step        start
    --------------         ------         ----        -----
    zspace                    193            1          -78
    yspace                    229            1         -132
    xspace                    193            1          -96

I don't have a Display.globals anywhere where the manual says it could be, so I have whatever the code default is for that setting (I think).

Can I check somehow?

@rdvincent
Copy link
Member

The default value for that variable is unfortunately still TRUE. Try running Display with

Display -global Convert_volumes_to_byte false y.mnc

@gdevenyi
Copy link
Author

That fixes it.

@gdevenyi
Copy link
Author

So, I guess I can switch that in a ~/.mni-displayrc for myself.

Maybe that default should make it into the codebase?

@rdvincent
Copy link
Member

@gdevenyi I had been planning to make it the default. Will do that today.

@zijdenbos
Copy link

Out of curiosity - since register reported the correct value, I assume this
means that it does not convert_volumes_to_byte anymore, either?

On Thu, Sep 1, 2016 at 8:52 AM, Robert D Vincent [email protected]
wrote:

@gdevenyi https://github.com/gdevenyi I had been planning to make it
the default. Will do that today.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#65 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA_r-Iz1hEVW4MsuTqHEwvgbvyE_m0-Zks5qlsqdgaJpZM4JyAPi
.

@rdvincent
Copy link
Member

@zijdenbos Correct. The default was changed in Register a long time ago - I just changed it in Display today.

@rdvincent
Copy link
Member

@zijdenbos Byte volumes are so 1996.

@zijdenbos
Copy link

That's only 20 years ago :)

On Thu, Sep 1, 2016 at 11:46 AM, Robert D Vincent [email protected]
wrote:

@zijdenbos https://github.com/zijdenbos Byte volumes are so 1996.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#65 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA_r-H_jS5M7yhIdg71qN4kWLqWPMr3Tks5qlvNXgaJpZM4JyAPi
.

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

3 participants