Can IMWARP be used in place of TFORMARRAY?

9 visualizzazioni (ultimi 30 giorni)
J.D. Johnston
J.D. Johnston il 16 Ott 2018
I am currently using TFORMARRAY to rotate CT image data. Recently, Matlab has been suggesting that I use AFFINE3D instead of MAKETFORM. While trying to figure out how to use AFFINE3D with TFORMARRAY, I found IMWARP function, which is really fast when compared alongside TFORMARRAY. When trying to update my code though with IMWARP, I get a bit stuck. Here is my approach using TFORMARRAY. Any suggestions on how I could do this with IMWARP?
method = 'linear'; type = 'affine'; R = makeresampler(method,'fill');
Mi = Ma*rot*Mb; T = maketform(type,Mi');
volume_rot = tformarray(volume,T,R,[1 2 3],[1 2 3],[r c s],[],[]);
Note:
- Ma is a transformation matrix corresponding to the point of rotation; Mb is the negative of Ma. This rotation matrix just centers everything at the point of rotation via Mb, followed by rotation via rot, followed by putting the volume back to the original orientation via Ma.
- [r c s] pertain to the # of rows, columns and slices

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by