imresize3 function in older version of matlab

2 ビュー (過去 30 日間)
Jakub
Jakub 2017 年 11 月 16 日
コメント済み: Walter Roberson 2020 年 4 月 24 日
Hello, I'm using matlab R2016a version and I need to use imresize3 function. Is there any place where can I download this function, or any alternative of this function I can use in my version of Matlab? I just need to fit 168*168*135 PET image to 512*512*448 CT image. Thanx for help

採用された回答

Rik
Rik 2017 年 11 月 16 日
編集済み: Rik 2017 年 11 月 16 日
Edit (sorry, too quick): Nope. As you can see in the doc for R2017b, it was introduced in R2017a.
This thread is from before the introduction of this function, so that might help you find a solution for older releases. I took the liberty of copying one of the answers below. It uses functions that aren't in the Matlab base, so you'll need the image processing toolbox (I'm assuming that isn't a problem, as imresize3 is as well, unlike imresize).
T = maketform('affine',[x_scale 0 0; 0 y_scale 0; 0 0 z_scale; 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);
  2 件のコメント
Tahariet Sharon
Tahariet Sharon 2020 年 4 月 24 日
What is the x variable?
Walter Roberson
Walter Roberson 2020 年 4 月 24 日
x is x_scale, sort of. The original example at https://stackoverflow.com/questions/12520152/resizing-3d-matrix-image-in-matlab was only for scaling by a constant ratio in each dimension. For different ratios in each dimension you would want
T = maketform('affine',[x_scale 0 0; 0 y_scale 0; 0 0 z_scale; 0 0 0;]);
R = makeresampler({'cubic','cubic','cubic'},'fill');
ImageScaled = tformarray(Image,T,R,[1 2 3],[1 2 3], round(size(Image).*[x_scale, y_scale, z_scale]),[],0);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by