how to make a slice of multiple images in 3d
Show older comments
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,
a=imread('100.jpg');
b=imread('200.jpg');
c=imread('300.jpg');
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 Comments
Walter Roberson
on 25 Jun 2016
What difference is there between this question and your previous question on this topic, which you have now deleted?
Muhammad Usman Saleem
on 26 Jun 2016
Walter Roberson
on 27 Jun 2016
Sometimes people are distracted. Or ill. Or just not interested in the topic. Or do not understand the question. Or do not feel that they have anything to contribute to the question. Or are in a bad mood. Or feel like the poster had not put in enough effort. Or have other things to do on a weekend. Or feel like the question is "too big" for the attention they feel up to paying.
Muhammad Usman Saleem
on 27 Jun 2016
Edited: Muhammad Usman Saleem
on 27 Jun 2016
Walter Roberson
on 27 Jun 2016
We are volunteers. We don't need excuses. If we do not feel like contributing, we don't have to contribute. If it isn't fun for us, then we can turn our attention elsewhere and you have no grounds for grumbling.
For example I have many months worth of home repairs that should be done, including items that the city inspectors would probably order me to fix immediately if they ever happened to come by. If you are implying that I "owe" my volunteering to you or anyone, then why do I not see you at my home fixing my roof for free?
Walter Roberson
on 30 Jun 2016
Muhammad Usman Saleem comments, in response to my "We are volunteers" post:
some body guide these seniors voluntars , try to resolve this questions, instead of giving personal views and irrelevant posting on this question. I shall be very thankful for this kind favor.
Walter Roberson
on 30 Jun 2016
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
on 12 Jul 2016
Answers (1)
Image Analyst
on 26 Jun 2016
0 votes
Try using "hold on" in your loop.
17 Comments
Muhammad Usman Saleem
on 26 Jun 2016
Edited: Muhammad Usman Saleem
on 26 Jun 2016
Muhammad Usman Saleem
on 26 Jun 2016
Image Analyst
on 26 Jun 2016
What is a "100m image"? I don't know what "need to hand up 100m image to it z-axis" means. What do you mean by hand? Like "hand over" as in to deliver something??? How do you do that to a z axis?
Muhammad Usman Saleem
on 27 Jun 2016
Edited: Muhammad Usman Saleem
on 27 Jun 2016
Image Analyst
on 27 Jun 2016
It's brown because you're probably using imagesc() instead of imshow(), and you have gray scale image. imagesc() assumes the image is indexed instead of grayscale and applies some funky colormap for some reason. Don't use imagesc(). I never do. Only use imshow().
Muhammad Usman Saleem
on 27 Jun 2016
Muhammad Usman Saleem
on 27 Jun 2016
Image Analyst
on 28 Jun 2016
I tried to run it but you forgot to attach 'gpheight300.txt' so it errored out. If you want use to try your code you'll have to give us all the data that is needed and tell us what special toolboxes might be needed.
Muhammad Usman Saleem
on 28 Jun 2016
Muhammad Usman Saleem
on 28 Jun 2016
Edited: Muhammad Usman Saleem
on 28 Jun 2016
Image Analyst
on 29 Jun 2016
I just haven't had the time to devote to you. Vacations, plus backlog at work, etc.
Muhammad Usman Saleem
on 30 Jun 2016
Walter Roberson
on 30 Jun 2016
Image Analyst has not made any irrelevant answers to this question. His replies have reflected the available information at the time.
This site is not just about Questions and final solutions: the parts that show how the solution was arrived at can be as important. Imagine, for example, a book that had a list of integrals and a list of their solutions: such a book has some use as reference tables, but more important to most people is a book that shows the key steps needed to arrive at the solution to the integrals.
Image Analyst
on 30 Jun 2016
I really don't know what you want. You're taking individual color channels and then apparently trying to display them as surfaces with some colormap for some reason. Perhaps you should look at this: http://www.mathworks.com/matlabcentral/fileexchange/29485-meshcanopy

Walter Roberson
on 30 Jun 2016
Muhammad Usman Saleem comments on my response, above:
some body guide these seniors voluntars , try to resolve this questions, instead of giving personal views and irrelevant posting on this question. I shall be very thankful for this kind favor.
Muhammad Usman Saleem
on 1 Jul 2016
Edited: Muhammad Usman Saleem
on 1 Jul 2016
Walter Roberson
on 13 Jul 2016
Muhammad Usman Saleem comments to Image Analyst's response of 30 Jun 2016
not of the solution to this problem
Categories
Find more on Red in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!