2D View slice intensity doesn't correspond to python array value(Confusion)

Operating system:win10
Slicer version:slicer 4.10.0/4.10.1
Expected behavior:
Actual behavior:

Hi,everyone. I am trying to understand how slicer 2D images present in the form of an array in python.
So i did some work (see the below pic). The result makes me pretty confused, the intensity in images and the value in the array should be the same, right ?

I hope someone can help me to clear up my confusion.

Thanks in advance .

Numpy uses inverse indexing order (k, j, i).

In the example above, va[138, 277, 163] should give you the results you expect.

See further examples in script repository, such as https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_markup_fiducial_RAS_coordinates_from_volume_voxel_coordinates

1 Like