Hello,
I am trying to access the value at a certain voxel using Nibabel. I have imported my AFNI image as a variable called “brik” and applied the get_fdata() to this to get the array containing all the values at each voxel coordinate. I.e.:
brik = nib.load(‘file.BRIK’)
data = brik.get_fdata()
At first I tried to access the value at a certain voxel by using the coordinates of the voxel I wanted coming from the GUI. However, when I used these coordinates, the values did not match up. I have my AFNI set into the default RAI coordinate system. Example:
according to the GUI, the value at 48 (sagittal/R-L view), 76 (coronal/A-P view), 50 (axial/I-S view) is 0.167815.
When I enter these into Nibabel like so: data[48][76][50]
I get a return value of: array([0.05748392])
I then ran 3dmaskdump on my entire image and looked up the coordinates. The value listed under the coordinates 48 76 50 was the same as Nibabel had shown, just too a few less decimals – 0.057484. So it looks like 3dmaskdump and Nibabel are agreeing, and that Nibabel is accessing the same thing as 3dmaskdump.
Is there something different about the coordinate system in the GUI and the coordinate system from 3dmaskdump that I am missing here? I should also note that the values at the origin voxel (for me – 45, 54, 45) agree between the GUI, 3dmaskdump, and Nibabel, but that seems to be the only instance where 3dmaskdump/Nibabel are the same as the GUI.
Thanks!
Ryann