- how the data is stored (in 2D it is very straightforward, but not in 3D): is it slice by slice (which plane, xy,xz,or yz)
- data type and format (binary, or integer?)
- data size for each dimension x,y,z
How to read a .dat file and creat a 3D image
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello there,
There's a .dat file in which the value at each voxel is 1 (solid) or 0 (pore). Dose anyone know how to import this .dat file into Matlab and creat a 3D image of porous media?
Thank you,
Rick
0 commentaires
Réponses (1)
Giao Vu
le 3 Déc 2019
Modifié(e) : Giao Vu
le 3 Déc 2019
first u need to know:
fileid = fopen('mydata.dat','r');
data = fread(fileid, inf, 'single', 'ieee-be'); %read till the end of file
data = reshape(data,[dimx dimy dimz]); % reshape data
0 commentaires
Voir également
Catégories
En savoir plus sur Biomedical Imaging dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!