# how to make a slice of multiple images in 3d

조회 수: 3 (최근 30일)
Muhammad Usman Saleem 2016년 6월 25일
댓글: Walter Roberson 2016년 7월 13일
I have these three images meterology. First image is weather chat of 100m, second is of 200m, thrid is of 300m.
I have these three images meteorology. First image is weather chat of 100m, second is of 200m, third is of 300m
This is roughly prototype of my idea what i want
Both longitude and latitude are same in three images, I want to just makes longitude as x - axis, latitude as y axis and 100m image at 100, 200m image at 200 ....
i able to producce this code,
I = cat(4,a,b,c);
data = importdata('gpheight300.txt') ;
x = data(:,1) ; x = unique(x) ;
y = data(:,2) ; y = unique(y) ;
%# coordinates
[X,Y] = meshgrid(1:size(I,2), 1:size(I,1));
%[X,Y]=meshgrid(x,y);
Z = ones(size(I,1),size(I,2));
kin=[100 200 300];
for k=1:length(kin)
surface('XData',X, 'YData',Y, 'ZData',Z.*kin(k), ...
'CData',I(:,:,k), 'CDataMapping','direct', ...
'EdgeColor','none', 'FaceColor', 'texturemap')
% patch('XData',X, 'YData',Y, 'ZData',Z.*kin(k),'CData',I(:,:,k))
end
%colormap(cmap)
view(3), box on, %axis tight square
%set(gca, 'YDir','reverse', 'ZLim',[0 size(I,3)+1])
saveas(gcf,'3d','jpg');
This code producing surface in which all three images becomes brown color,(wrapped) when i save them just is this blank 3d block save appear.
Can some one tell me how i can do this 3d slicing of images?
##### 댓글 수: 8이전 댓글 6개 표시이전 댓글 6개 숨기기
Walter Roberson 2016년 6월 30일
Muhammad, if Mathworks ever instituted a policy that the volunteers were not permitted to give personal views, then I would stop volunteering immediately; perhaps I would go back to the Usenet Group, which would certainly not have such a restriction.
Muhammad Usman Saleem 2016년 7월 12일

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

### 답변 (1개)

Image Analyst 2016년 6월 26일
Try using "hold on" in your loop.
##### 댓글 수: 17이전 댓글 15개 표시이전 댓글 15개 숨기기
Muhammad Usman Saleem 2016년 7월 1일
편집: Muhammad Usman Saleem 2016년 7월 1일
i got this code example from google, where author use index map instead of rgb image then use surf function. Which i really do not know why? What function can we use with rgb?
the link is not of my use, bz i am not using gray scale image
Walter Roberson 2016년 7월 13일
Muhammad Usman Saleem comments to Image Analyst's response of 30 Jun 2016
not of the solution to this problem

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

### 카테고리

Help CenterFile Exchange에서 Image Arithmetic에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by