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

Problem with resolution of nifti after applied niftiApplyXform #298

Open
soanduong opened this issue Jul 8, 2018 · 0 comments
Open

Problem with resolution of nifti after applied niftiApplyXform #298

soanduong opened this issue Jul 8, 2018 · 0 comments

Comments

@soanduong
Copy link

I used the function niftiApplyXform to change the orientation of a nifti file (e.g. from 'LAS' to 'ILP'). However, the resolution of the new nifti computed by the transformation matrix is changed. Below is MATLAB script that I used

ni = readFileNifti('epi1.nii');
T = ni.sto_xyz;

xform = [0     0    -1     0;
         1     0     0     0;
         0    -1     0     0;
         0     0     0     1]
ni_new = niftiApplyXform(ni, xform);
T_new = ni_new.sto_xyz;

% Show the resolution from the transformation matrix
r1 = sqrt(sum(T(1:3,1:3).^2))
r2 = sqrt(sum(T_new(1:3,1:3).^2))

r1 and r2 are the resolutions of nifties. I think that the isotropic resolution should be kept with the given xform. However, they are not the same (e.g. r1 = [0.5 0.5 0.5] and r2 = [2 2 2]).

Do you have any idea about where I am wrong? Any offer is highly appreciated.

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

1 participant