resizing 3D matrix (image) in MATLAB

前端 未结 3 1477
再見小時候
再見小時候 2020-11-28 10:46

I have a 3D matrix (MxNxK) and want to resize it to (M\'xN\'xK\') (like imresize in matlab). I am using image pyramid, but its result is not very accurate and need a better

3条回答
  •  死守一世寂寞
    2020-11-28 11:19

    Look at the example Exploring Slices from a 3-Dimensional MRI Data Set in the Image Processing Toolbox. It looks more complicated than it actually is. You also can choose the interpolation method easily when working according to this example. To resize a volume isotrope by x, you'd have to use something like (I didn't test it):

    T = maketform('affine',[x 0 0; 0 x 0; 0 0 x; 0 0 0;]);
    R = makeresampler({'cubic','cubic','cubic'},'fill');
    ImageScaled = tformarray(Image,T,R,[1 2 3],[1 2 3], round(size(Image)*x),[],0);
    

    If you're working with binary images/volumes it might be better to change the 'cubic' interpolation to 'nearest'.

提交回复
热议问题