How to make image array with X,Y coordinates and displacement?

Hi guys. I need some help.
I have 5883 x 5 matrix data. it was made by Abaqus (Finite Element method) program. first column is just node number. second column is X coordinate, third column is Y coordinate, fourth column is Z coordinate, fifth column is displacement.
I just want to make 256 * 256 matrix from this data for visualizing and processing with imagesc. (I just want 2D image (X,Y and displacement only))
You can check this data with this code.
figure;scatter3(centerSlice(:,2),centerSlice(:,3),centerSlice(:,4),100,centerSlice(:,5),'.');
please help. thanks.

 Accepted Answer

If you have nodal connectivity data and coordinates, displacement data in hand, you can use the following file-exchange.

18 Comments

Really thank you for your answer.
Actually I have element data. mesh shape is hexadron. so..element data is (Element Number, node 1, node 2, node 3, ...node 8) But, this is 3D... Is it the only way?
So you want a 3D mesh or a 2D mesh of a specific part of the whole mesh?
I want whole 3D data if it is possible, but I wonder it's so hard works to me... I also have element data.
first column is element numbers, second to ninth columns are node numbers. I upload element data file. is it right?
thank you.
Huumh...it can be done...but my question is...why MATLAB? You can happily plot this in abaqus itself eh..
I have to image processing with displacement data. but it can't be in Abaqus. My work is making stiffness map with displacement. So I want 256 * 256 cylinder images with these datas...
thank you.
Okay...you have given me nodal connectivity, but where are the coordinates? You need to attach coordinates data too..:)
Ah I forgot XD.
Here nodes.mat file is coordinates data.
first column is just nodes number. 2nd to 4th columns are x,y,z coordinates. mesh size is so small and not uniform. I also upload images for easy to understand.
I processed about my data with your code. but It takes so long time and have some errors haha. my final work is making stiffness map with x,y,z,displacement data and some equations in Matlab. If you want, I can explain more detail about my work.
thank you for your attention and help. I'm so appreciate.
I practiced with different data. and your code is work very well. But, I have have to calculate differential equation to get stiffness map pixel by pixel.. Is it possible to make 256*256 or 128*128 or 64*64 displacement matrix?
That code...need to be updated...it can be made fast.....I will/have to do it.....mean while let me check your data...:)
Hey....happy to see the pictures....actually your data is quite heavy and MATLAB is taking hell lot of time to finish the job. I was to suggest you to check on less data. I have have to calculate differential equation to get stiffness map pixel by pixel.. Is it possible to make 256*256 or 128*128 or 64*64 for this, you need to explain a bit more...it is not clear to me.
It means like this image
for example, Slice that cylindrical structure, and get xy plane images 256 by 256 pixel (matrix). I hope you understand..
Thanks
Okay...check this code....this code plot's each slice separately:
P = load('nodes.mat') ;
coor = P.nodes(:,2:end) ;
x = coor(:,1) ; y = coor(:,2) ; z = coor(:,3) ;
R = sqrt(x.^2+y.^2) ;
idx = R>=0.04 ; % pick only these elements
x = x(idx) ; y = y(idx) ; z = z(idx) ;
% plot individual slices
[c,ia,ib] = unique(z) ;
figure
hold on
for i = 1:length(c)
xi = x(ib==i) ; yi = y(ib==i) ; zi = z(ib==i) ;
plot3(xi,yi,zi,'.','color',rand(1,3))
end
Thanks.. But It is not matrix what I want.. I want show with function imagesc(I).
My work is find some difference MRI experiment data and simulation data.
these 2 images are MRI Experiment data. these are 256 * 256 pixel images.
I want to make images like this with my Abaqus node and displacement data... But I don't know how..
I also upload this image datas.. you can check
imagesc(P1);colormap('gray');axis off square;colorbar;
imagesc(M1);colormap('gray');axis off square;colorbar;
please check.. Thank you.
Yes....in my last code...I gave each slice separately.....you can give displacement to that..and convert that into matrix, and show the images in the way you want.
Yes you're right.. but I don't know how to convert.. this coordinate datas are double type.. if coordinates are like (1,1) (1,2) (1,3) ... I think I can, but this coordinates are (-0.0233345237,0.0233345237) like it. How can I do?
YOu can make your mesh like this:
N = 50 ;
R0 = 0.04 ; R1 = 0.08 ;
th = linspace(0,2*pi,N) ;
R = linspace(R0,R1,N) ;
[R,th] = meshgrid(R,th) ;
X = R.*cos(th) ;
Y = R.*sin(th) ;
Z = zeros(size(X)) ;
surf(X,Y,Z)
You need to interpolate your displacement data with these X,Y so, that you can use surf and get the plot you want.
okay.. Thank you for your answer and attention. I learned many things.
Good luck and have a nice day.

Sign in to comment.

More Answers (0)

Asked:

on 21 May 2018

Commented:

on 23 May 2018

Community Treasure Hunt

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

Start Hunting!