how to crop images 3D

1 回表示 (過去 30 日間)
mohd akmal masud
mohd akmal masud 2022 年 10 月 18 日
編集済み: Cris LaPierre 2022 年 10 月 18 日
Dear all,
I have 130x130x36 image as attached.
How to crop it into 130x130x10 ?
I tried this command, but error
h = imcrop(imstack3,[1:10]);
Error using images.internal.crop.parseInputsOverTwo>checkCData
Invalid input image.
Error in images.internal.crop.parseInputsOverTwo (line 52)
checkCData(a);
Error in imcrop (line 104)
images.internal.crop.parseInputsOverTwo(varargin{:});
  2 件のコメント
KSSV
KSSV 2022 年 10 月 18 日
Did you try imcrop3 ?
mohd akmal masud
mohd akmal masud 2022 年 10 月 18 日
yah..but error
h = imcrop3(imstack3,[1:10]);
Error using imcrop3>validateCuboid
Input number 2, CUBOID, is expected to contain 6 elements.
Error in imcrop3>parseInputs (line 69)
validateCuboid(cuboidWindow);
Error in imcrop3 (line 44)
[V, xLimits, yLimits, zLimits, isCuboidOutofBounds] = parseInputs(varargin{:});

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

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 10 月 18 日
編集済み: Cris LaPierre 2022 年 10 月 18 日
Why not just do this
h = imstack3(:,:,1:10)
Since this is a 3D image, you could also try using imcrop3.
h = imcrop3(imstack3,[1,1,1,129,129,9]); % [xmin ymin zmin width height depth]

その他の回答 (0 件)

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by