Simple question about spm12

Summary of what happened:

I have a very simple question about SPM12.
I obtained the anatomical T1 image of a participant,
and normalized the brain to MNI brain with SPM12 using spatial.normalise.estwrite.
I now have wOOO and y_OOO nifti files.
I now want to obtain a coordinate that corresponds to certain MNI coordinate (e.g. -8,-11,6)
within the original image.
How can I do this? Any help would be greatly appreciated.

Command used (and if a helper script was used, a link to the helper script or the command generated):

PASTE CODE HERE

Version:

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:


I found this answer on the BIDS mailing list: JISCMail - SPM Archives

copying the content here

You actually need the iy_ deformation field, see procedure in the attached PDF. You can also use the program I have attached.

MNICord=GetMNICoord('/Users/lund/Desktop/Day2/Images/iy_MPRAGE1.nii',[0.3 -26.6 0.1])

MNICord =

    1.4945
  -26.7329
   -0.8824
function [MNICoord]=GetMNICoord(InverseDeformationField,NativeCoord)

%Get voxel to mm transformation matrix:
M               = spm_get_space(InverseDeformationField);

% Make Native coordinate a 4D collumn vector:
NativeCoordmm   = NativeCoord(:);
NativeCoordmm   = [NativeCoordmm(1:3) ; 1];

% Get Native coordinate in voxelspace
NativeCoordvox  = M\NativeCoordmm;

% Round to nearest integer voxel:
NativeCoordvox  = round(NativeCoordvox);

% % Load all of the deformation field into memory (SLOW)
% for dim=1:3
%     [Y(:,:,:,dim),XYZ]=spm_read_vols(spm_vol([InverseDeformationField ',1,' num2str(dim)]));
% end
% 
% % Get value at Native coordinate
% MNICoord        = Y(NativeCoordvox(1),NativeCoordvox(2),NativeCoordvox(3),1:3);


% Alternative faster version using spm_sample_vol:
for dim=1:3
    MNICoord(dim)   = spm_sample_vol(spm_vol([InverseDeformationField ',1,' num2str(dim)]),NativeCoordvox(1),NativeCoordvox(2),NativeCoordvox(3),0);
end

MNICoord        = MNICoord(:);

Thanks for your answer. What I wanna do is actually the opposite: I want to convert the MNI coordinate to actual coordinate.

I tried using y_OOO file instead of iy but it seems not working…