필터 지우기
필터 지우기

LOADING TIFF FILES AND GENERATING A 3D PLOT SHOWING THE PORES

조회 수: 29 (최근 30일)
Enoch
Enoch 2023년 6월 15일
댓글: Enoch 2023년 6월 16일
How can i generate a 3D plot of a tiff file for a rcok sample (that will be converted to an array) shoing just the pores in the rock
In essence what i woiuld like to do is to
Read my stack of tiff files into an array
Get porosity values
Genearte arrays of porosity
Visualize the rock pores

답변 (1개)

Shubh Pareek
Shubh Pareek 2023년 6월 16일
To generate a 3D plot in MATLAB of a tiff file representing a rock sample with just the pores showing, you can follow these general steps:
  1. To read the stack of tiff files into an array use the function "imread" to read the stack of tiff files into a 3D array in MATLAB.
image_stack = imread('sample.tiff');% use whatever is the name of your file,it should be in same directory
2. To determine the porosity values for defining the proportion of pores in the rock sample. It can be calculated by thresholding the image stack with a suitable threshold value to extract the regions corresponding to pores.
level = graythresh(image_stack);
bw_stack = imbinarize(image_stack, level);
voxel_volume = 0.03.*0.03.*0.03; % voxel volume in cubic millimeters
porosity_stack = sum(bw_stack(:)==1) ./ size(bw_stack(:),1) ./ voxel_volume;
3.To Create a 3D visualization of the rock pores , use the isosurface function to extract the pores from the thresholded image stack and create a polygonal surface for each pore. The resulting surface can be plotted using "patch" function.
pore_surface = isosurface(bw_stack,0.5);
figure;
patch(pore_surface,'FaceColor', 'blue', 'EdgeColor', 'none');
view(3);
axis tight;
daspect([1 1 1]);
light('Position',[0 0 1],'Style','infinite');
light('Position',[0 0 -1],'Style','infinite');
lighting gouraud
In this example, I used a voxel size of 0.03 mm and a threshold of the grayscale threshold that determined by the Otsu's method for binarization of the image. You may need to adjust these parameters based on the specific application.
I hope this helps with your query .
Resources for the commands used -
  댓글 수: 2
Enoch
Enoch 2023년 6월 16일
I followed your approach but i noticed
Error using isosurface
V must be a 3D array.
Error in Cores (line 6)
pore_surface = isosurface(bw_stack,0.5);
Enoch
Enoch 2023년 6월 16일
To Replicate along the third dimension
bw_stack = repmat(bw_image, [1 1 10]);
I added this code...
This is my result (attached)
I think now i would like to isolate just the pores and visualize that

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

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by