필터 지우기
필터 지우기

How to downsample the 3D matrix in matlab??

조회 수: 37 (최근 30일)
Rizwan Khan
Rizwan Khan 2022년 7월 24일
댓글: Kristoffer Walker 2024년 7월 6일 16:42
Due to computational limitations, I need to downsample the 3D (1500x1500x1700) matrix by a factor of 2. The binning process should merg the 2x2x2 voxels and assign the mean intensity value of the group to the corresponding voxel in the reduced image.

채택된 답변

Jan
Jan 2022년 7월 24일
X = rand(1500, 1500, 1700); % 28.5 GB - does not run in the forum!
Y = reshape(X, 2, 750, 2, 750, 2, 850);
Z = squeeze(sum(Y, [1,3,5])) / 8;
size(Z)
  댓글 수: 4
Rizwan Khan
Rizwan Khan 2022년 7월 25일
Yes, I omitted the last vector before downsampling.
thanks Jan
Kristoffer Walker
Kristoffer Walker 2024년 7월 6일 16:42
Brilliant Jan. Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by