Transform a 3d volume by using an affine transformation matrix

버전 1.0.0.0 (1.9 KB) 작성자: Martijn Steenwijk
This function transforms a volume by using an affine transformation matrix.
다운로드 수: 1.9K
업데이트 날짜: 2009/10/17

라이선스 보기

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 translation
load mri.mat
D = 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 x-direction by a factor of two.
D_new = affine3d(D,inv(M),1:2:128,1:128,1:27);
figure
subplot(1,2,1)
imagesc(D(:,:,10))
title('Original volume')
subplot(1,2,2)
imagesc(D_new(:,:,10))
title('Shifted volume')

인용 양식

Martijn Steenwijk (2025). Transform a 3d volume by using an affine transformation matrix (https://kr.mathworks.com/matlabcentral/fileexchange/25596-transform-a-3d-volume-by-using-an-affine-transformation-matrix), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2008b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0