Azzera filtri
Azzera filtri

direction of Y Axis is changing

1 visualizzazione (ultimi 30 giorni)
Mohannad Ajamieh
Mohannad Ajamieh il 27 Mag 2022
when I plot an image in point form the direction of Y Axis is changing!
how can I make 0-Y and 0_X in the same position
there is three dimention because I worke on volume image
label=I;
[X,Y,Z]=meshgrid(1:size(label,1),1:size(label,2),1:size(label,3));
label=label>0; % für logischen Eintrag
Data=label; % Für Farbeintrag
ind=Data(:)>0; % keine Null - einträge
px=X(ind);
py=Y(ind);
pz=Z(ind);
color=double(Data(ind));
%% point plot
set(gca,'YDir','normal')
plot3(px,py,pz,'.')
xlabel('X µm')
ylabel('Y µm')
zlabel('Z µm')

Risposte (2)

Jonas
Jonas il 27 Mag 2022
calling
set(gca,'XDir','normal');
should be enough
  2 Commenti
Mohannad Ajamieh
Mohannad Ajamieh il 30 Mag 2022
Sorry it does not work.
As you can see in the code, I already included it .......set(gca,'YDir','normal')..... and I also tried the 'reverse' but it does not work too.

Accedi per commentare.


Walter Roberson
Walter Roberson il 30 Mag 2022
[X,Y,Z]=meshgrid(1:size(label,1),1:size(label,2),1:size(label,3));
That is incorrect. size(label,1) is the number of rows, and rows correspond to Y not to X. size(label,2) is the number of columns, and columns correspond to X not to Y.
  5 Commenti
Walter Roberson
Walter Roberson il 31 Mag 2022
What is your current code?
Mohannad Ajamieh
Mohannad Ajamieh il 1 Giu 2022
clear all
close all
names=dir('......source folder.........');
for iii=1:size(names,1)
I(:,:,iii)=imread(strcat('........source folder..........',names(iii).name));
for j=1:size(names,1)
Img_3D=surface('XData',[0 75;0 75],'YData',[0 0;75 75],'ZData',[0.2985*j 0.2985*j;0.2985*j 0.2985*j], 'CData' ,flipdim(im2double(I(:,:,iii)),1),'FaceColor','texturemap','EdgeColor','none');
colormap(gray)
xlabel('10*x mm')
ylabel('10*y mm')
zlabel('10*z mm')
end
end
label=I;
[X,Y,Z] = meshgrid(1:size(label,2),1:size(label,1),1:size(label,3));
label=label>0; % für logischen Eintrag
Data=label; % Für Farbeintrag
ind=Data(:)>0; % keine Null - einträge
px=X(ind);
py=Y(ind);
pz=Z(ind);
color=double(Data(ind));
%% punkt plot
plot3(px,py,pz,'.')
title('punkt darstellung')
xlabel('X mm')
ylabel('Y mm')
zlabel('Z mm')

Accedi per commentare.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by