Get to selected 2d matrix from a 3d matrix
이전 댓글 표시
Ok so here's the question. I'm struggling to extract selected 2d arrays from a 3d array. Say an image with 15 frames and 3 slices and resolution 128X80 which gives a matrix size of (128,80,45). The querry is how do you extract say the first slice of every frame which are (128,80,1) & (128,80,4) & (128,80,7) ....till....(128,80,43). Which will give a size (128,80,15).
Outline of wrong code
nslices=3; % number of slices nframes=15 %number of time frames slice_num=1; % slice wanted
dir = pwd; dir = [dir, '\'];
[filename1,dir] = uigetfile('*.7','Pick first file'); [FID,headers]=read_MR_rawdata(filename1); data_all=squeeze(FID);
im_data=zeros(size(data_all,1),size(data_all,2),nframes);
count=1 for x=slice_num:nslices:nframes*nslices im_data(:,:,x)=data(:,:,x); count=count+1 end
Thank you so much
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!