# I wish to process around 2000 CT images. these are CT image of Material. I wish to find the size of 3D inclusion.

3 views (last 30 days)
Vikas Verma on 2 Jun 2022
Commented: Rik on 21 Jun 2022
Hello,
I am new to MATLAB ...
I wish to do following things ....
1. Read around 2000 CT images of a metal specimen.
2. defect in metal are dark in color. I wish to calculate the 3d size of the defect.
Please guide me for the following steps:
1. How to read 2000 CT images ..
2. how to set the threshold intensity for identification of defect in the CT image
3. how to calculate the 3D size of the defect and the CT image in which the 2d area of the inclusion is maximum.
Rik on 21 Jun 2022
You need to choose:
1. Delete the rows in the table (without modifying the label array)
2. Modify the label array
The last request ("How to label the objects in 3D array which have been shortlisted") is mutually exclusive with what you posted before ("i had to remove the L=bwlabel(Volume) command Because L was 2048x2048x2048 and my computer ran out of memory").
The code below shows you how to modify the label array by modifying the conditional statement. You can edit the table regionprops3 returns just like every other table you have encountered in the Onramp course.
rng(1)%set the seed to get repeatable results for random functions
L=randi([0 8],[30,20,7]);%small synthetic data
stats=regionprops3(L,{'EquivDiameter','Volume','Image'})
stats = 8×3 table
Volume Image EquivDiameter ______ _________________ _____________ 451 {30×20×7 logical} 9.5146 510 {30×20×7 logical} 9.9127 436 {30×20×7 logical} 9.408 444 {30×20×7 logical} 9.4652 491 {30×20×7 logical} 9.788 485 {30×20×7 logical} 9.748 474 {30×20×7 logical} 9.6737 447 {30×20×7 logical} 9.4864
for n=1:max(L,[],'all')
if ... % remove if any of the conditions are true
stats.Volume(n)<500 || ...
size(stats.Image,1) > 150 || ...
size(stats.Image,2) > 200 || ...
stats.EquivDiameter(n)<5
L(L==n)=0;%mark as background
end
end
stats=regionprops3(L,{'EquivDiameter','Volume','Image'})
stats = 2×3 table
Volume Image EquivDiameter ______ _________________ _____________ 0 { 0×0 logical} 0 510 {30×20×7 logical} 9.9127

R2021a

### Community Treasure Hunt

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

Start Hunting!