Re: [問題] 有關三維影像顯示問題已回收

看板MATLAB作者 (源)時間16年前 (2009/06/29 11:06), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
嘗試寫了一下,看是否有幫助 % Keywords: reshape, imshow, uint8. % The cross section image is grabed from 3D image. clear all close all clc % control variable size = 100; depth = 30; % The 3D image under inspection is created by arithmetic sequence. img1(:, : ,1) = ones(size,size, 1); for i = 2:depth img1(:, : ,i) = 5 * ones(size,size, 1) + img1(:, :, i-1); end % The cross section image is obtained form matrix operation. % The shape of matrix is (x, 1, y), which can't reveal via imshow(). img2 = img1(:, 2, :); % The matrix is reshaped in (x, y, 1) format, and convet to uint8 % format, then reveals via imshow(). img3 = reshape(img2, size, depth, 1) imshow(uint8(img3),[]) ※ 引述《hotun (空空如也~~)》之銘言: : 請問一下我有一組立體的影像 : 假設 a=(256,256,52); : 意思是我有 52 張 256*256 pixels 的影像 : 我顯示第一張我可以用 image(a(:,:,1)); 沒問題 : 但今天我想看另一個切面的影像 : 假設我今天存了另一個陣列 b=(128,:,:); : 所以 b 的陣列顯示是 b= 1*256*52; : 問題來了~~ : 這個矩陣中我要看的其實是 a 影像中另一個切面影像 : 但是要顯示 b 影像的時候無法顯示 : 因為 b 是一個 1*256*52 的陣列 : 等於是說 b 為一個 52張 1*256 pixels 的影像 : 我想問說在b 的矩陣中可不可以將它轉成 b = 256*52*1 ??? : 這樣才可以顯示出這一個影像 : 有這個指令嗎?? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.4.235 ※ 編輯: PHANTOMAN 來自: 140.112.4.235 (06/29 11:07)

06/30 01:20, , 1F
感謝您~~我試出來了~~
06/30 01:20, 1F
文章代碼(AID): #1AI2_AJt (MATLAB)
文章代碼(AID): #1AI2_AJt (MATLAB)