Transform a 3d volume by using an affine transformation matrix 1.0Related Scripts Categories:
Other Languages 
Software & System 
Tools & Utilities 
Tutorials & Articles 
Web Hosting Tools
This function transforms volume 'old_im' by means of affine transformation matrix 'M'. The output volume can be sub and oversampled. The function makes use of interp3, so 'nearest', 'linear', 'spline', 'cubic' and fast ( * ) interpolation is possible.% Usage example  simple translationload mri.matD = squeeze(D(:,:,1,:));% Create affine transformation matrix, simply shift (x,y) = (50,25)M = [1 0 0 50; 0 1 0 25; 0 0 1 0; 0 0 0 1];% Invert M, since the interpolation is backward. Meanwhile subsample the output volume xdirection by a factor of two.D_new = affine3d(D,inv(M),1:2:128,1:128,1:27);figuresubplot(1,2,1)imagesc(D(:,:,10))title('Original volume')subplot(1,2,2)imagesc(D_new(:,:,10))title('Shifted volume') Tags: Backward, Subsample, Xdirection, Invert, Squeezed, Create, Simply, Shift Platforms: BSD , Mac OS X , Solaris , linux
More Similar Scripts
Similar Software

Scripts Categories
Related Scripts
Image Rotation 1.0
Simple finger normalisation 1.0
Calculation of fractal dimension of a 3D volume using fft 1.0
Make FSLcompatible Transformation Matrix 1.0
Global to Local Coordinate Transformation Matrix 1.0
Orthogonal Linear Regression in 3Dspace by using Principal Components Analysis 1.0
Faster 3D Walsh  Hadamard Transform (sequency, natural) 1.0
Muscle fascicle tracking  Ultrasound 1.0
EC1302 DSP Lab 1.0
3D Slice Viewer 1.0 Popular Scripts
